Swap out/backup archives

Note that the archiv_client.ctl has to run to obtain the functionality of the archive manipulations.

Project directories, that is, the directory from which the archive sets are swapped out as well as the project directory to which the archive sets are swapped to, have to be shared. Note that the release name has to be the same as the project name.

To swap out archives, for example, to tapes, proceed as follows:

  1. Add a Control Manager to your project

  2. Start it with the option archiv_client.ctl, (if it is not already running).

  3. Click on Activity in the Archive Selection panel. The History database activity panel opens.

CAUTION: When using a Windows server operating system and performing backups to a remote computer, this remote computer must be located in the same domain as the WinCC OA computer performing the backup.
CAUTION: The archive sets that are not backed up, are deleted automatically when the disc is full. To prevent this you have to set the config entry deleteNotArchivedFileSets to FALSE. When the value of the deleteNotArchivedFileSets is FALSE the archive sets are not deleted before they have been backed up. See the config entry deleteNotArchivedFileSets.

In case of newly created projects, the CTRL manager is automatically created with the option -f pvss_scripts.lst. This list contains the script archiv_client.ctlthat is required for the data backup. Multiple CTRL scripts can be started by using the option -f enables (see Control library).

compressValueArchive

To prevent the space for the actual data archiving during the compression from getting too low under Windows, only closed archive records will be compressed. Closed data records possess the appropriate compression flag in the file system (under Windows).

With this config entry in the [general] section, this compression can be activated (=1) or deactivated (=0, Default). The compression with this file system function can take longer for larger files.

[general]
  compressValueArchive = 0

Starting with WinCC OA version 2.12, the compression of completed archive records can be triggered

(see History DB - Compression of archives). The compression with the file function under Windows can still be used by setting the config entry. The Windows compression, however, is executed only after successful automatic archive record compression.

Use the History DB compression only. The Windows compression should not be used anymore.

Figure 1. The History Data Base Activity Panel

In case of redundant systems, there is also a Host 2 tab visible in this panel. The Host 1 and Host 2 tabs are identical and each event is executed for both hosts. The manual swap-out to hard disk saves both hosts. This is indicated in the status line.

Make sure that the same time is set for both hosts when working with a redundant system or when using multiple hosts (for example, remote user interface).

The probability of different archive set names to be created due to different times can be reduced by using the fileSwitchRoundOff parameter (archive parameter). The probability can, however, not be reduced to 0.

The archive records always contain the time in UTC (= GMT) format!

  • The first bar displays the source and destination path of the swap out.
  • The field on the left contains the current archive records (OK current or. completed files, AR swapped out files, still existing on the hard disk after file change, OK-C1 compressed archive record in level 1 or OK-C2 compressed archive record in level 2).
  • The swapped out archive records are entered in the right field, after clicking on DIR. During swap-out, a message ("Waiting for release of DB" and "Files are being written") is shown in the status bar.
  • During the storage to hard disk, the free disk space of the hard disk where the files are swapped out to, is displayed.
  • The arrow buttons swap the archives in and out. Swapped-in files are marked with IMP. In case of redundant systems the archives are swapped in for both systems.

If you want to swap in archives (existing on the disk) that have already been swapped in, the following message will be shown: You have selected a non-swappable data record. Do you want to continue the swap in process?

It is possible to save file sets of an identical configured project into a target project and analyze them although these file sets would not have existed in the target project.

This process executes as follows:

  1. After creating the project, it is copied to a second computer.
  2. After an arbitrary period arbitrary archive sets including the current and the AR_x file_ (<archive number>.<Date>) are copied to the second computer.
  3. The archive sets can now be analyzed on the second computer.
  4. The archive sets can be copied and analyzed anytime on the second computer. You can also delete old archive sets that you do not need any more, on the second computer.

Already archived files (AR) can be backed up only manually since they are not taken into account during automatic backup. Already swapped-in archives (swapped-in files marked with IMP) can only be deleted manually.

  • The DIR button reads the directory and filters by the archive name. Only the archive records of the current archive :"AR_0001_*" are shown.
  • The buttons Eject, Rewind are used to move the tape (only in case of DAT).
  • The Mount, Unmount buttons establish a connection to a drive or disconnect from a drive (only Linux).
  • The Format button deletes (formats) the tape (only in case of DAT backup).
When backing up to hard disk, MO or JAZ, initialization is not required!
  • The button deletes the archive record that is currently selected. Only completed archive records can be deleted.
  • The button triggers the manual compression of the selected archive record. First the selected archive record is compressed in level 1. Selecting the compressed archive record a second time and clicking on this button starts the compression in the level 2. Only completed archive records can be manually compressed. When you select the current archive record, a message "actual fileset cannot be used." will be shown.
  • The button changes the archive record of the current archive record.

The dots (above the buttons) also provide information about what is happening by changing their color (green = "everything OK", yellow = "busy" and red = "an error has occurred"). If one of these actions is executed manually, the other buttons are disabled and cannot be used ( for example, if an archive record change of the current archive record has been triggered, another archive record cannot be deleted or compressed manually since the buttons, as described above, are deactivated).

If the compression is invoked manually, the parameter for setting the number of archive records to remain in level 1 and the config entry maxNumberOfFilesToCompress are ignored. The following table shows the compression possibilities of archive records and the displayed states in the panel History database activity.

Status Comment
OK Archive record is available local and not yet archived. Such archive records can be compressed and swapped out. (current archive set, however, cannot be compressed).
OK - C1 Archive record is available local , not yet archived and in the compression level C1.
OK - C2 Archive record is available local, not yet archived and in the compression level C2. Further compression is not possible.
AR Archive record is available local and has also been swapped out.
AR - C1 Archive record is available local, has also been swapped out and is in the compression level C1.
AR - C2 Archive record is available local, has also been swapped out and is in the compression level C2. No further compression possible.
DEL File has physically been deleted.
IMP Swapped in files must not be compressed.
OFF Archive set is on a backup medium.
OFF - C1 Archive set is on a backup medium and in the compression level C1.
OFF - C2 Archive set is on a backup medium and in the compression level C2.
ERR Error status. An archive set should be available but has not been found.
ERR- C1 Error status. An archive set in the level C1 should be available but has not been found.
ERR- C2 Error status. An archive set in the level C2 should be available but has not been found.
LOC Status is "locked" because an operation is running and the archive set therefore cannot be accessed.
LOC -C1 Status is "locked" because an operation is running and the archive set in the compression level C1cannot be accessed right now.
LOC -C2 Status is "locked" because an operation is running and the archive set in the compression level C2 therefore cannot be accessed.

Only alarms can be configured in the Archive control panel when the History DB is used.

If you change the archive record when the current archive record is locked because of an Online backup, the change of the archive record will be delayed and the archive will be changed after the backup. This may cause different file names of archive records for redundant systems.

If you swap out archives when an archive record is changed, the swap-out could fail. Error messages will be shown in the log viewer.

Query archived data

When dpGetPeriod() queries are used to query archive values that are outside the queried time range (this means that the parameter "count" is > 0), values generated by the archive itself (for example, when the archive is started and changed), are also read. These values can be recognized by the set TIMEINVALID bit.

Please take note of the following points:

  1. If the very first archive record exists, you can query the values until 1.1.1970 01:00:00.000.
  2. If the archive record has been changed and the first archive record is deleted, you can query the values only until the time of the archive record change. This means that you cannot query or write values before that time (you cannot, for example, write or swap values in the past through the correction value panel).
  3. If you create a new data point after an archive record change, you can query the value of this data point from the start time of the archive record until now. The reason for this is that a newly created data point is only considered in the current archive record and not in already closed archive records.
  4. Change of the archive assignment: If a DP is, for example, assigned to a new archive (from 5 Minutes Archive to Hourly archive), you can debug a time list by using the option"-report 11"for the WCCILdata. The list shows the data points and their assignments to archives at any time. This list could look as follows:

     DP Nr. 303 El. 18 --- Name: System1:_mp_ANALOG2.analog.C1.AVG_WT0
    from 2001.08.22;00:00:30,000 to 2001.08.27;14:38:29,999 in archive 1
    from 2001.10.12;11:57:30,000 to 2001.10.12;13:42:04,000 in archive 1
    from 2001.10.12;13:42:04,000 to 2001.10.12;14:02:44,999 in archive 2
    from 2001.10.12;14:02:44,999 to 2038.01.19;04:14:07,999 in archive 1
  5. If you start a statistical function after the assignment of the archive has been changed, the function cannot write to the old archive anymore. For example, the assignment of the archive has been changed at 10:00. The statistical function starts the calculation at 10:10 and should write the value to the archive at 09:50. This is however not possible because the archiving of the DPE is not active anymore. Therefore, the system writes the value to the archive at the earliest possible time of the current archive (in our example 10:00) and marks it with the time invalid bit. The following message is shown:

    Value came, but archiving was not active at given time
      Archiving was stopped at Oct 12 2001 - 13:42:11.126, time of new value = Oct 12 2001 - 13:42:00.000
  6. Under Linux you can specify how many files an individual process can open at the same time (default value: 1024). If there are many archive files and you execute bigger historical queries and query bigger periods, the default limit (1024) could be reached. You can increase the limit (number of files per process) by using the following entry:

    Open file: /etc/security/limits.conf
    Paste following towards end:
    * hard nofile 500000
    * soft nofile 500000
    
    root hard nofile 500000
    root soft nofile 500000