Find and report errors in archive files
- Last UpdatedJan 13, 2023
- 2 minute read
- PI System
- PI Server
Review archive statistics to find problems in archive files. On average, points should not have more than one or two index records. If this is not the case for many points, you should review compression parameters for these points or make the archive files smaller.
Use the archive check command to detect and report any errors in the archive file. Errors are summarized at the end of the report but when running the command, they are sent to the standard error () stream. As a result, when redirecting the output to a file, the following syntax should be used so that errors are inserted into the output file :
pidiag -archk "archive_file" > report.txt 2>&1
Alternatively, the following construct can be used to redirect the output to two different files:
pidiag -archk "archive_file" 1> report.txt 2> errors.txt
The archive errors or corruptions could be the result of failures (crash, unexpected termination, power failure, and so on) or software bugs. If this occurs, use the offline archive utility to reprocess the corrupted archive file, recover the data and fix all issues..
The command can also be run with the optional argument , in order to extract detailed information about the archive file structure. This extra information is similar to what is provided by the archive walk command (see ). It notably includes point types and statistics (start time, event count, fill ratio) for every index or data record and for each point in the archive file. The archive header information is also included at the beginning of the report.
Here is an example of the detailed mode:
D:\PI\adm>pidiag -archk D:\PI\dat\piarch.001 complete
Analyzing archive: D:\PI\dat\piarch.001
--------------------------------------------------------------------------
PIarcfilehead[$Workfile: piarfile.cxx $ $Revision: 101 $]::
Version: 7 Path: D:\PI\dat\piarch.001
State: 3 Type: 0 Write Flag: 1 Shift Flag: 1
Record Size: 1024 Count: 131072 Add Rate/Hour: 1.7
Offsets: Primary: 20/65536 Overflow: 128665/131072
Annotations: 10826/65535 Annotation File Size: 434144
Start Time: 19-Oct-05 12:39:10
End Time: Current Time
Backup Time: Never
Last Modified: 19-Dec-05 18:09:15
recno: 1, id: 1, events: 636, annotations: 0, fr: 89.4% - (Float32)
index array size: 1
0: idxrec id: 1, record pointers: 5, total events: 636
record array size: 5
0: record id: 130516, start: 19-Oct-05 12:39:10, events: 142, fr: 99.4%
1: record id: 130811, start: 30-Oct-05 15:33:27, events: 142, fr: 99.7%
2: record id: 130515, start: 12-Nov-05 09:29:36, events: 142, fr: 99.9%
3: record id: 130210, start: 22-Nov-05 04:44:08, events: 142, fr: 99.9%
4: record id: 128814, start: 15-Dec-05 13:31:42, events: 68, fr: 47.9%
[...]