![]() |
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
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
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.
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
String Data
Tabular Data
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.
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.
|
|
|
|
|
|
|
|