How to initialize the RAIMA-lastvalue-database?
The current values are stored in the lastval-folder of the RAIMA-database. When starting the project the last values are read from this part of the database and send to the event-manager. If an original value is changed the value change is send to the data-manager to store the information in the lastval-database except for those dp-elements where the last-value-storage is deactivated.
Due to powercuts or other problems with the hardware sometimes this part of the database gets corrupted, which results in problems when saving original values documented with log-message which refer to the lastval-database.
In most of the cases one of the following words is displayed at the log-message: lastval, ValHist, LastValueCache
With an initialization of this part of the database you can get rid of this error.
To initialize this part of the database please perform the following steps, in case of a redundant system you would have to stop the project on both servers at the same time. The initialization is only necessary at one server, the other one will copy the corrected database parts during the recovery:
-- Make an ASCII-export for the original-values using the filter O for the ASCII-manager into the file origvals.asc
If the ASCII manager is started from a command shell the following command is started. Before starting the command you have to go to the dplist-directory of the project. On Linux operating systems is has to be ensured that the environment variables PATH and LD_LIBRARY_PATH are set correctly and include the bin-directory for the WinCC OA installation.
<PVSS installation>/bin/PVSS00ascii -proj <project name> -filter O -out origvals.asc
<WinCC OA installation>/bin/WCCOAascii -proj <project name> -filter O -out origvals.asc
-- Stop the project
-- Copy the db-folder to create a backup, when using value-archives it is not necessary to copy the VA-folders
-- Open a command shell
-- Go to the directory <WinCC OA project>/db/pvss/lastval or <WinCC OA project>/db/wincc_oa/lastval
-- Start the command <WinCC OA installation>/bin/initdb –y ValHist
-- Start the project in minimum configuration: Data-Manager + Event-Manager
-- Make an import of the ASCII-file origvals.asc
For the import you have to start the ASCII-manager at a command shell. Before starting the command you have to go to the dplist-directory of the project.
On Linux operating systems is has to be ensured that the environment variables PATH and LD_LIBRARY_PATH are set correctly and include the bin-directory for the WinCC OA installation.
<PVSS-installation-path>/PVSS00ascii -in origvals.asc -proj <project name> -log +stderr
<WinCC OA-installation-path>/WCCOAascii -in origvals.asc -proj <project name> -log +stderr
-- Wait until the import is finished
-- Stop the project
-- Start the project in normal configuration
-- Check if the project is running correctly
When doing the ASCII-import all dp-elements which are listed in the ASCII-file will be written with the current time. The timestamp which is defined in the ASCII-file is not used during the import.
To avoid problems with statistical functions before starting the import you have to delete all lines which refer to dp-elements for a compression structure, e.g. *.C?.*, in detail C1.AVG_WT0 when using the WinCC OA standard definition for compressed values.
If you are using own dp-element names or nodenames for compressed values you have to use them to get the lines which need to be removed.
The dp-element names are saved in the second column in the ASCII-file, when using a version where the “Manager/User” information is also saved in the ASCII-file. Otherwise the dpe-names are saved in the first column.
Attention: Removing all lines where the name of the compression structure is contained in any part of the line will cause problems (deletion of necessary information on internal datapoints)!
If you have additional questions please get in contact with your common WinCC OA support.