Until now the archive tables in the WinCC OA database had a fixed structure. A table always comprised the same specific columns. Using the user defined archive groups, you can create your own archive groups.
You can create archive table structures according to your needs as well as create flexible and faster database queries.
The archive table structure is created with the help of templates. A template again comprises a data point node that specifies the structure of an archive table. A template is used to create a user defined archive group. This chapter explains how to create and use user defined archive groups.
NOTE A license is required for the use of RDB. There
are three different options for the license key rdb_archive:
Figure: Data point Node "Node1" comprising the elements "A" and "C"
Figure: Database table comprising the Columns "A" and "C"
A table always contains the columns ELEMENT_ID and TS (Primary keys), as well as the SYS_ID (for partitioning) and BASE (for copying base set from exported archives to the oldest online archive) columns. The individual data point elements are single columns of the database table.
CAUTION You cannot change user defined archive groups. You can only delete and recreate them. This also applies to the underlying DP structure.
CAUTION User Defined Archive Groups can only be used when the data is written using Oracle Call Interface (OCCI). For more information on OCCI, see chapter Requirements and installation).
CAUTION The column names (DP elements) used for user defined archive groups must start with an alphanumeric character (from a to z upper or lower case letters).
CAUTION The entry "writeWithBulk = 1" has to be set in order to use the user defined archive groups (see also Requirements and installation). The user defined archive groups cannot be used under Solaris.
CAUTION Since a table always contains the elements ELEMENT_ID and TS (primary keys) as well as SYS_ID and BASE you cannot add columns (data point elements) with these names. Additionally, no keywords may be used (a list of words that cannot be used as table names is included below). The database is not case sensitive. Therefore, you cannot add, for example, two columns (two data point elements) called "Id" and "ID" (even though one word is written in upper and the other in lower-case letters).
How to create a user defined archive group
CAUTION The elements of a node containing an archive config cannot be dyn or blob elements and the node must not contain any sub nodes. CAUTION User defined archive groups can only be used for DP types containing the same type of DP structure as the template.
Figure: RDB File Selection Panel
The panel for creating templates opens: Figure: Panel for creating User defined Templates
CAUTION A template name can contain up to 21 characters. Create a new template by clicking the New template button. The panel for creating new templates opens. Select the root node of the data point created earlier via the data point selector. The sub elements are shown in the column Table columns and the element types in the Type column. The table index can be used to make the database queries faster. Click on Create . In this example, the template ARCHIVEGROUP_DP_ROOTN has been created.
CAUTION Note that a maximum of nine indexes can be created for a history table.
Figure: Panel for creating a new Template
Figure: RDB File Selection Panel
The panel for creating new archive groups opens.
CAUTION A group name can contain up to seven characters.
Figure: Panel for creating a new Archive Group
Specify the name for the group. The manager number is the number of the RDB archive manager in the console. Activate the User Defined Archive Group checkbox and select the created template from the combo box. Click on OK. The archive group "Group1" is created and shown in the RDB file selection panel (see figure earlier on).
Figure: Data point "ArchiveGroup_DP" with an Archive config
CAUTION User defined archive groups can only be added to sub nodes (not to main nodes) that do not contain any nodes but only elements (leaves). (see figure above). CAUTION _corr.._value or _online.._value cannot be saved.
NOTE Using the config entry sendUDAGNullValues
you can specify whether the Data manager should send
The following figure shows values of individual elements (of the group1.History view) for when the config entry sendUDAGNullValues has been set to 0 and for when it was set to 1.
Figure: Database Table
The rows 3 and 4 reflect a value change for when the sendUDAGNullValues was set to 0 (the value of a single element has been changed and the value of the other element has been set to the latest value). Row 5 again shows a value change for a single element when sendUDAGNullValues was set to 1. The value of the other element has been set to zero.
CAUTION When using User Defined Archive Groups, _original.._status and _original.._text do not exist in the RDB. QueriesCAUTION For external queries of the RDB (not through WinCC OA), all time stamps are saved in UTC.
NOTE Note that the query functions such as dpGetPeriod
do not work for user defined archive groups. To query
CAUTION Alarms are not shown (the alert panel cannot be used to view alarms). NOTE The function runRealSQLQuery uses the config entries of the valueArchiveRDB section ("DbUser", "DB" and "DbType". See chapter Possible config entries for RDB archiving). The password has to be entered using the RDB panels.
CAUTION In order to use the runRealSQLQuery function, you have to add the CtrlRDBArchive.dll to the CTRL section of the config.level file. CAUTION You cannot use the query SELECT *. Clean the RDB schema after failed UDAG creation manually
Save Strings containing more than 4000 characters in the DatabaseRequirements
In order to configure strings, open the RDB Setup and configuration of User Defined Templates panel through the System management panel -> Database tab -> RDB Archive Groups -> Manage Templates button -> New Template
Figure: User Defined Templates with the Option LongString
You can specify for each database column of type string whether it should be an extended string by checking the check box "LongString". In the database the following columns will be created for maxStringUDAG=12000:
LONGTEXT Varchar2(4000), LONGTEXT_1 Varchar2(4000) and LONGTEXT_2 Varchar2(4000)
The length of the column name is restricted to 27 characters. The LongString will be divided into 4000 byte columns. Since there is no RDB query function for the UDAG's, you have to query the columns yourself (for example „Select LONGTEXT || LONGTEXT_1 from UDAG where ….“). |
V 3.11 SP1
Copyright ETM professional control GmbH 2013 All Rights Reserved