Rebuild the snapshot file
- Last UpdatedOct 03, 2024
- 3 minute read
If you receive a message that indicates that Data Archive is unable to start because the snapshot file, piarcmem.dat or piarcmem_1.dat, cannot be loaded, generate a new snapshot file. A rebuilt snapshot file contains events based on the point database and, in some cases, digital states of SnapFix. The rebuilt snapshot is updated as the PI System receives new data.
Note: If the piarcmem.dat or piarcmem_1.dat file is damaged, contact the Customer Portal for assistance with this procedure.
-
Shut down PI Base Subsystem, PI Archive Subsystem, and PI Snapshot Subsystem.
-
At a command prompt, go to the PI\bin directory and type:
pibasess -snapfix [parameters]
As needed, you can enter these additional parameters:
Parameter
Description
-file [filename]
You cannot use this option with the parameter.
Provides the full file name of an input file to use in place of the default snapshot file, located in %PISERVER%\dat.
If filename refers to piarcmem_1.dat, this command processes the file as a future snapshot file; otherwise it processes the file as the historical snapshot file.
In both cases, the command implicitly processes the snapshot file for the other set (future or historical) using the piarcmem*.dat file in the default %PISERVER%\dat\ location. If you want to explicitly process two files from a single directory, consider using the parameter.
Enter a filename only if you have a file that you want your new piarcmem.dat file to be built from. To rebuild the snapshot file based on the most current values in the snapshot, do not enter a filename.
If a file exists, PI Base Subsystem renames the piarcmem.dat file that contains the current snapshot values to DD_MON_YY_piarcmem.dat. Then it builds a new piarcmem.dat file from the renamed piarcmem.dat file. If there is no piarcmem.dat file, a new file is created.
-directory directory
This option cannot be used with the parameter.
Provides the directory of input files to use instead of the default %PISERVER%\dat\ location.
To be processed, files in this directory must be named piarcmem.dat or piarcmem_*.dat.
-ds state
Specifies a system digital state that is inserted in the new file. Use an existing digital state.
-maxtime time
Sets the latest time stamp allowed in the snapshot; truncates at minutes. Indicates a time limit beyond which the prior digital state of events will be replaced with SnapFix, or the digital state you specify with the state parameter. This parameter is only applicable to the historical snapshot file.
-
If duplicate points are found, use the parameter to remove duplicate points:
pibasess -snapfix -pointtopurge
or
pibasess -snapfix -ptpurge filelist
where pointtopurge is a single point, for example . If you want to use a file that contains the names of multiple points, use filelist. For example, pointstodelete.dat.
When recovery is complete, PI Base Subsystem writes a final message to the screen and exits.
-
Restart PI Base Subsystem, PI Archive Subsystem, and PI Snapshot Subsystem.
Current snapshot values are preserved in the rebuilt piarcmem.dat file. Points that have no previous data use the SnapFix digital state, or the digital state you specify with the state parameter, until the state is replaced by new snapshot values. Any snapshot record that does not have a matching point is removed.
Note: You can run this snapshot recovery command while Data Archive is shut down.