Configuration of the backup

Configuration is usually carried out via the panel for configuration. The following information is only supplementary and is intended for advanced users. The data point type _DataManager was extended with the node "Backup" with the following DPE for the backup (with version 2.10.1.4 SP1):

Table: Node Backup of the DPT _DataManager

Data point element Type Example Meaning
Command int 1, -1 Controls backup
Status int -4 Status of the current or previous backup
Timeout int 300 Maximum time that the backup may take.
MemoryKBLimit int 65 Minimum size of free virtual memory
MaxBufferedMessages int 10000 Maximum number of buffered messages
Inputfile struct Data for the input file of WCCOAtoolMedia
Command string "backup" Command for WCCOAtoolMedia, always "backup"
Device string "C:/tmp/backup" Target device / directory
Type string "FILE" Type of backup target, for example, "FILE", "DAT"
Compression bool 0 Is currently ignored, always set to 0.
StartTime time Selects the archive to be backed up.
UnsavedValArchs bool 0,1 With true (1), you can save the archives files that have not been swapped out yet.
Outputfile struct Contents of the output file of WCCOAtoolMedia
MasterError int 0 Contains "0" if the backup was successful or an error code
FileError dyn_string Contains files with an error code, where an error has occurred

Backup.Command

Controls the backup. Permitted constants are:

  • 1 starts a backup. The DPE under Backup.Inputfile must already contain the valid values at this time. It therefore makes sense to set these values first and then initialize the Backup.Command.

  • -1 aborts an ongoing backup.

Backup.Status

Indicates the backup status. Possible constants are:

  • 0 BackupOK: No backup currently running, the last backup has been successful. Backup.Outputfile contains the result of the last backup.

  • 1 BackupRunning: A backup is currently active, the Data Manager is in backup mode

  • -1 BackupAbort: A backup has been aborted by setting Backup.Command.

  • -2 BackupMQOverflow: The last backup has been aborted since the maximum buffer size had been exceeded.

  • -3 BackupTimeout: The last backup has been aborted due to a timeout.

  • -4 BackupCored: WCCOAtoolMedia returned an exit code not equal to 0 and therefore could not carry out the backup or the output file could not be opened.

  • -5 BackupError: The last backup has been completed, but errors occurred. Further information can be found under Backup.Outputfile.

  • -6 BackupMemExhausted: The backup has been aborted since the available virtual memory exceeded the configured limit.

Backup.Timeout

Indicates the maximum time that a backup may take. If this time is exceeded, the backup will be aborted with the status "-3". A value of <= 0 allows any length of backup times, that is, there is no time monitoring and the user must take care of this for himself.

Backup.MemoryKBLimit

Defines the lower limit of the available virtual memory. By default, this is defined as the value from _MemoryCheck.EmergencyKBLimit plus 50 MB. This means at least 60 MB, even if nothing has been set for memory monitoring. The value that is specified here must lie at least 50 MB above the value that is used for monitoring of the memory. This will prevent the Data Manager from landing in EM (Emergency mode) during backup. If the available virtual memory exceeds this value, backup will be aborted with the status "-6".

CAUTION: The available disk space is not monitored during backup. Make sure beforehand that there is sufficient disk space. Do not create a backup on the same disk on which the actual database resides.
CAUTION: The backup mode does not check the virt. memory. Do not save if you set checkMemory = 0 in the config file or specify a value < 0 in the DP for the element MemoryKBLimit.

Backup.MaxBufferedMessages

Defines finally the maximum number of buffered messages. As most messages are quite short and when sufficient virtual memory is available, many messages can occur during backup. These block the Data Manager and the system for a considerable amount of time, even after leaving BM (Backup mode). For this reason it is possible to restrict the maximum number of buffered messages through this DP. If the configured number is exceeded, the backup will be aborted with the status "-2". A value <= 0 switches off monitoring of the buffer length. By default, the maximum number is 100.000 messages.

Backup.Inputfile

Corresponds to the structure of the input file, except for the DPE StartTime, (see Input file) for WCCOAtoolMedia. The DPEs have the following meaning:

  • Command

Specifies a command for WCCOAtoolMedia. Of the possible values "backup", "restore", "rewind", "eject" and others, only "backup" is of interest here. Valid commands are not checked since otherwise the Data Manager would have to be modified every time WCCOAtoolMedia was modified.

  • Device

Specifies either the device or the directory to which the backup is to be made. Possible values are, for example, "C:/tmp/backup" for a backup to disk under Windows or "tape0" for backup to a streamer. No check is carried out in the Data Manager whether the target exists and can be written on. WCCOAtoolMedia carries out this task.

  • Type

Indicates the type of device. Possible values are "FILE" for a backup to disk or "DAT" for backup to a streamer. The Data Manager does not check the values for validity.

  • Compression

Is currently not used and should always stand at "0".

  • StartTime

Decides what files are to be backed up. Using this time as a basis, the Data manager generates a file list for WCCOAtoolMedia. This always contains all the database files from the WinCC OA DB directory (*.dbd, *.db, *.key), the directories "alliving", "aloverflow", "empty" and "lastval" as well as all the archives (values and alarms) that contain the values from this time. The time is an interval, not an absolute time. The Data Manager therefore selects the records in which values from this time interval lie before the current time, for example, the past 4 weeks.

  • UnsavedValArchs

Defines whether archive files not swapped out have to be saved (TRUE) or not (FALSE).

During backup, the Data Manager checks every 60 seconds whether backup is completed or has to be aborted and sets the status DP and the outputfile DP.

Abort conditions

  • A timeout has occurred.

By default, the time is not monitored. In the DPE _DataManager.Backup.Timeout you can specify a maximum time in seconds (is configured in the panel).

  • The maximum buffer size for messages has been exceeded.

By default, only a maximum of 100,000 messages are buffered. You can modify this value in the DPE _DataManager.Backup. MaxBufferedMessages (is specified in the panel). Only the number of messages is taken into consideration, not their memory consumption.

  • The virtual memory has been exhausted.

During backup, 50 MB more virtual memory must be available than is required for switchover to the emergency mode. This prevents the Data manager from going into emergency during or shortly after backup. If no value has been specified for either DPE _MemoryCheck.EmergencyKBLimit or DP _DataManager.Backup.MemoryKBLimit, a minimum of 60 MB is used.