CIM HT038 How to Setup the CIMPLICITY Database Logger …

22
1 CIM_HT038 – How to Setup the CIMPLICITY Database Logger to Log to an Oracle Database Outline The HMI/SCADA – CIMPLICITY Database Logger can log data to an Oracle database. The data logged can be point values, alarms, or events that have happened in the CIMPLICITY project. This document will explain the minimal configuration required to achieve Oracle Data logging on a CIMPLICITY Server. This document is dedicated to the installation and setup of Oracle 12c client software on the target CIMPLICITY computer and configuring CIMPLICITY DB Logger to connect to Oracle using the newly installed and configured Oracle client. The Oracle client includes the 32-bit ODBC driver and other needed programs for setup. This is important to note because Microsoft no longer provides the ODBC drivers for Oracle. There are two main parts to this document: 1. Oracle 12c Client Install and Setup 2. Database Logger Configuration Requirements Software CIMPLICITY 10.0/11.0 Development Server. Oracle 12c Server (64-bit) Oracle 12c Client (32-bit) 1. Oracle 12c Client Install and Setup The client setup is configured first because the CIMPLICITY Database Logger is a client that will need to connect to an existing Oracle Database to log data. The three steps in the install and setup of the Oracle client are: Download and install the client software. Create or Configure a TNS (Transparent Network Substrate) Service Name. Configure the Oracle Data Source Name (DSN). i. Download and install the client software. The Oracle client setup begins with downloading the 32-bit Oracle client install files. The 32-bit version of the Oracle client is used because the CIMPLICITY application is a 32-bit application. Open a web browser and navigate to the Oracle download page: https://www.oracle.com/database/technologies/oracle12c-windows-downloads.html

Transcript of CIM HT038 How to Setup the CIMPLICITY Database Logger …

Page 1: CIM HT038 How to Setup the CIMPLICITY Database Logger …

1

CIM_HT038 – How to Setup the CIMPLICITY Database Logger to Log to an Oracle Database Outline The HMI/SCADA – CIMPLICITY Database Logger can log data to an Oracle database. The data logged can be point values, alarms, or events that have happened in the CIMPLICITY project. This document will explain the minimal configuration required to achieve Oracle Data logging on a CIMPLICITY Server. This document is dedicated to the installation and setup of Oracle 12c client software on the target CIMPLICITY computer and configuring CIMPLICITY DB Logger to connect to Oracle using the newly installed and configured Oracle client. The Oracle client includes the 32-bit ODBC driver and other needed programs for setup. This is important to note because Microsoft no longer provides the ODBC drivers for Oracle. There are two main parts to this document:

1. Oracle 12c Client Install and Setup 2. Database Logger Configuration

Requirements

Software

• CIMPLICITY 10.0/11.0 Development Server.

• Oracle 12c Server (64-bit)

• Oracle 12c Client (32-bit)

1. Oracle 12c Client Install and Setup

The client setup is configured first because the CIMPLICITY Database Logger is a client that will need to connect

to an existing Oracle Database to log data.

The three steps in the install and setup of the Oracle client are:

• Download and install the client software.

• Create or Configure a TNS (Transparent Network Substrate) Service Name.

• Configure the Oracle Data Source Name (DSN).

i. Download and install the client software.

The Oracle client setup begins with downloading the 32-bit Oracle client install files. The 32-bit version

of the Oracle client is used because the CIMPLICITY application is a 32-bit application.

Open a web browser and navigate to the Oracle download page:

https://www.oracle.com/database/technologies/oracle12c-windows-downloads.html

Page 2: CIM HT038 How to Setup the CIMPLICITY Database Logger …

2

On the page that loads, look for the 32-bit client software.

Example: win32_12201_client.zip (32-bit)

Unzip the downloaded files onto the target client computer (i.e., where CIMPLICITY is installed).

ii. Prepare Computer for Installing 32-bit Oracle Client.

To successfully install the 32-bit Oracle client on a 64-bit Windows operating system you must first

create a registry entry for the location of the Oracle Inventory.

• Open regedit

Figure 1 – Opening Registry.

• Go to HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node

Page 3: CIM HT038 How to Setup the CIMPLICITY Database Logger …

3

Figure 2 – Manually Adding Path for Oracle 32-bit Install Location

• Create a new key with name "Oracle"

• Go to Oracle and then create a new String Value with name "inst_loc"

• Provide the value: "C:\Program Files (x86)\Oracle\Inventory"

iii. Oracle Client Installation

After the files are unzipped, then install the client by right clicking on the “setup.exe” and choosing

“Run as Administrator” from the right-click menu.

Figure 3 – Oracle 12c - 32-bit Client Setup Install Folder

iv. When the installation begins, on the “Select Installation Type” dialog it will ask what type of

installation to do. When prompted, choose the “Custom” option.

Page 4: CIM HT038 How to Setup the CIMPLICITY Database Logger …

4

Figure 4 – Choosing Installation Type

v. The “Select Product Language” dialog will ask what language to choose. Choose “English” and click

the “Next” button.

Figure 5 – Choosing Language (English).

Page 5: CIM HT038 How to Setup the CIMPLICITY Database Logger …

5

vi. When the “Oracle Home User Selection” dialog appears, choose the option to “Create New

Windows User” and type in a new username and password for the user.

Figure 6 – Creating or Choosing Windows User for Oracle Client.

vii. On the “Specify Installation Location” dialog, leave the default settings and click on the “Next”

button.

Page 6: CIM HT038 How to Setup the CIMPLICITY Database Logger …

6

Figure 7 - Specifying Client Install Folder.

viii. On the “Available Product Components” tab, choose the following options:

• Oracle Database Utilities

• Oracle Java Client

• SQL Plus

• Oracle Net

• Oracle Connection Manager

• Oracle Net Listener

• Oracle ODBC Driver

• Oracle Administrator Assistant for Windows

Page 7: CIM HT038 How to Setup the CIMPLICITY Database Logger …

7

Figure 8 – Choosing Components from List of Available Product Components.

ix. Allow the installation to proceed.

Figure 9 – Installer Performing Prerequisite Checks.

x. On the “Summary” dialog click on the “Install” button. This will begin the installation of the selected

components.

Page 8: CIM HT038 How to Setup the CIMPLICITY Database Logger …

8

Figure 10 – Summary After Prerequisite Checks.

xi. The installation will proceed. Wait until the installation is complete.

Figure 11 – Installation progress dialog.

Page 9: CIM HT038 How to Setup the CIMPLICITY Database Logger …

9

xii. After the installation is complete, click on the “Close” button.

Figure 12 – Conclusion of Install.

xiii. This concludes the install of the Oracle Client software.

2. Create/Configure a TNS (Transparent Network Substrate) Service

Name

The TNS Service Name is also called a Net Service Name. It is also referred to as the local name of the

remote Oracle Database. Configuration settings for TNS Service Name are saved on a local file called

“tnsnames.ora”.

The file is normally located at the Oracle install path such as shown below:

C:\app\ClientUser2\product\12.1.0\client_1\network\admin

The sample path above shows the client specific path for user named “ClientUser2”. This is the new

Windows name provided during the earlier installation steps.

This file does not normally exist when client is initially installed. There are two ways to create this file.

a. Copy an existing “tnsnames.ora” from the Oracle database computer and paste it in the client

location.

b. Create a new “tnsnames.ora” file using the “Oracle Net Configuration Assistant” installed on

the client computer. The steps below walk through the configuration steps.

i. Using the “Oracle Net Configuration Assistant” Utility

Page 10: CIM HT038 How to Setup the CIMPLICITY Database Logger …

10

The Net Configuration Assistant is Oracle’s a graphical tool used to configure TNS Service Name as

well as other services such as “Listener”. The “Listener” is mainly used for an Oracle Database

server.

Launch the “Net Configuration Assistant” application from the Windows Start menu.

Figure 13 – Open Net Configuration Assistant.

ii. After the application launches, click on radio button for “Local Net Service Name configuration”

and click the “Next” button.

Figure 14 – Setting Up Net Service Name for Client Driver.

Page 11: CIM HT038 How to Setup the CIMPLICITY Database Logger …

11

iii. Click on radio button for “Add” and click the “Next” button.

Figure 15 – Adding New Net Service Name.

iv. Enter the Service Name for your Oracle Server and click “Next”.

Figure 16 – Specifying Service Name.

v. When prompted for the protocol to use, choose TCP and click the “Next” button.

Page 12: CIM HT038 How to Setup the CIMPLICITY Database Logger …

12

Figure 17 – Choosing Protocol (TCP).

vi. On the next dialog for the “Host Name” field enter the TCP/IP address for the remote Oracle DB

server, and choose port 1521, or enter a different port if needed and click the “Next” button.

Figure 18 – Specifying Host Name or IP and Port Number.

vii. Choose “No, do not test” and click “Next”.

Page 13: CIM HT038 How to Setup the CIMPLICITY Database Logger …

13

Figure 19 – Skip Test and Click Next.

viii. Leave the Net Service Name as automatically chosen by the “Oracle Net Configuration

Assistant” (in this example “ORCL”) and click “Next”.

Figure 20 – Net Service Name

ix. When prompted to configure another net service name, choose “No” and click the “Next” button.

Page 14: CIM HT038 How to Setup the CIMPLICITY Database Logger …

14

Figure 21 - Option To Add Another Service Name.

x. On the dialog stating that it is complete, click the “Next” button.

Figure 22 – Conclusion of Net Service Name Configuration.

xi. When complete, click the “Finish” button.

Page 15: CIM HT038 How to Setup the CIMPLICITY Database Logger …

15

Figure 23 – Local Service Name Configuration.

After the utility is complete, it is a good idea to inspect the newly created TNSNames.ora file.

To inspect the file, open Windows Explorer and navigate to the path:

C:\app\user\product\12.1.0\client_1\network\admin

Where “user” is the name of the user account.

Locate the file named “tnsnames.ora”.

Figure 24 – Service Name File

Using Notepad, open the “tnsnames.ora” file.

This file has two key areas that ties this client to the remote Oracle DB server.

a. LISTENER_ORCL

b. ORCL

Note that these names may change depending on what was typed in for the net services name earlier.

Page 16: CIM HT038 How to Setup the CIMPLICITY Database Logger …

16

These two red boxes have all needed information for the Client to find and help connect to the remote

Oracle DB Server.

Figure 25 – Contents of Service Name “ora” File

3. Configuring the Oracle Data Source Name (DSN)

The ODBC Data Source Name (DSN) stores information for establishing a connection to a database on a

remote database server. This is required for the CIMPLICITY Database Logger to be able to know how to

reach the Oracle server.

i. On the client computer click on “Search” and enter “ODBC”.

ii. From the results, click on “ODBC Data Sources (32-bit)” to open 32-bit ODBC the ODBC Data

Source Administrator.

Page 17: CIM HT038 How to Setup the CIMPLICITY Database Logger …

17

Figure 26 – Opening 32-bit ODBC.

iii. Click on the “System DSN” tab and click on the “Add” button. The “System DSN” tab needs to be

used so that the ODBC Data Source will be available to all users on the computer.

Figure 27 – Add Oracle ODBC in The System DSN.

Page 18: CIM HT038 How to Setup the CIMPLICITY Database Logger …

18

iv. From the list of drivers, select the Oracle ODBC driver.

Note: The subscript of 1 in the name “Oracle in OracClient12Home” is the client number

corresponding to the number of clients install. Anytime you install Oracle client, a new Oracle

ODBC driver is added along with a subscript value.

Figure 28 – Identifying “driver” for the Oracle ODBC Name.

v. Enter the following information:

Enter name for Data Source Name of your choice (example “DB_Conn”).

ORCL for TNS Service Name (this is the same service name earlier)

Enter “system” for the User ID

Figure 29 – Configuring ODBC Data Source Name.

Page 19: CIM HT038 How to Setup the CIMPLICITY Database Logger …

19

vi. Click on “Test Connection”.

vii. Enter Service Name (ORCL), Use Name (system) and password when prompted.

viii. Click the “OK” button.

Figure 30 – Entering the Login Credentials for the Oracle DB Server.

ix. Click OK on the “Connection successful” popup.

Figure 31 – Testing Connection to the Oracle DB.

3. Configure the CIMPLICITY Datalogger In Project Properties In this section, a procedure on how to enable the Database logger in a project is provided. This will allow the project to connect to the Oracle DB server and begin logging point data for all points with DB Logger option enabled.

i. Enable Database Logger Options

• Click Project --> Properties on the Workbench menu bar.

Page 20: CIM HT038 How to Setup the CIMPLICITY Database Logger …

20

• Click the Project Properties button on the Workbench toolbar

Figure 32 – Opening CIMPLICITY Project Properties.

ii. Select Database Logger options

• Select the General tab and check database logger options that your system will use.

➢ Database Logger: A&E & App

➢ Database Logger: Points (only option selected in this sample setup).

• Click OK.

Page 21: CIM HT038 How to Setup the CIMPLICITY Database Logger …

21

Figure 33 – Enabling Project’s DB Logger Option.

iii. Configure ODBC Connections

• Open “Project Properties” again.

• Click on “Settings” → “Database Logger” → “Settings”

Figure 34 – Opening Settings for Database Logger.

iv. Configure Default Point Connection

• Click on “Default Point Connection” tab and enter:

➢ “DB_Conn” as ODBC data source name configured in the 32-bit ODBC

Administrator.

➢ “system” as Database user, and configured password for “system”.

• Click “OK”.

Page 22: CIM HT038 How to Setup the CIMPLICITY Database Logger …

22

Figure 35 – Choosing the Oracle DSN and Login Credentials for the Oracle DB.

4. Create a Sample Point to Log Data into Oracle.

The purpose of this section is to create a sample CIMPLICITY point and enable DB Logger to log data into Oracle DB Server.

• In project workbench, go to Points list.

• Right-click and choose "New" to create a new point.

• Enter a sample name for point, example "TESTDBLogger1".

• Choose "Virtual" for point type.

• Choose "Analog" for point class.

• Click OK

• In the General tab, enable DB Logging by clicking on "Log to database".

• Click on the Virtual tab.

• For Calculation, choose "Equation".

• In the Expression field, enter $PROJECT.DATE.SECOND

• That will auto generate values from 0 to 59 and repeat. Start project to start logging data into Oracle DB.