Enterprise RTView® 
User Guide


Historian Database Setup

The Historian stores and retrieves data from any database using JDBC. The Historian communicates with your database using either a direct JDBC connection or an ODBC-JDBC bridge connection. Both connections require some setup before the Historian can communicate with your database.

Direct JDBC Connection
Before the Historian can communicate with your database using a direct JDBC connection, you must have a JDBC driver for your database. JDBC drivers are available from most database vendors. Locate the JDBC driver on your machine and define an environment variable named RTV_USERPATH that includes a path to the driver class or .jar file that contains the driver class. NOTE: You may define RTV_USERPATH to include paths to multiple driver classes. The RTV_USERPATH variable is included in the classpath for Enterprise RTView and the Historian.

When you setup the database in the Historian, you must know the fully qualified class name for the driver class and the database URL required to connect to your database. The database URL typically contains protocol and sub-protocol strings for your database, as well as the path to the database and a list of properties. If you do not know the syntax for your database URL, consult the documentation for your JDBC driver.

ODBC-JDBC Bridge Connection
Before the Historian can communicate with your database using an ODBC-JDBC bridge, you must have an ODBC driver for your database. Most databases that run on Microsoft Windows come standard with an ODBC driver. You must also register your database with ODBC before accessing it from Enterprise RTView.

After you have setup your database, run the Historian and configure the connection in the Database Options section. Once you have configured the connection, the Historian will be able to connect to your database.  NOTE: If you are using a direct JDBC connection or a password protected ODBC-JDBC bridge connection to communicate with the history database, you will need to configure the history database in the Display Builder before viewing your history data. To configure the history database in the Display Builder, select Tools>Options>SQL and add a database with the same configuration options used in the Historian. See the SQL Application Options page in the Data Sources section of this documentation for more information.

 



Configuring History Tables
If you are configuring the Historian using display (.rtv) files that contain objects (other than Cache objects) attached to the data you would like to store, then you will need to configure two history tables in your database: one for numeric data, the other for string (i.e., textual) data. By default the numeric table is named HISTORY and the string table is named HISTORY_S. If these two history tables do not already exist in your database, they will be created for you the first time you run the Historian. If you do not want the Historian to create these tables, create your own history tables manually before running the Historian using the fields described in the tables below. NOTE: To store tabular data, it is recommended that you create a separate history table in the database.

It is possible to specify table names other than HISTORY and HISTORY_S using the -tablename command line option for the Historian. The table name you specify (e.g., MY_TABLE) will be used for the numeric table and a _S will be appended to that name for the string table (e.g., MY_TABLE_S). NOTE: Table names cannot contain spaces. If you do specify your own table name, you will need to indicate this name on the command line for the Display Builder and Display Viewer Application and/or in your Display Viewer Applet parameters.

To rebuild HISTORY and HISTORY_S tables each time you run the Historian use the -rebuildtables command line option for the Historian. Tables you have created manually will rebuild as data is received.

NOTE: Tables created manually cannot utilize the valueHistoryFlag object property to load initial history data on graph traces.

Numeric Data
The following fields are required in the numeric data table (HISTORY or the table name you specified):
 
Field Name Field Type Field Description Recommended Field Length (if applicable)
VAR_NAME Text The data attachment used to store this record. 80-160
TIME_STAMP Text The time this record was stored. This value is rounded to the closest second. Two columns are stored with each record.

This field is only necessary if String Timestamps (2) is selected in the Historian GUI. This is the default selection.

30
Standard SQL TIMESTAMP data type. This field is only necessary if SQL Timestamp is selected in the Historian GUI. N/A
TIME_STAMP_LS Text A string value of the time this record was stored. This value contains the time including milliseconds.

This field is only necessary if String Timestamps (2) is selected in the Historian GUI. This is the default selection.

14
VAR_VALUE double The value for this field. This value is a number. N/A

String Data
The following fields are required in the string (textual) data table (HISTORY_S or the table name you specified):
 
Field Name Field Type Field Description Recommended Field Length (if applicable)
VAR_NAME Text The data attachment used to store this record. 80-160
TIME_STAMP Text The time this record was stored. This value is rounded to the closest second. Two columns are stored with each record.

This field is only necessary if String Timestamps (2) is selected in the Historian GUI. This is the default selection.

30
Standard SQL TIMESTAMP data type. This field is only necessary if SQL Timestamp is selected in the Historian GUI. N/A
TIME_STAMP_LS Text A string value of the time this record was stored. This value contains the time including milliseconds.

This field is only necessary if String Timestamps (2) is selected in the Historian GUI. This is the default selection.

14
VAR_SVALUE Text The value for this field. This value is a string. 40

Tabular Data
To store tabular data, it is recommended that you create separate history table in your database or the Historian can create one for you. You can view this data from your tabular element in your display by using an SQL data attachment. For an example of storing tabular data, see the Archiving and Viewing Historical Data example.

If you have created a separate history table to store tabular data in your database, then specify the name of that table in the Object Properties list under historyTableName. If you specify a historyTableName and no table by that name exists in your database, then one will be created for you the first time you run the Historian. NOTE: You can use the -verbose command line option for the Historian to see the specific SQL command used to create this table.

History tables created to store tabular data must include a column for each column in your tabular data element, along with one or two TIME_STAMP columns placed at the end depending on which Timestamp Type you select. If you select the historyTableRowNameFlag checkbox in Object Properties, then you must include and additional text column placed at the beginning of the table to store row name values. The Historian assumes that columns in the history table you create are in the same order as those in your tabular data element. If not, you can use the -insertColumnNames command line option for the Historian to match data to the correct columns.

If you choose not to create a separate history table, then data from your tabular element will be stored in HISTORY or HISTORY_S and, in the case of tabular data with multiple columns, row integrity will be lost.

 

 

 

 


 

 

 


Register Your Database with ODBC

Windows:

1.    From the Windows Control Panel, double-click on the ODBC Data Sources icon. If this icon is not listed, double-click on the Administrative Tools icon and then double-click on the Data Sources (ODBC) icon. This will open the ODBC dialog.

2.    In the ODBC dialog, click Add. In the Create New Data Source window, select the driver for which you want to setup a data source. Click Finish to bring up the Setup dialog.

3.    Enter a Data Source Name (e.g. RTVHISTORY). NOTE: This Data Source Name must match the name of the history database configured in the Display Builder's SQL Application Options tab, as well as the Historian Database Name specified in the Historian GUI.

4.    Click the Select button and choose the database to which you would like the Historian to store data.

5.    Click OK in the Select Database, Setup, and ODBC dialogs.

UNIX:

UNIX systems do not come standard with an ODBC driver. Contact your system administrator for information on how to install and setup an ODBC driver for your database.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 


 
Enterprise RTView contains components licensed under the Apache License Version 2.0.

 

Treemap Algorithms v1.0  is used without modifications and licensed by MPL Version 1.1. Copyright © 2001 University of Maryland, College Park, MD

 

Datejs is licensed under MIT. Copyright © Coolite Inc.

 

JCalendar 1.3.2 is licensed under LGPL. Copyright © Kai Toedter.

 

jQuery is licensed under MIT. Copyright © John Resig,

 
JMS, JMX and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. They are mentioned in this document for identification purposes only. 

 
SL, SL-GMS, GMS, Enterprise RTView, SL Corporation, and the SL logo are trademarks or registered trademarks of Sherrill-Lubinski Corporation in the United States and other countries. Copyright © 1998-2009 Sherrill-Lubinski Corporation. All Rights Reserved.