Exporting history data to an RDBMS

Each RDBMS device has an associated History Device Extension, which you can use to create export history descriptors for exporting data to an RDBMS (MySQL, Oracle, and SqlServer). You can export data manually or on a regular basis.

You are working in Workbench running on a PC, are connected to a Supervisor station and have access to a relational database on your company’s network. Your target database is licensed.
The driver supports two database schema, which provide data export by ID or by type. The RdbmsNetwork driver creates the database tables and schema automatically as it exports each history.

Your DBA (Database Administrator) may consider an export by type to be more suitable for the post process ETL (Extracting, Transforming and Loading) of the data beyond the flat file produced by the driver. This is because the driver creates fewer tables and requires fewer permissions on the database.

In the following steps, the term RDB refers to any of the database types. The data export by History ID is the default mode, which is more efficient when using the Rdb Archive History Provider to read the data back into the station at query time.

  1. In the Nav tree, expand Config > Drivers > RdbmsNetwork, expand your RDB node and double-click the Histories node.
    The History Export Manager opens.

  2. Do one of the following:
    • To create a new export descriptor, click the New button.
    • To discover existing histories that are available to export, click the Discover button, find and select a history whose data you want to export.
    If you clicked New, the New window opens.

  3. Configure the properties, and click OK.
    The new history export descriptor(s) appear(s) in the Database (lower) pane of the History Export Manager.
  4. To initiate an export action, do one of the following:
    • Select one or more history descriptors in the Database pane and click the Archive button.
    • Right-click on a single history descriptor in the Database pane and click Actions > Execute.
    • Using the Daily or Interval settings, as set in the New or Edit windows, allow the export to occur, as scheduled.
    The Database pane displays the status and time of the last export action in the Status and Last Success columns, respectively. Each export descriptor appears under the Histories node in the Nav tree.
The first time you export histories, the driver creates meta tables. The HISTORY_CONFIG and HISTORY_TYPE meta tables include a column for DB_TIMEZONE. This column is based on the Timestamp Storage property on the rdb Database device. The DB_TIMEZONE column stores the actual timezone that the database is currently using to store timestamps (this is different from the pre-existing TIMEZONE column, which reflects the timezone in which the history was created but not the one in which it is being stored). When records are being exported in UTC mode, the DB_TIMEZONE column updates accordingly.

For more detailed information about the History Export Manager, refer to the Niagara Drivers Guide.