![]() |
RTView®
User Guide |
Advanced Historian The Advanced Historian feature (RTView v.5.4+) provides the following ways to reduce the amount of data stored in the Historian cache table: Table Displacement and Data Aggregation. Both options enable you to automatically reduce the amount of stored data as a background process simply by defining rules for Table Displacement or Data Aggregation. The Advanced Historian feature can be used on new or existing Historian data collections, allowing you to manage existing historical data. With the standard Historian, data is reduced by manually backing up or deleting archived data. The Advanced Historian is an optional licensed feature that (when activated) provides additional Cache properties to describe your data management preferences. You then determine whether and how to reduce the amount of historical data for each table. If Table Displacement is used, archival data is removed and placed in a separate, new table, at a frequency that you specify (for example, once a day). If Data Aggregation is used, the number of data points is reduced. In this latter case, you specify, using rules, both the granularity and the method for reducing the amount of data (for example: the sum, average, count, minimum or maximum). The Table Displacement option might be suitable if you only need to view recent data, for example, for the last 24 hours. The Data Aggregation option is suitable if you need to view data from further in the past, for example, for the last few months or years. You configure the Advanced Historian feature using the obj_cache_table object and configuring Cache properties. To access the obj_cache_table object, in the Display Builder, select Tools>Caches to open the Caches dialog, add your caches, configure their properties, and Save the display (.rtv) file. You can use either Table Displacement or Data Aggregation on a single table, not both. If rules are not specified for either Table Displacement or Data Aggregation, neither displacement nor aggregation occurs. Data Aggregation The aggregation of data is performed by reading data from the Historian table, aggregating the data based on the rule specifications, and then writing it to the Historian table. Data Aggregation is performed at known intervals, specified by the compactiontimerinterval (the default setting is 5 seconds). You setup Data Aggregation by configuring the obj_cache_table cache object to supply data to the historian table. Single Versus Multiple Tables By default, Data Aggregation uses Single Table Aggregation. Single Table Aggregation
Multiple Table Aggregation When multiple tables are used, aggregated data is stored from the most recent point in time for all of the tables. This is different from Table Displacement where, as the data ages, each table storing the data has a different start date and time. This is necessary for a scenario in which multiple RTView data objects supply data to multiple trend charts, which show the historic data separately by interval. The following trend graphs illustrate how Multiple Table Aggregation might be displayed.
You configure Multiple Table Aggregation in the Edit Compaction Rule dialog. See Configuring Data Aggregation, Step 6 for information. By default, rules for all data are stored in a single table. The algorithm for Data Aggregation does not do compaction of data that was stored before the current historian session. Use -smoothCompaction to perform Data Aggregation on your previously existing data. Configuring Data
Aggregation These procedures require a Historian Compaction license key. NOTE: The algorithm for Data Aggregation does not do compaction of data that was stored before the current historian session. The following procedures include instructions to use -smoothCompaction, which performs Data Aggregation on your previously existing data. At this point you have:
To configure Data Aggregation on a cache table 1. In the Display Builder, select Tools>Caches to open the Caches dialog. The obj_cache_table object appears in the display.
2. Click Add. The Add New Cache dialog opens. 3. Enter a name for the cache and select Table from the Select the type of the cache drop-down menu. Add other caches as needed.
4. Click the obj_cache_table object in your display. The Object Properties window is populated with properties to configure Data Aggregation. 5. In the Object Properties window, under Data Compaction: Secondary (Historian), click the compactionType property, then select Aggregate.
6. In the Object Properties window double-click the compactionRules property to open the Compaction Rules dialog, then click Add to open the Edit Compaction Rule dialog.
7. In the Edit Compaction Rule dialog, create a rule by making the following entries. NOTE: If you choose to configure Multiple Table Aggregation, this is the Step in which you configure it. For each table, enter its name in the Alternate Table field, and configure the Compaction Rule (in the Retention and Compacted fields), as follows:
For example, if we configure the following rules:
the rules are then displayed in the Compaction Rules dialog as follows:
8. Click OK to apply the rule. 9. In the Object Properties window, double-click the compactionGroupBy property to open the Compaction GroupBy Columns dialog, then click Add to open the Edit Compaction GroupBy Column dialog. The columns in your table are populated in the Group Column drop-down menu. 10. In the Edit Compaction GroupBy Column dialog, select a column from the Group Column drop-down menu, then select the data aggregation method from the by drop-down menu:
NOTE: Typically, the sum or average method is used. 11. Click OK. The column and aggregation method is listed in the Compaction GroupBy Column dialog.
Click OK when finished applying the aggregation method to the columns. 12. In the Object Properties window, under Historian, click the quoteColumnNames property to specify how the column names are processed in the SQL database used for compaction. Choose True (checked) to preserve the column name case. True (checked) is recommended when possible. NOTE: This setting is used by Primary Compaction and Secondary Compaction.
13. In the Object Properties window, click the indexColumnNames property and enter a semicolon (;) separated list of column names to be used as index columns. (See indexColumnNames for details).
14. If you have pre-existing data (table data that was stored before the current historian session) you wish to compact, perform the following. The compaction rules you specified will be applied to the pre-existing data. In a command line, type: -smoothCompaction When it is finished compacting the historical data, the Data Aggregation compaction process automatically starts compacting all the data. While smoothing is executing, new (raw) data is also being stored by the Historian. NOTE: You may not be licensed to run all RTView features and/or data sources. 15. Save the display (.rtv) file. Proceed to Add a Display (.rtv) File to the Historian Application.
Table Displacement For example, let us say we configure Table Displacement for a table, ProductX, to occur every day at midnight. In our example, we also configure Table Displacement to archive the previous three days of data. This means we will have a total of four tables: the (original or source) ProductX table, plus one table for each of the three additional days (24-hour periods). At midnight at the end of the first day, the Advanced Historian archives each row in the ProductX table and places the data in a new table. The new table is named ProductX_<date>, where date is the date it is stored. To illustrate this example, we number the tables as they are created in the Advanced Historian process. At the end of the first day we have the following two tables:
The ProductX table immediately begins storing data for the next 24 hours. At midnight, the Historian again archives each row in the ProductX table and places the data in a new table, ProductX_<date> (Table #3, below):
The ProductX table, empty again, begins storing data for the next 24 hours. At midnight, the Historian archives each row in the ProductX table and places the data in a new table, ProductX_<date> (Table #4, below):
The ProductX table, empty again, begins storing data for the next 24 hours. At midnight, the Historian again archives each row in the ProductX table and places the data in a new table, ProductX_<date>. But now three archival tables exist, so the oldest table, Table #2 in this scenario, is deleted.
The following table describes options for the table name format:
Configuring
Table Displacement These procedures require a Historian Compaction license key. At this point you have:
To configure Table Displacement on a cache table 1. In the Display Builder, select Tools>Caches to open the Caches dialog. The obj_cache_table object appears in the display.
2. Click Add. The Add New Cache dialog opens. 3. Enter a name for the cache and select Table from the Select the type of the cache drop-down menu. Add other caches as needed.
4. Click the obj_cache_table object in your display. The Object Properties window is populated with properties to configure Table Displacement. 5. In the Object Properties window, under Data Compaction: Secondary (Historian), click the compactionType property, then select Displace.
6. In the Object Properties window double-click the compactionRules property to open the Compaction Rules dialog, then click Add to open the Edit Compaction Rule dialog. Table Displacement supports a single compaction rule.
7. In the Edit Compaction Rule dialog, create a rule by making the following entries:
8. Click OK. NOTE: Displacement rules are used if the same RTView object is being used to display data that starts again at a predefined interval. Use only a single displacement rule on each table or the rules will conflict. 9. Save the display (.rtv) file. Proceed to Add a Display (.rtv) File to the Historian Application. Add a Display (.rtv) File to the Historian Application 1. Start the Historian application to specify the configuration (.rtv) file.
The Historian application opens and begins gathering and placing your (now time-stamped) data into tables based on your Data Configuration file specifications. 2. Click Configuration to add the configuration (.rtv) file.
3. In Data Configuration Files, click Add, enter the name of the Data Configuration (.rtv) file you just created and, optionally, any corresponding substitutions. Substitutions allow the same file to be used multiple times by different sets of substitutions. NOTE: Each cache that is defined in the file should contain a substitution in the cacheName property, since cache names must be unique. 4. Click Apply to execute. Data Configuration files are added or removed after you click OK, Apply, or Save. NOTE: To edit the Data Configuration (.rtv) file and apply changes without restarting the Display Builder, select a file from the list and click Refresh Selection to reload definition settings. The Refresh Selection option is enabled when you select a Data Definition (.rtv) file that has been both added and applied. The Data Configuration (.rtv) file is added to the data source and data for these caches is collected. See the Attach to Cache Data section for details about attaching to cache data variables. NOTE: After a Data Configuration (.rtv) file has been added to the data source, data is collected for that cache regardless of whether any currently open display (.rtv) files are showing that data. 5. Select Show Data in Console so that the Historian prints out a line for each record that is being stored in the database. 6. Select Start Storing Data. 7. Select Save Configuration. 8. Verify your configuration by clicking Console to view the Show Data in Console output. Your setup is complete. After the Historian has stored data for a period of time, you can Build a Display Using History Data. Optionally, you can configure failover for the Historian. For information, see Configuring Failover on the Historian. |
|
|
|