Beruflich Dokumente
Kultur Dokumente
Reference Guide
OSIsoft, LLC
777 Davis St., Suite 250
San Leandro, CA 94577 USA
Tel: (01) 510-297-5800
Fax: (01) 510-357-8136
Web: http://www.osisoft.com
apisnap..................................................................................................................... 5
ipisql......................................................................................................................... 7
Options for the ipisql command.......................................................................................................................7
Query submission............................................................................................................................................8
piarchss.................................................................................................................... 9
Options for the offline archive utility............................................................................................................... 9
Offline archive utility processing....................................................................................................................10
Run the offline archive utility......................................................................................................................... 11
Tips for using the offline archive utility.......................................................................................................12
Specify a start time for the output file........................................................................................................12
Specify an end time for the output file....................................................................................................... 13
Specify an ID conversion file.......................................................................................................................13
Time filters ................................................................................................................................................14
Offline archive utility exit codes................................................................................................................. 14
Event queue files and offline archives............................................................................................................ 15
Move event queue files.............................................................................................................................. 15
Load event queue into an offline archive....................................................................................................16
Correcting event timestamps (-tfix -tfixend).................................................................................................. 16
Time conversion file format....................................................................................................................... 16
Time conversion file examples................................................................................................................... 17
Combine or divide archives............................................................................................................................ 17
Combine multiple archives into a single archive......................................................................................... 17
Divide an archive into smaller archives.......................................................................................................18
piarcreate................................................................................................................ 19
piartool................................................................................................................... 21
Options for the piartool command.................................................................................................................21
piartool command-line tool for PI Data Archive backups............................................................................... 28
Launch backups with the piartool utility.................................................................................................... 28
Auxiliary backup commands for the piartool utility.................................................................................... 28
Options for the piartool -backup command............................................................................................... 32
Archive management with the piartool utility................................................................................................34
Archive creation.........................................................................................................................................34
Set maximum file size or maximum number of points for a dynamic archive.............................................. 37
Annotation files......................................................................................................................................... 37
Unregister an archive.................................................................................................................................38
Register an archive.................................................................................................................................... 39
Register archives in bulk............................................................................................................................ 39
List registered archives.............................................................................................................................. 39
piconfig................................................................................................................... 53
Options for the piconfig command................................................................................................................ 53
Start the piconfig utility locally...................................................................................................................... 56
Exit piconfig...................................................................................................................................................57
PI table selection........................................................................................................................................... 57
View PI tables............................................................................................................................................ 57
Select a table............................................................................................................................................. 58
Display table attributes..............................................................................................................................58
PI Data Archive tables and primary keys........................................................................................................ 60
Attribute set table (PIATRSET).................................................................................................................. 61
Archive table (PIARC)................................................................................................................................ 62
Batch table (PIBATCH)...............................................................................................................................67
Batch alias table (PIBAALIAS)....................................................................................................................68
Batch unit table (PIBAUNIT)...................................................................................................................... 69
Collective table (PICOLLECTIVE)............................................................................................................... 69
Database security table (DBSECURITY)..................................................................................................... 70
Digital state table (PIDS)............................................................................................................................72
Digital state strings (PISTATE)................................................................................................................... 77
Firewall table (PIFIREWALL).......................................................................................................................77
Group table (PIGROUP)..............................................................................................................................77
pidiag.................................................................................................................... 111
Options for the pidiag command..................................................................................................................111
Display pidiag version number..................................................................................................................... 112
Interpret error codes.................................................................................................................................... 112
Archive management with the pidiag utility................................................................................................. 113
Dump the archive manager data file.........................................................................................................113
Create a new archive manager data file.................................................................................................... 113
Automatically recover the archive manager data file................................................................................114
Display unregistered archive information.................................................................................................114
Verify the integrity of the archive files...................................................................................................... 115
Find and report errors in archive files........................................................................................................116
Check data gaps in an archive...................................................................................................................117
Repair the archive manager data file........................................................................................................ 117
Check performance counters................................................................................................................... 118
Event queue files management....................................................................................................................118
View event queue file contents................................................................................................................ 119
View event queue file statistics................................................................................................................ 119
Licensing management............................................................................................................................... 119
Generate a signature file.......................................................................................................................... 119
Compare signatures.................................................................................................................................120
Extracting the signature from a license file...............................................................................................121
Miscellaneous commands............................................................................................................................ 121
Test for crash dump capability................................................................................................................. 121
Reset password to blank.......................................................................................................................... 122
Display network definitions..................................................................................................................... 122
Export and import certificates.................................................................................................................. 123
pigetmsg............................................................................................................... 125
pigetmsg command line options..................................................................................................................125
Continuous mode option......................................................................................................................... 129
Interactive mode option...........................................................................................................................129
Filtering pigetmsg output............................................................................................................................ 129
Search and sort messages............................................................................................................................130
Display message summary...........................................................................................................................130
Save messages to a file................................................................................................................................ 131
Read messages from a message log file....................................................................................................... 131
Display a message definition........................................................................................................................ 131
pilistupd................................................................................................................ 133
pilistupd command line options................................................................................................................... 134
pilistupd modifiers....................................................................................................................................... 134
pilistupd examples....................................................................................................................................... 134
Limit output to point updates example.................................................................................................... 134
Run pilistupd with PI ProcessBook display example..................................................................................135
Determine if client updates occur example...............................................................................................135
Producers and associated subsystems......................................................................................................... 136
pipetest................................................................................................................. 137
pisetpass............................................................................................................... 139
pisqlss................................................................................................................... 141
pisqlss command line options...................................................................................................................... 141
Start pisqlss as a Windows service............................................................................................................... 142
Start pisqlss in a command window............................................................................................................. 142
piversion................................................................................................................ 145
Terminology change
OSIsoft is revising its terminology to reflect the growth of the PI System from its original
single-server architecture. In the revised terminology, PI Data Archive refers to the component
that stores time-series data (formerly called PI Server), and PI Server refers to both PI Data
Archive and PI Asset Framework. This document uses the revised terminology.
This convention started with the release of PI Server 2010, which included PI Data Archive
3.4.385. In this document, different versions of the PI Data Archive product are referred to by
the designated name at the time of release. That means we refer to versions of the software
prior to and including PI Data Archive 3.4.380 as PI Server. When we refer to versions later
than 3.4.380, or when we are not referring to a specific version, we call it PI Data Archive.
*Specify no more than one authentication method. For information on authentication methods,
see the PI Data ArchiveSecurity Configuration Guide.
For example, to run the piartool utility to show an archive list on a remote PI Data Archive
server named MyDataServer1 using Windows authentication, type:
piartool -node MyDataServer1 -Windows -al
To perform the same command using explicit login authentication with PI user mypiuser and
password march380, type:
piartool -node MyDataServer1 -explicit -username mypiuser -password march380 -al
If you are entering any piconfig arguments at a command prompt, enter them before the -
node option. For example:
piconfig input piarc.dif -node PISRV1-port 5450 -username piadmin -
password myadminpassword
Prior to PI Server version 3.4.380, the -remote option invoked utilities remotely. Current
versions continue to support the -remote option, but OSIsoft recommends that you use the -
node option instead.
Though you can run the pigetmsg utility remotely from a client computer, you must run other
utilities remotely from a PI Data Archive machine because of licensing requirements.
The pisnap.bat script, located in the PI\adm directory, runs the apisnap utility and
connects to PI Data Archive on the same computer.
For example, to execute a query in the file myquery.txt against the PI Data Archive server
named larry with port number 5450 using a default timestep of two minutes, type: exit;
ipisql -ts 120 -f myquery.txt -node larry:5450
You can avoid the prompt for SQL parameter values by typing:
ipisql -f myquery.txt -p0 sinusoid -p1 "today"
Query submission
To send a query to PI Data Archive, type SQL statements at the prompt and terminate with a
semicolon (;). The query can span multiple lines. The prompt for subsequent lines looks like:
_PISQL>
A query in a file need not be terminated with a semicolon; the query is processed when the end
of the file is reached.
A query file may contain more than one query. If this is the case, a semi-colon must be used to
separate the queries.
Query files may contain the file command.
Procedure
1. At a command prompt, go to the PI\bin directory
2. Type the following command:
piarchss -if inputPath -of outputPath
where inputPath is the full path (including file name) of the input archive file and
outputPath is the full path (including file name) of output archive file.
Results
The offline archive utility takes the input file, processes it according to the command
parameters, and then outputs the processed file to the specified location. The offline archive
utility does not modify the input file under any circumstances.
time (where time is specified in absolute PI time format) Sets the start time to the specified time string. Times are
specified in absolute PI time format. Relative times are
not supported. Times must be enclosed in double quotes
when containing spaces. If only date is specified the time
defaults to 00:00:00 (midnight) For example:
"22-JAN-02 23:59:59"
23-JAN-02
21-Feb
Output file start and end times must differ by at least one
second.
NFE Sets the start time to time of first event which passes the
time filter.
The ID_conversion_input_file is the full path and file name for the input text file.
The ID_conversion_binary_file is the full path and name for the binary file to be created.
The offline archive utility reports any point in the input file that does not exist in the target
system.
On a foreign PI Data Archive server you can create this file as follows:
e:\pi\adm>piconfig
* (Ls - ) Piconfig> @table pipoint
* (Ls - PIPOINT) Piconfig> @ostru pointid, recno, tag
* (Ls - PIPOINT) Piconfig> @output pointidconv.txt
@ends
The piarchss -idci input file does not allow for comment characters. The comment
character (*) generated by piconfig must be removed.
Time filters
To process events that occurred during a specific time period, use a filter flag.
-filter
Specifies the period between the start time and end time, and includes both the start time
and end time. The offline archive utility discards events outside this range. The usage is:
-filter starttime endtime
Start time must be before end time.
-filter_ex
Specifies the period between the start time and end time, and includes the start time but
excludes the end time. The offline archive utility discards events outside this range. The
usage is:
-filter_ex starttime endtime
Start time must be before end time.
Code Definition
<0 An error returned from the output processing
check log messages.
Note that the -if parameter is now only used with -evq when reprocessing event queue files
that were created in versions 3.4 through 3.4.385.
PI Server 2012 event queue files require the use of the -evqpath parameter instead.
The memory-mapped queue in PI Server 2012 has been improved to optimize throughput for
reading and writing. These improvements also extend to data recovery. If either the Snapshot
or Archive Subsystems terminate uncleanly, the PI Snapshot Subsystem will rigorously inspect
the event queue files and their contents to ensure that no corrupt events are present when it is
next restarted.
Procedure
1. Stop PI Snapshot Subsystem and PI Archive Subsystem.
2. Move PI\dat\pimq*.dat to a different folder than \PI\dat for later reprocessing. If you
configured the default event queue path to a different location than \PI\dat, move the
event queue files from this location
3. Restart PI Snapshot Subsystem and PI Archive Subsystem.
The optional -tfixend parameter allows you to specify a timestamp after which no
timestamp corrections are performed. For example, the following combination of -tfix and -
tfixend specifies to perform the timestamp corrections specified in the file
conversion_file.txt and to not modify any event timestamps at or after 13:00:00 January
1, 2010:
-tfix conversion_file.txt -tfixend "1-jan-2010 13:00:00"
StartTime may be expressed as UTC - seconds since 1/1/70 or as PI local timestamp string:
UTC timestamps and strings cannot be intermingled, the first format is assumed for all entries.
Offset is a number of seconds added to the timestamp of every event within the time range.
Fractional seconds are not supported. Offset applies from timestamp up to, but not including
the next timestamp.
Apply a missed DST conversion to an archive that covers the summer of 2002:
01-Jan-02 00:00:00,0
06-Apr-02 02:00:00,3600
26-Oct-02 02:00:00,0
31-Dec-02 23:59:59,0
Apply the time adjustments for each time period as a series of UTC values and offsets:
814953600,-61200
828871200,-57600
846403200,-61200
860320800,-57600
In this example, bigfile.dat does not exist prior to the operation. The first session creates
the file and the second and third sessions add events to the file. By default, the utility creates
the file as a dynamic archive. After you create the file, you can register the archive, and PI
Snapshot Subsystem can add events to the archive file.
Any of the three input files that were registered prior to the operation are unregistered during
the operation. When the operation is complete, you can register them again. Dynamic archives,
which is the default type created by the offline utility, are not shiftable.
The end-time of the output file can be moved forward as required, but the start-time cannot be
changed after creation.
Archives with an unknown end time should be processed into a new archive to determine the
actual end time. The resulting archive can then be merged chronologically. Merging a series of
archives with overlapping dates requires processing the archive with the oldest start time first,
then process the remaining in chronological order based on the archive end times.
In this example, january.dat and february.dat do not exist prior to the operation. The
offline archive utility creates them as dynamic archives by default. After the offline archive
utility creates the files, you can register them with piartool -ar, and then add events to the
archive files in the usual way. Because these output archives are dynamic archives, they are
not shiftable.
The filter start time of january.dat is specified as 1-jan. This defaults to 1-jan, of the current
year, at 00:00:00. The filter end time is enclosed in double quotes because of the embedded
space character. The output archive start and end times are explicitly specified. Excluding the -
ost and -oet flags results in the default behavior. For more details, see Specify a start time for
the output file and Specify an end time for the output file.
If the input file was registered prior to the operation, it will be unregistered during the
operation. When the operation is complete, you can use piartool -ar to register the file
again.
The following table lists the options for the piarcreate utility.
Option Name Action
path size Archive Create a new fixed archive.
path is the name of the archive file.
size is the size of the archive in Mb.
-d path maxpoints Dynamic archive Create a new dynamic archive.
maxsize path is the name of the archive file.
maxpoints is the maximum number of points the archive can
contain.
maxsize is the maximum size of the archive file in Mb.
-v Version Get version and build information.
-acd Dynamic archive Create a PI archive that grows dynamically in size. The maximum
create archive size is 2 TB for an archive that is created with the
piartool -acd command. To create a dynamic archive that has
a maximum size less than 2 TB, you must use the piarcreate
utility instead.
-ads path Archive disable shift Remove specified archive from shift participation.
-aes path Archive enable shift Add specified archive to shift participation.
-module PI Modules lookup Look up the module path for a UID. Useful when debugging error
UID by UID messages in the PI message log that report the UID of a module,
but the not the module path.
-ooo Out-of-order snap Show tags with out-of-order events. Additional suboption and
events argument:
-r
Reset tags with out-of-order events.
n
Repeat the command every n seconds.
Note:
For PI Server 2015, you can use the -future option with
the piartool -ooo command.
-qwait Event queue wait Wait for the event queue to empty. By default waits up to 300
time seconds. Optional argument:
maxwait
Maximum time to wait, in seconds.
-remote Remote system Run utility against a remote system. When you include this
argument as the last argument in any valid command, the utility
prompts you for remote-system login information. If successful
the utility runs against the remote system.
-sd Snapshot dump Display snapshot information for every point that matches the
tagmask specified tag mask. Additional suboption:
-bufreset
Clear PI Buffering Subsystem ownership of points that match
the specified tag mask. This will let other processes, such as
clients and API Buffer Server, post new snapshot values to the
point.
-ss Snapshot statistics Monitor PI Snapshot Subsystem activity and statistics. Updates
every five seconds. Additional arguments:
sec=n
Update every n seconds.
cnt=n
Display only n updates.
Note:
Starting with PI Server 2015, the -aag option is no longer supported; the archive activity
grid is no longer available.
Procedure
1. At a command prompt, go to the PI\adm directory.
2. Type the following command:
piartool -backup path -type Type Options
where path is the full path to the backup directory. Valid entries for Type include:
INCREMENTAL
DIFFERENTIAL
FULL
Valid entries for Options include:
-wait sec
-nonvss
-arcdir
See Options for the piartool -backup command for descriptions of all the options.
If Arg1does not begin with a hyphen (-), then Arg1 is assumed to be the destination directory
for the backup, as described inLaunch backups with the piartool utility. If Arg1 begins with a
hyphen, then it is one of the auxiliary commands in the following table.
Note:
Italics indicate a value that must be supplied. Square brackets ([]) indicate that a value is
optional. Items separated by vertical bar (|) denote options that are mutually exclusive;
only one of the items can be used.
From the query command, Last Backup Start will appear as Never when the backup
subsystem is restarted. To get accurate backup history information, use the piartool -
backup -history command or use the PI SMT Backup tool (Operation > Backups). The
pibatch subsystem does not appear in your list of subsystems that are registered for backup
if you are not licensed to use the old batch subsystem.
If the PI System is started normally, then subsystems should register for backup within about
30 seconds of the PI Backup Subsystem startup time. Normal startup is, for example, starting
the PI System with the pisrvstart.bat command file or letting the PI System services
automatically start after a reboot. However, if PI Backup Subsystem is shut down and restarted
by itself, it may take up to five minutes for the individual subsystems to register for backup.
If a subsystem is stopped normally (for example, without crashing), then the subsystem will
unregister for backup.
-archive n0 n1 Back up the archive or archives specified by n0, n1, n2, and so on. The annotation
n2 ... file associated with the specified archive is also backed up.
Archive numbers begin at 0 with the primary archive. For example, the following
command backs up the primary archive and archive 2:
piartool -backup c:\pi\backup -archive 0 2
-component c0 Back up the component or components specified by c0, c1, c2, and so on. For
c1 c2 ... example:
piartool -backup c:\pi\backup -component pibasess
backs up only the files that belong to PI Base Subsystem.
The -archive and -component flags can be used in conjunction with each other.
For example, the following command backs up the pibasess, pisnapss, and piarchss
components in addition to the primary archive:
piartool -backup c:\pi\backup -component pibasess pisnapss
piarchss -archive 0
To see a full list of components, type:
piartool -backup -identify -verbose
Option Description
-cutoff date Cutoff date in PI time format.
For example, -cutoff *-10d restricts the backup to archives that contain data
between 10 days prior to current time and current time. The more restrictive of -
numarch N and -cutoff date takes precedence. The default cutoff date is 1-
Jan-1970 00:00:00, unless otherwise specified by the
Backup_ArchiveCutoffDate timeout parameter.
This flag is ignored if the -component or -archive flag is specified.
If -cutoff date is specified for an incremental or differential backup (-type
INCREMENTAL or -type DIFFERENTIAL), then all modified archives and all
archives matching the cutoff date criteria are included in the backup. The -cutoff
flag has no effect on a full backup.
-exclude c0 c1 Exclude the component or components specified by c0, c1, c2, and so on.
c2 ...
The -exclude flag is ignored for incremental, differential, or full backups.
-nonvss Perform a non-VSS backup on Windows Server 2003 or greater. This option has no
effect on Windows XP or Windows 2000 because non-VSS backups are always
performed on these platforms when a backup is started from the piartool -
backup command.
-numarch N Back up N archives.
For example, specifying -numarch 2 backs up the primary archive and archive 1,
provided that archive 1 contains data. Empty archives are never backed up. The
default number of archives for backup is 3, unless otherwise specified by the
Backup_NumArchives timeout parameter.
Specifying -numarch -1 includes all archives that contain data (and that are not
excluded with the -exclude flag) in the backup. Specifying numarch 0 excludes
all archives from the backup.
This flag is ignored if the -component or -archive flag is specified.
If -numarch N is specified for an incremental or differential backup (-type
INCREMENTAL or -type DIFFERENTIAL), the first N archives plus any other
archive that has been modified are included in the backup. The -numarch flag has
no effect on a full backup.
-type type Perform the specified type of backup: INCREMENTAL, DIFFERENTIAL, FULL, or
COPY.
For incremental and differential backups, only those archive components that
have been modified since their last backup time will be included.
For full backups, all archive components will be included, regardless of their
last modified and last backup time. The last backup time of archives are not
updated for differential or copy backups.
A full backup (-type FULL) is not appropriate for making copies of your PI
Data Archive because the last backup time of the archive files will be updated.
If the last backup time of archive files are updated outside of your nightly
backups and if you are doing incremental backups, then some archive files that
should be backed up might be missed. A full backup is appropriate for creating
a baseline for your nightly backups.
For copy backups to be performed, which prevents the last backup times of
your archives from getting updated. If the -exclude argument is specified,
then -type COPY is implied.
Option Description
-wait sec Wait up to sec seconds for the backup to complete before returning from the
piartool -backup command. The progress of the backup is reported every 15
seconds. When the backup is complete, a summary of the backup is reported.
The sec argument is optional. If you use the -wait flag without specifying the sec
argument, then the piartool -backup command waits up to one day for the
backup to complete.
If the -wait flag is not specified, then the piartool -backup command returns
immediately. In this case, the progress of the backup can be monitored with the
piartool -backup -query command.
The -wait option is used in the pibackup.bat script because it is important for
the backup to complete before the site-specific backup scripts are called.
Archive creation
You can use either the piarcreate or the piartool utility to name, locate, create, and
initialize a new archive. You can create either a fix-sized archive or a dynamic archive, which
can grow up to a particular size.
Every archive has a parallel annotation file that has the extension .ann. Either utility creates
this file automatically. This file must remain in the same directory that contains its archive file
at all times.
piarcreate utility
The piarcreateutility creates an archive without registering it. You can specify the size of the
archive with the piarcreate utility, but you must complete a second step to register the
archive. Use the -d flag to create a dynamic archive. With the piarcreate utility, you can
specify the maximum number of points and maximum size of a dynamic archive. See Set
maximum file size or maximum number of points for a dynamic archive for details.
Note:
The piarcreate utility has minimal impacts on system resources. Therefore, use of this
utility is considered the most efficient way to create archives. However, you cannot
specify start and end times using the piarcreate utility.
piartool utility
You may use the piartool utility to optionally specify the following for new archives:
Start and end times for both fixed and dynamic archives
Maximum size for dynamic archives and the fixed size for fixed archives
Use option -ac to create a fixed-size archive and option-acd to create a dynamic archive. With
both the piartool -acand piartool -acd commands, the default created archive size
matches the current primary archive size, and registration is automatic.
Would you like to initialize the start and end times (y/n)? y
Times must be entered in standard PI Time Format, for example: 04-Jun-89 10:00:00
Enter the archive start time: 31-Dec-06 00:00:00
You have entered the start time: 31-Dec-06 00:00:00 Is this correct (y/n)? y
Enter the archive end time ('*' for primary): 17-Jun-07 02:00:00
You have entered the end time: 17-Jun-07 02:00:00 Is this correct (y/n)? y
You have requested to create an archive with the attributes:
File Path: C:\PI\dat\piarch.224
Start Time: 31-Dec-06 00:00:00
End Time: 17-Jun-07 02:00:00
Is this correct (y/n)? y
Successfully scheduled the archive creation. Archive path: D:\PI\dat\piarch.113.
Check the message log for completion status.
Procedure
1. Stop the PI Data Archive server.
2. Create a new archive with the piarcreate command.
3. Register the new archive with the pidiag -ar command.
4. Start the PI Data Archive server.
5. Create a new primary archive with the piartool -ac command.
Set maximum file size or maximum number of points for a dynamic archive
You can set a limit on the file size (maxsize) or the number of points (maxpoints) of a dynamic
archive. To do this, you must use either the piarcreate or piartool commands (you cannot
do this using the PI SMT Archive Editor tool).
Use piartool to create and register a dynamic archive file and set the maxpoints and
maxsize values using the following syntax:
piartool acd <path> <maxpoints> <maxsize>
Use piarcreate to create a new archive file and set the maxpoints and maxsize values
using the following syntax:
piarcreate d <path> <maxpoints> <maxsize>
For example:
C:\PI\adm>piarcreate -d D:\PI\dat\piarch.115 2000 20000
Attempting to create a 2000 record, dynamic archive: D:\PI\dat\piarch.115 with
a maximum size of 20000 Mbytes.
Initializing archive file: D:\PI\dat\piarch.115
Archive D:\PI\dat\piarch.115 is prepared to be registered
Use piarcreate to change the maxpoints parameter:
G:\pi\adm>piarcreate -?
Usage: piarcreate -v
piarcreate -d path maxpoints maxsize(Mb)
piarcreate path size(Mb)
The following listing is for a 2048 MB archive; the maximum number of configurable points
for the archive is 1,048,576 (half the total number of records).
D:\PI\adm>piartool -al
Archive shift prediction:
Shift Time: 5-Oct-05 19:42:01
Target Archive: e:\pi\arc\piarch-2GB.1
Archive[0]: e:\pi\arc\piarch-2GB.3 (Used: 53.4%)
PIarcfilehead[$Workfile: piarfile.cxx $ $Revision: 101 $]::
Version: 7 Path: e:\pi\arc\piarch-2GB.3
State: 4 Type: 0 Write Flag: 1 Shift Flag: 1
Record Size: 1024 Count: 2097152 Add Rate/Hour: 154207.3
Offsets: Primary: 253063/1048576 Overflow: 1231270/2097152
Annotations: 1/65535 Annotation File Size: 2064
Start Time: 5-Oct-05 06:11:09
End Time: Current Time
Backup Time: Never
Last Modified: 5-Oct-05 13:26:21
Annotation files
You can annotate very value in the snapshot or the archive. An annotation can be of any data
type. An annotation file stores annotations. Each archive file has a single associated annotation
file, with an .ann extension. You can use the piconfig utility to add and edit text annotations.
Note:
Any operation on annotation translates into an actual I/O, bypassing archive caching.
Thus it is much less efficient than non-annotated events. Be aware of this when using
annotations.
The archive-listing command, piartool -al, shows annotation file statistics. The following is
output from an archive listing:
Archive[0]: c:\pi\dat\testarc.dat (256MB, Used: 0.0%)
PIarcfilehead[$Workfile: piarfile.cxx $ $Revision: 142 $]::
Version: 8 Path: c:\pi\dat\testarc.dat
State: 4 Type: 0 (fixed) Write Flag: 1 Shift Flag: 1
Record Size: 1024 Count: 262144 Add Rate/Hour: 2.4
Offsets: Primary: 17/131072 Overflow: 262055/262144
Annotations: 5541/65535 Annotation File Size: 1491116
Start Time: 27-Jul-10 17:29:30
End Time: Current Time
Backup Time: 29-Jul-10 03:15:24
Last Modified: 29-Jul-10 13:28:56
Unregister an archive
You can unregister any archive except the primary archive (archive number 0), which stores
the current data.
Procedure
1. At a command prompt, go to the PI\adm directory.
2. Type the following command:
piartool -au path
where path specifies a complete, not relative, path name.
For example, the following command unregisters the archive called piarch.006 in the PI
\dat directory on the D drive:
piartool -au D:\PI\dat\piarch.006
Tip:
You can use the wildcard characters * and ? to unregister archives in bulk. The symbol
* matches all possibilities with any number of characters. The symbol ? matches a
single character and may be used any number of times. For example, the following
command unregisters all archive files that begin with the piarch.0 prefix and are
located in the PI\dat directory:
piartool -au D:\PI\dat\piarch.0*
Register an archive
Procedure
1. At a command prompt, go to the PI\adm directory.
2. Type the following command:
piartool -ar path
where path is the path to the archive file. Unlike the piartool -au command, the specified
path can be a relative path to an existing archive file.
For example, the following command registers the archive called piarch.006 in the PI
\dat directory on the D drive:
piartool -ar D:\PI\dat\piarch.006
Procedure
1. At a command prompt, go to the PI\adm directory.
2. Type the following command:
piartool -ar path
where path is the path to the archive file. The specified path can be a relative path.
For example, entered in the PI\adm directory, the following command registers all archive
files in the PI\dat directory that begin with the piarch.0 prefix:
piartool -ar ..\dat\piarch.0*
Caution:
Try not to match non-archive files. If the contents of a matched file correspond to a
valid archive header, you can unintentionally register a file as an archive file.
Procedure
1. At a command prompt, go to the PI\adm directory.
2. Type the following command:
piartool -al
See also
Exclude archives from shift participation
View an archive's shift-participation status
See also
Procedure
1. At a command prompt, go to the PI\adm directory.
2. Type the following command:
piartool -al
Output from the command lists archives in reverse chronological order (archives with
newer data before archives with older data). Archives with Write Flag set to 1 are
potential targets for archive shifts.
See also
Procedure
1. At a command prompt, go to the PI\adm directory.
2. Type the following command:
piartool -al
Output from the command lists archives in reverse chronological order (archives with
newer data before archives with older data). Next to the Used label for each archive file, the
output shows the percentage of that archive that is used. For fixed sized archives, this is the
percentage of the total available records in use and is an indication of how much space is
available in the archive for data. For dynamic archives this is the percentage of primary
records in use and is an indication of how close one is to the maximum number of points
that can be created for that archive.
Procedure
1. At a command prompt, go to the PI\adm directory.
2. Type the following command:
piartool -as
Command output lists PI Archive Subsystem internal counters every five seconds.
$ piartool -as
Counters for 7-Aug-03 14:51:10
Archived Events: 1050621 1485
Out of Order Events: 0 0
Events Cascade Count: 0 0
Events Read: 5 0
Read Operations: 0 0
Cache Record Count: 0 0
Cache Records Created: 6 0
Cache Record Memory Reads: 5 0
Cache Clean Count: 0 0
Archive Record Disk Reads: 146342 219
Archive Record Disk Writes: 152737 226
Unflushed Events: 12431 -203
Unflushed Points: 3131 -48
Point Flush Count: 133491 211
Procedure
1. At a command prompt, go to the PI\adm directory
2. Type the following command:
piartool -fs
For systems with large point counts, archive shifts might require a several minutes. Do not
shut down the PI Data Archive server until the shift has completed. To determine when this
has occurred, check the message log for message 2063 in the above output.
Archiving flag
The Archiving Flag indicates whether events may be written to the archive; a value 1
indicates events may be written, a value of 0, events may not be written. The Archiving Flag
is set to 1 when there is a mounted primary archive. A primary archive may be registered but
not mounted, for example during an archive shift. In this case, the Archiving Flag would be
set to 0. This flag is also set to 0 when in backup mode.
All registered archives may be viewed using piartool -al. The Archiving Flag is set to 0
if the primary archive becomes full and there is no other archive file available into which to
shift. Note that the primary archive will never overwrite itself.
Procedure
1. At a command prompt, go to the PI\adm directory.
2. Type the following command:
piartool -qs
This lists the event-queue statistics every 5 seconds.
3. Review the output.
4. Press CTRL+C to stop output from the piartool -qs command.
Queue size
The Physical File Size shows the current size of the event queue on disk; that is, the file
pimapevq.dat or any overflow queues.
The Page Size is the portion of the file that is loaded into memory for faster access.
The event queue is a circular buffer of pages and each page is a circular buffer of events. That
is, when a page is full, PI Snapshot Subsystem tries to write into the next page and PI Archive
Subsystem reads the pages in the same order they were written.
The Total Data Pages shows the number of pages, obtained by dividing the event queue
size by the page size (minus one for the queue header).
Page activity
The Write Page Index shows the page PI Snapshot Subsystem is currently writing to.
Similarly, the Read Page Index indicates the page from which PI Archive Subsystem is
reading. Under normal conditions, these two numbers are identical. If PI Archive Subsystem is
not reading at the same pace that PI Snapshot Subsystem is writing, page shifts will occur and
the Total Page Shifts counter will increment. At any time, the Available Pages counter
shows how many free pages are left in the current queue.
Queue capacity
PI Snapshot Subsystem maintains the number of Average Events per Page based on the
average size of all events. The subsystem uses this average to derive an Estimated
Remaining Capacity in number of events. This capacity is also shown by piartool -ss.
Total Bytes Written shows the volume of data that transmitted through the event queue
since PI Snapshot Subsystem was last started.
Configure your queue to hold data from several days.
Event rates
Every time PI Snapshot Subsystem sends an event to the archive, the Total Event Writes
counter gets incremented. Similarly, when PI Archive Subsystem reads events, the Total
Event Reads is incremented. The difference between these counts equals the total events per
queue and is shown by the Current Queue Events.
Overflow queues
When the current queue is entirely full, PI Snapshot Subsystem creates additional queue files
of the same size. The Overflow Queues and Total Overflow Events counters indicate
how many queues exist and how many events they hold. These counts are the same indicated
by piartool -ss.
The Current Queue Id shows the sequence number of the primary queue. This is 0 under
normal conditions.
Procedure
1. At a command prompt, go to the PI\adm directory.
2. Type the command appropriate for what you want to list:
To list: Type:
All buffered sources and their registration IDs piartool -bfs
Detailed information for a buffered source with a piartool -bfs ID
specific registration ID
PI points from a buffered source with a specific piartool -bfs ID -ptlist
registration ID
For information about using the -reset option to release ownership of points owned by a
specific buffered source, see Release ownership of a buffered source's points.
Procedure
1. At a command prompt, go to the PI\adm directory.
2. Type: piartool -bfs ID -reset
When the command completes, you will see the query status indicating whether the
command succeeded.
Note:
After this command is run, when data is written to the points again, PI Data Archive
will resend the configuration for all points to the PI Buffer Subsystem. Therefore, if the
buffered source writes to a number of points, you may see a subsequent effect on the
throughput after the command is run.
Activity grid
PI Archive Subsystem provides a tool to monitor read-access to the archive. This tool creates,
over a finite time period, a grid of activity. The grid provides an account of connections and
point activity.
Start the activity grid to temporarily identify the connections that present the greatest load on
the system and the points that are being queried most often.
This monitoring requires significant computing resources and therefore is normally turned off.
Once the load on the system is identified, OSIsoft recommends that you turn off the activity
grid.
The syntax for the activity grid is:
piartool -aag <start|stop|pause|point|cnxn> <event|access> -min n -max n
Note:
Earlier versions of PI Data Archive collected the aag statistics by PI user instead of by
connection (cnxn). The cnxn option replaces the option user, which is no longer
supported.
Set up the activity grid to view activity per point or per connection. You can query by
Event How many events were read for this point or connection.
Access How many read calls were made to this point or by this connection. For example,
one trend display call is counted as one access but can retrieve 100s of events.
To start the activity grid:
piartool -aag start
To temporarily stop the accounting yet allow querying of the current statistics:
piartool -aag pause
Each query requests the number of events retrieved or the number of retrieval calls made
(<event|access>). These can be arranged by points or by connection ID (<point|cnxn>):
piartool -aag <point|cnxn> <event|access>
The following gets the number of events retrieved by point, from the time the activity grid was
started:
piartool -aag point event
40 368-piba1
13544 388-BAE9CF24-C8B3-46c0-AD5D-A64DF2174ED9
In this mode, the ID-Name column corresponds to the point ID and tag name.
The following gets the number of retrieval calls, by connection ID:
piartool -aag cnxn access
In this mode, the ID-Name column corresponds to the ID, Name, and PeerAddress as displayed
in the PI SMT Network Manager Statistics tool (Operation > Network Manager). For local
connections, the PeerAddress is ::1 or 127.0.0.1 or blank.
The following gets the number of events for each connection:
piartool -aag cnxn event
Use min/max to limit the display to only the cases of interest (abusers). For example, to display
only the connections that made more than 1,000 access calls, use the following:
piartool -aag cnxn access -min 1000
To display only the points that had more than 10,000 events read from since the activity grid
was turned on, use the following:
piartool -aag cnxn event -min 10000
Procedure
1. At a command prompt, go to the PI\adm directory.
2. Type the following command:
piartool -sd tagmask
where tagmask is the PI point tag name.
For example, to retrieve snapshot information for sinusoid, you would type:
piartool -sd sinusoid
Note:
You can also use the apisnap utility to check snapshot values.
Note:
If the CheckUtilityLogin tuning parameter is set to 1 (on), then you cannot run the
piconfig utility with Windows authentication. When the CheckUtilityLogin tuning
parameter is on, the piconfig utility will always prompt you for a PI Data Archive user
name and password. If explicit logins are disabled on the PI Data Archive server, then the
piconfig utility displays an error message stating that the authentication method is
disabled by current server policy.
Procedure
1. At a command prompt, go to the PI\adm directory.
2. Depending upon your authentication, type the appropriate command to launch the
piconfig utility:
To authenticate with a user name and password on the local PI Data Archive server, type:
piconfig
The utility prompts you to enter a valid user name and password to gain access to the
database tables.
To authenticate using Windows authentication, type:
piconfig -windows
The utility prompts you to enter the node. Enter the host name of your PI Data Archive.
The piconfig utility then attempts to start using your current Windows user name and
password.
Exit piconfig
Procedure
To end a piconfig session, type exit or Quit or Bye. It is not necessary to use the exit
command when running the piconfig utility in batch mode.
PI table selection
To perform a task with the piconfig utility, you must first select the PI Data Archive table on
which to operate. For example, to change a PI point you would select the PIPOINT table.
View PI tables
See PI Data Archive tables and primary keys for information about each PI Data Archive table.
Procedure
1. Start the piconfig utility.
2. At the piconfig prompt, type: @?tbl.
Select a table
Procedure
1. Start the piconfig utility.
2. At the piconfig prompt, type @table tablename.
Records
The piconfig utility regards a table as a collection of records. A record is a collection of fields
or attributes. One of these attributes is the primary key, which uniquely identifies the record
within the current table. This data representation is done for convenience and standardization.
It is not always an accurate image of the actual data.
Consider the following entries in the snapshot table:
Tag Value Time
CDM158 Auto 14-Jun-03 10:39:34
SINUSOID 68.973 14-Jun-03 10:00:00
SINUSOIDU 11.184 14-Jun-03 11:04:00
In this example, there is a record for each snapshot, and each record contains three attributes.
The attributes in this example are tag, value, and time.
Primary key
Every record contains one attribute that is defined as the primary key, which uniquely
identifies the record. The primary key is the first attribute listed when using the ?atr
command.
When using the select command to specify a record, the primary key must always be used. If
it is not specified piconfig assumes * (all records). Other attributes may be selected in
conjunction.
For example, the primary key for the PIPOINT table is TAG. When selecting the subset of tags
with point source F, the primary key needs to be included as follows:
@select tag=*, pointsource=F
Some tables do not support renaming of records, for example PIARC and PISNAP tables. Tag is
the primary key of these tables. Because Tag is actually a point attribute, you must rename
from the PIPOINT table. Other tables have similar relationships.
An attribute set has many of the Attrib, Default, Type triplet. The ellipsis () following
TYPE indicates those three may be repeated.
The following piconfig session demonstrates how to list the attribute sets on the PI Data
Archive server:
* (Ls - PIATRSET) PIconfig> @table piatrset
* (Ls - PIATRSET) PIconfig> @ostr set
* (Ls - PIATRSET) PIconfig> @ends
*PIConfig Err> Wild-card specs. missing, default to '*'.
alarmparam
base
classic
sqcalm_parameters
totals
* (Ls - PIATRSET) PIconfig>
To list the entire classic and then base attribute sets use the ellipsis to repeat the output.
Users familiar with classic PI Points will recognize all these attributes. These two attribute
sets, Classic and Base, make up the classic point class.
These attributes are the same as the PISNAP table attributes. In addition there are some
auxiliary attributes that affect retrieval and editing:
Attribute Description
Count Maximum number of events to retrieve in list
mode
Mode Archive editing mode
Starttime Start time for events retrieval
Endtime End time for events retrieval
Starttime and Endtime can define both a forward and a backward search.
Events can be added to the snapshot using the PIARC table. Events are placed in the snapshot if
they are more recent than the current snapshot event; otherwise, they bypass compression
and go straight to the archive according to the archiving mode specified. When a new snapshot
event is stored, the previous snapshot event is sent to the archive, compressed according to the
compression specifications.
Attribute Description
COMP Compressed events
EVEN Interpolated events. The number of evenly spaced
events returned between starttime and endtime is
given by the Count parameter.
For example, to view four hours of data for the tag sinusoid, with a maximum of 100 values,
type:
@input piarc.dif
sinusoid, *-4h, *, 100
@endsection
You can also use the PIARC table to view interpolated data by specifying the even mode. In this
example, five evenly spaced values will be retrieved:
* (Ls - PIARC) piconfig> @table piarc
* (Ls - PIARC) piconfig> @istru tag, starttime, endtime, count, mode
* (Ls - PIARC) piconfig> @ostr value,status,time
* (Ls - PIARC) piconfig> @ostr ...
* (Ls - PIARC) piconfig> sinusoid,*,*-4h,5,even
*> sinusoid,*,*-4h,5,even
71.32876,GOOD,20-Nov-02 17:52:51
77.07982,GOOD,20-Nov-02 16:52:51
Digital State,Shutdown,20-Nov-02 15:52:51
Digital State,Shutdown,20-Nov-02 14:52:51
Digital State,Shutdown,20-Nov-02 13:52:51
* End Repeat...
Note:
Do not confuse the PIARC table MODE attribute with the piconfig mode command. To
delete archive events, use the PIARC table MODE attribute =remove in piconfig edit
mode.
When adding a new archive event with the edit modes above, you must use:
@mode edit,t
or
@mode create,t
Thepiconfig selection and modification may be used. For example one might create an input
file (input.txt) with the following command lines:
@istructure tag, starttime, endtime, count
@ostructure tag, value, status, time
@ostructure ...
@output labevents.txt
labtag,t,y,100
then redirect this input file into piconfig in order to list some events to an output file called
labevents.txt:
* (Ls - PIARC) piconfig < input.txt
Now one can change or delete all these events. For example:
@mode edit
@istructure tag, value, status, time
@modify value*= 1.1, mode=replace
@input labevents.txt
Do not include any spaces between parameters, so that the input file and its parameters are
taken as one parameter.
Change events when there are multiple events at the same time
The following commands show how to modify a specific value out of several at the same time
using replacesp mode. Note the use of NewValue attribute.
The replace mode would cause the last value at the time to be replaced.
* (Ed - PIARC) PIconfig> @input piarc.dif
* (Ls - PIARC) PIconfig> rpflt1,*,y,100
*> rpflt1,*,y,100
123.,GOOD,24-Jun-03 17:43:01
1123.,GOOD,24-Jun-03 01:00:00
112.,GOOD,24-Jun-03 01:00:00
11.,GOOD,24-Jun-03 01:00:00
1.,GOOD,24-Jun-03 01:00:00
* End Repeat...
* (Ls - PIARC) PIconfig> @mode edit,t
* (Ed - PIARC) PIconfig> @istru tag,value,newvalue,time,mode
* (Ed - PIARC) PIconfig> rpflt1,11,0.11,t+1h,replacesp
*> rpflt1,11,0.11,t+1h, replacesp
* (Ed - PIARC) PIconfig> @input piarc.dif
* (Ls - PIARC) PIconfig> rpflt1,*,y,100
*> rpflt1,*,y,100
123.,GOOD,24-Jun-03 17:43:01
1123.,GOOD,24-Jun-03 01:00:00
112.,GOOD,24-Jun-03 01:00:00
0.11,GOOD,24-Jun-03 01:00:00
1.,GOOD,24-Jun-03 01:00:00
* End Repeat...
The time zone information displayed with every snapshot and archive timestamp is the short
label of time zone and current standard/daylight status. For example, in Pacific Standard Time,
this label would be PST. You can check the labels for your time zone with the pidiag -tz
command.
If you issue the TimeFormat command with the number of subsecond digits only, time zone
information display is turned off.
Subsecond timestamps
You can put events with subsecond timestamps in the snapshot and data archive using
piconfig. The Time attribute has the format
DD-MMM-YY hh:mm:ss.sssss
The Timenum attribute is the equivalent floating point representation of the time in number of
seconds past January 1, 1970 00:00:00.0000. The archive preserves the timestamp with
accuracy of 15.25 microseconds.
The default time accuracy of five digits might compromise a subsecond timestamp. Use the
sigd command to change the display to show six or seven digits before editing or deleting
such events.
Annotations
Since PI Server 3.3, piconfig supports annotation to archive values, in both PISnap and PIARC
tables. We recommend using piconfig only for reading annotations. Annotations should be
added using PI SDK applications that are designed for that purpose.
The PI Module and PI Batch database approach replaces the PI Batch Subsystem, the earlier
solution for batch data. Refer to the PI SDK Help files for details about the Module and Batch
databases.
For example:
\\Reactor1\temperature
The unit name must be a defined PI Batch unit, that is, an entry for it must exist in the
PIBAUNIT table. The PI tag name must also be valid.
See the PI Data Archive Applications User Guide for details on how to manage data in this table.
The table name is PIBAALIAS. The primary key is Alias.
PIBAALIAS Attributes Description
Alias Unit name and attribute. The syntax for alias
names in this table is: \\unitname\attribute.
Tag PI tag corresponding to the attribute.
NEWAlias Used to rename an existing alias.
Normally, the table contains one row for the PI Data Archive collective that the server belongs
to. The Name attribute links entries in the PISERVER table to entries in the PICOLLECTIVE
table. PI Data Archive presents the CollectiveID as its server identifier to client applications
through PI SDK. This allows client applications to connect to any server in a collective without
changing displays.
The primary key is NAME.
PICOLLECTIVE Type Editable Example Description
Attribute
Name String Primary "uc-s1" Name of the
collective to which
the server belongs.
Must match
collective name
defined in
PISERVER table.
CollectiveID String Primary "08675309-0007-0 UID that uniquely
007-0007-000000 represents the PI
001001" Data Archive
collective.
Description String Primary "UC 2006 Demo Optional
Collective" description of the
collective.
LastCollectiveConfi TimeStamp No 12-Apr-06 Time stamp of last
gChangeTime 14:00:17 change to
collective
configuration.
Status Int32 No 0 Overall status of
the collective (0 =
good). Use the
pidiag -e
command to look
up the status as an
error code. If the
status is not good,
at least one
member of the
collective has a bad
CommStatus or
SyncStatus in the
PISERVER table.
NewName String Used to rename an
existing PI Data
Archive collective.
For a detailed discussion of database security, see the PI Data ArchiveSecurity Configuration
Guide.
Database security is accessed through the DBSECURITY table. This is a general database
security table; its structure applies to all databases. The record structure looks like this:
DBSECURITY Attribute Description
DBName Database name
Description Description of the functional areas and database
tables controlled by this entry.
Access Security attribute, which specifies access to the
table
Group Group name
Owner PI user name declared to be the owner of the table.
Defaults to Piadmin.
Security Access control list which specifies access to the
table
status For internal use
The following examples show how to access and modify the DBSECURITY table.
C:\pi\adm>PIconfig table dbsecurity
* (Ls - DBSECURITY) PIconfig> @ostru dbname, owner,group,access
* (Ls - DBSECURITY) PIconfig> @ends
*PIconfig Err> Wild-card specs. missing, default to '*'.
PIARCADMIN,piadmin,piadmins,o:rw g:r w:r
PIARCDATA,piadmin,piadmins,o:rw g:r w:r
PIBatch,piadmin,piadmins,o:rw g:r w:r
PICampaign,piadmin,piadmins,o:rw g:r w:r
PIDBSEC,piadmin,piadmins,o:rw g:r w:r
PIDS,piadmin,piadmins,o:rw g:r w:r
PIHeadingSets,piadmin,piadmins,o:rw g:r w:r
PIModules,piadmin,piadmins,o:rw g:r w:r
PIPOINT,piadmin,piadmins,o:rw g:r w:r
pisnapss,piadmin,piadmins,o:rw g:r w:r
PITransferRecords,piadmin,piadmins,o:rw g:r w:r
PIUSER,piadmin,piadmins,o:rw g:r w:r
Modify the access to archive data and allow the piusers identity:
* (Ls - DBSECURITY) PIconfig> @mode edit,t
* (Ed - DBSECURITY) PIconfig> @istru dbname,owner,group,access
* (Ed - DBSECURITY) PIconfig> PIARCDATA,piadmin,piusers,o:rw g:rw w:
*> PIARCDATA,piadmin,piusers,o:rw g:rw w:
Modify the access to the PI Update Manager thread table (there is no auditing in PI Update
Manager):
* (Ed - DBSECURITY) PIconfig> piupdmgr,piadmin,piusers,o:rw g:rw w:r
*> piupdmgr,piadmin,piusers,o:rw g:rw w:r
* (Ed - DBSECURITY) PIconfig> @mode list
* (Ls - DBSECURITY) PIconfig> @ends
*PIconfig Err> Wild-card specs. missing, default to '*'.
PIARCADMIN,piadmin,piadmins,o:rw g:r w:r
PIARCDATA,piadmin,piusers,o:rw g:rw w:
pibasess,piadmin,piusers,o:rw g:rw w:r
PIBatch,piadmin,piadmins,o:rw g:r w:r
$ piconfig
(Ls - ) piconfig> @table pids
(Ls - PIDS) piconfig> @?atr
1 - SET (D) Setxxx
2 - SETNO (D) 0
3 - STATE (D) Statexxx
4 - OLDCODE (D) 0
5 - NEWSET (D)
(Ls - PIDS) piconfig> @ostructure set
(Ls - PIDS) piconfig> @select set=*
(Ls - PIDS) piconfig> @endsection
SYSTEM
BATCHACT
PHASES
MODES
Procedure
1. Select the digital state table.
(Ls - PIDS) piconfig> @table pids
2. Prepare to write to the table.
(Ls - PIDS) piconfig> @mode create
3. Specify an input data format of a digital state set name followed by any number of states in
the set. Follow this with a data line.
(Cr - PIDS) piconfig> @istructure set, state, ...
(Cr - PIDS) piconfig> ValveStateSet, Open, Closed
4. List the new state set in order to verify that it was properly created. Select only those sets
that start with V. Use an endsection command to force processing:
(Cr - PIDS) piconfig> @mode list
(Ls - PIDS) piconfig> @ostructure set, state, ...
(Ls - PIDS) piconfig> @select set=V*
(Ls - PIDS) piconfig> @endsection
VALVESTATESET,Open,Closed
(Ls - PIDS) piconfig>
Note:
The endsection command is not needed when creating the state set because data
lines are processed as they are entered.
Procedure
1. Select the digital state table:
(Ls - PIDS) piconfig> @table pids
2. Prepare to write to the table:
(Ls - PIDS) piconfig> @mode create
3. Specify an input data format that consists of a digital state set name followed by any
number of states in the set:
(Cr - PIDS) piconfig> @istructure set
(Cr - PIDS) piconfig> @istructure state
(Cr - PIDS) piconfig> @istructure ...
The input lines are the set name followed by any number of states. For example:
(Cr - PIDS) piconfig> ValveStateSet
ValveStateSet
(Cr - PIDS) piconfig> Open
Open
Cr - PIDS) piconfig> Closed
Closed
Subsequent lines are treated as input until the next piconfig command is issued.
Procedure
1. Select the digital state table:
(Ls - PIDS) piconfig> @table pids
2. Prepare to write to the table:
(Ls - PIDS) piconfig> @mode edit
3. Specify an input data format that consists of a digital state set name followed by any
number of states in the set:
(Ed - PIDS) piconfig> @istructure set, state, ...
4. Input data (with no commands):
(Ed - PIDS) piconfig> ValveStateSet, Open, Closed, Stuck
5. List the new state set in order to verify that it was properly created:
(Ed - PIDS) piconfig> @mode list
(Ls - PIDS) piconfig> @ostructure set, state, ...
6. Select only those sets that start with V:
(Ls - PIDS) piconfig> @select set=V*
7. Start processing:
Modify the System state set (Special considerations for blank states
The system digital state set is always set number 0. It cannot be deleted. Renaming it is
allowed, but not recommended. As with any other set, it must be edited in its entirety.
The system digital state set usually includes some blank states. To preserve these, make sure
that blank state are enclosed in quotes, or use the oldcode attribute. The oldcode attribute
can help maintain reference to state offsets within a set during editing. It has no other use.
@istru set
@istru oldcode,state
@istru ...
system
0,??????????
1,
2,?2
3,
4,?4
@istru set
@istru state
@istru ...
system
??????????
""
?2
""
?4
Both examples show only the first five states in the system set, and in both cases states 1 and 3
are blank.
Procedure
1. Select the PI point database table:
(Ls - ) piconfig> @table pipoint
2. Prepare it for writing:
(Ls - PIPOINT) piconfig> @mode create
3. Specify the input data format:
(Cr - PIPOINT) piconfig> @istructure tag, pointtype, digitalset
*> istructure tag, pointtype, digitalset
4. Specify the data:
(Cr - PIPOINT) piconfig> ValveStateTag, Digital, ValveStateSet
*> ValveStateTag, Digital, ValveStateSet
5. List the new tag entry in order to verify that it was properly created:
(Cr - PIPOINT) piconfig> @mode list
(Ls - PIPOINT) piconfig> @ostructure tag, pointtype, digitalset
6. Select only those tags that start with V:
(Ls - PIPOINT) piconfig> @select tag=V*
7. Force processing:
(Ls - PIPOINT) piconfig> @endsection
ValveStateTag, Digital, ValveStateSet
Procedure
1. Select the snapshot table:
(Ls - ) piconfig> @table pisnap
2. Prepare for writing:
(Ls - PISNAP) piconfig> @mode edit
3. Specify the input data format:
(Ed - PISNAP) piconfig> @istructure tag, time, value
4. Specify the data (set timestamp to *, which indicates that the current time should be used):
(Ed - PISNAP) piconfig> ValveStateTag, *, Open
5. List the snapshot entry and verify that it was properly updated:
Ed - PISNAP) piconfig> @mode list
(Ls - PISNAP) piconfig> @ostructure tag, time, value
6. Select only those tags that start with V:
The only processing mode supported by the PISTATE table is edit, which means that you
cannot use this table to create, delete or list digital state strings. To modify or list digital state
sets or the strings that belong to them, use the PIDS table.
You should not use the PISTATE table to substantially change the meaning of any digital state
string. This would affect any digital state set that uses the state string.
list of PI groups, as they existed in previous releases. The PIGROUP table must still be used to
edit group memberships.
For details about how to configure and use PI groups and PI identities, see the PI Data
ArchiveSecurity Configuration Guide.
This table defines groups to which PI users may be assigned. The primary key is GROUP.
PIGROUP Attribute Description
Group Group name
Description Group description
Users List of users belonging to the group
NEWGroup Used to rename an existing group
The table name is PINetMgrStats. The connection ID is assigned based on order of connection.
Since connection names are not required to be unique, the ID is the primary key. This table is
read-only.
PINETMGRSTATS Attributes Description
ID Connection ID. This is the primary key.
Name Connection name.
Operating System information
OSBuild Operating system build.
OSSysName Operating system name.
OSUser Operating system user.
OSVersion Operating system version.
PID The ID of the process that made the connection.
This is applicable to all entries besides pinetmgr.
PIPath PI Data Archive root directory on the server. This
item is the same for all connections.
Network-level data
ConStatus Connection status.
ConTime Time connection was established.
BytesRecv Bytes received by the connection.
BytesSent Bytes sent by the connection.
MsgRecv Messages received by connection.
MsgSent Messages sent by connection.
PeerPort The port being used by the remote process for the
connection to PI Network Manager. This
information is especially useful when
troubleshooting firewalls and network routing.
PeerAddress IP address of connecting machine.
PeerName Host name of connecting machine.
A timeout parameter DoRDNSForMessaging needs
to be set to 1 in order for piconfig to view this
attribute. You must stop and restart PI Data
Archive for the change of DoRDNSForMessaging to
be effective.
3.1,0,0
*----------
15,20,12987712,[0] Success
4-Sep-02 17:09:12,Local connection,1618340,PipeE
WIN32 Named pipe,127.0.0.1,localhost
1.8,0,0
*----------
20,20,33340,[0] Success
4-Sep-02 17:43:44,Local connection,2715,RmpSE
WIN32 Named pipe,127.0.0.1,localhost
1.8,0,0
*----------
21,20,50446,[0] Success
4-Sep-02 17:43:45,Local connection,3349,RandE
WIN32 Named pipe,127.0.0.1,localhost
1.8,0,0
*----------
23,24,38287,[0] Success
5-Sep-02 15:01:35,Local connection,6,piconfig
WIN32 Named pipe,,
3.1,0,0
*----------
PINetMgr,720370.,3210534.,
5-Sep-02 14:52:23, ,8807.,PINetMgr
, ,
3.1,0.,0.
*----------
Delete connections
You can delete connections through piconfig with the PINETMGRSTATS table. To delete a
connection, first list the connections to get the appropriate ID. Then, in delete mode, specify
the ID.
* (Ls - ) PIconfig> @table pinetmgrstats
* (Ls - PINETMGRSTATS) PIconfig> @ostr id,name,contime
* (Ls - PINETMGRSTATS) PIconfig> @select id=*
* (Ls - PINETMGRSTATS) PIconfig> @ends
0,pigetmsg,8-Mar-05 07:55:09
1,pilicmgr,8-Mar-05 07:55:10
2,pitotal,8-Mar-05 07:55:10
3,piarchss,8-Mar-05 07:55:10
4,piupdmgr,8-Mar-05 07:55:10
5,pisqlss,8-Mar-05 07:55:10
* (Ls - PINETMGRSTATS) PIconfig> @mode delete
* (Dl - PINETMGRSTATS) PIconfig> @istr id
* (Dl - PINETMGRSTATS) PIconfig> 0
*> 0
* (Dl - PINETMGRSTATS) PIconfig>
Resulting message log message:
0 pinetmgr 8-Mar-05 14:02:06
>> Deleting connection: pigetmsg(2700), Administrator requested closing
connection pigetmsg(2700) (1121), ID: 0
Important:
Edit point classes in stand-alone mode.
This lists the classic point class; this class is built from the classic and base attribute sets:
* (Ls - PIPTCLS) PIconfig> @tabl piptcls
* (Ls - PIPTCLS) PIconfig> @mode list
* (Ls - PIPTCLS) PIconfig> @ostr attrib,default,type
* (Ls - PIPTCLS) PIconfig> @ostr ...
* (Ls - PIPTCLS) PIconfig> @istr class
* (Ls - PIPTCLS) PIconfig> classic
*> classic
descriptor,,String
exdesc,,String
typicalvalue,50.,Float32
engunits,,String
zero,0.,Float32
span,100.,Float32
pointtype,12,UBYTE
pointsource,Lab,String
scan,1,BYTE
.
.
.
datagroup,piadmins,String
dataaccess,o:rw g:rw w:r,String
datasecurity,"piadmin: A(r,w) | piadmins: A(r,w) | PIWorld: A(r)",String
pointid,0,Uint32
recno,0,Uint32
ptclassname,classic,String
ptclassid,2,Uint32
ptclassrev,1,Uint32
tag,,String
sourcetag,,String
compdevpercent,2.,Float32
excdevpercent,1.,Float32
* End Repeat...
* (Ls - PIPTCLS) PIconfig>
As a shortcut, you can specify the point class name while setting the PIPOINT table with a
singlepiconfig command:
@table pipoint,classic
Do not confuse the piconfig command ptclass with the attribute PtClassName.
When listing classic point attributes of non-classic points, attributes unique to classic will
appear to be blank.
modify specifications remain in effect until a table is changed. New modify specifications are
added to previous specifications until data is processed. After this, new specifications replace
previous ones.
The spreadsheet must contain a row for each tag and a column for each attribute, such as tag,
Pointsource, and pointtype.
Save the spreadsheet as an ASCII file with comma-separated values. Precede any non-data
lines in the file with a * comment character. That way, piconfig ignores them.
Heres an example data file, taglist.dat, generated from a spreadsheet in comma-separated
values (CSV) format:
RealTag1,Lab,float16
RealTag2,Lab,float16
Modify the following example structure file so that the attributes listed in the structure line
match the contents of the ASCII data file. Note that the tag name, as specified by the tag
attribute, is the only attribute that is required. Attributes that are not specified are given
default values.
Use create mode to create new tags; use edit mode to modify existing tags. Use create, t or edit,
t mode to create the tag if it does not exist and to modify it if it does exist.
*Example piconfig input structure file
*File name: example3.str
*
*Create or modify tags from input file taglist.dat*
@table pipoint
@mode create, t
@istructure tag, pointsource, pointtype
@input taglist.dat
@endsection
*
*List tags to verify creation or modification
*
@mode list
@ostructure tag, pointsource, pointtype
@select tag=*, pointsource=Lab, pointtype=float16
@endsection
@exit
To read snapshot data, use list mode. To change the data, use edit mode. Other modes are not
applicable.
If a numerical snapshot value is invalid, the PI Data Archive server shows the value as Digital
State and the status attribute shows the digital state that describes the status. If a numerical
value is valid, the actual value is shown and the status attribute shows the digital state GOOD.
To change a digital point value, you can specify either the digital state name or the numeric
offset (digital state number).
The file pisnap.dif, included with every system, is a quick way to list snapshot values.
$ piconfig input pisnap.dif
* (Ls - PISNAP) piconfig> @sele tag=c*
* (Ls - PISNAP) piconfig> @ends
CDEP158,2,GOOD,20-Nov-02 17:02:00
CDM158,Manual,GOOD,20-Nov-02 17:09:30
CDT158,53.03498,GOOD,20-Nov-02 17:10:00
The PISNAP2 table is useful for debugging classic PI API applications. It uses RVAL and ISTAT
attributes instead of Value and Status.
In PI 2.x, ISTAT for digital tags is the negative of the state number. In the PISNAP2 table, ISTAT
contains a 32-bit number that represents both set and state. The set number is in the most
significant 16 bits and the state number is in the least significant 16 bits. The system set
number is 0. Be aware that some PI API functions truncate the most significant 16 bits. String
values cannot be used in PISNAP2 table.
PISNAP2 Attributes Description
RVAL real values; or 0 for other point types
ISTAT Positive integer value for integers, status for
invalid real values, or set and state number for
digitals.
To use the PISNAP2 table to add values to integer and digital tags requires setting the istat
attribute.
The set of attributes available varies by platform. The table has the following attributes:
PISUBSYS Attributes Description Operating System
PISubsysName Subsystem name All
IDNumber Unique ID of computer UNIX (Not all versions of UNIX
support this attribute)
Machine Hardware ID UNIX
OSNodeName TCP/IP host name UNIX
OSRelease Operating system release UNIX
OSBuild Operating system build Windows
OSSysName Operating system name All
OSVersion Operating system version All
PIStartupTime Subsystem startup time All
PIVersion Subsystem version All
The operating system attribute names may vary because they are operating system dependent.
The bytes and messages received and sent refer to all inter-process communications.
Some PISUBSYSSTATS tables also contain subsystem-specific data. This data is usually
presented for troubleshooting purposes. After setting a PISIBSYSSTATS table, always show the
available attributes with the @?atr command.
The primary key is NAME. The value in Collective must match the value of Name in the
PICOLLECTIVE table.
This example displays the name, FQDN and server ID:
* (Ls - ) PIconfig> @mode list
* (Ls - ) PIconfig> @tabl pisys,piserver
* (Ls - PISYS,PISERVER) PIconfig> @ostr name,fqdn,serverid
* (Ls - PISYS,PISERVER) PIconfig> @sele name=*
* (Ls - PISYS,PISERVER) PIconfig> @ends
PiServer1,PiServer1.osisoft.dom,12db4fde-963d-4f47-bc43-65f9e026502c
* (Ls - PISYS,PISERVER) PIconfig>
Note:
The PITHREAD table is primarily a monitoring tool. We recommend using it only with in-
depth understanding of threads. Specifically, avoid using it for any modification or thread
creation.
For example:
* (Ls - ) PIconfig> @table pithread,piarchss
* (Ls - PITHREAD) PIconfig> @ostru id,calls,handle,poolname,priority,state
* (Ls - PITHREAD) PIconfig> @ends
1500,7,212,RPC,0,Wait
1596,9,216,RPC,0,Wait
1504,11,220,RPC,0,Wait
1116,18,224,RPC,0,InUse
2124,9,228,RPC,0,Wait
3664,8,232,RPC,0,Wait
2592,9,236,RPC,0,Wait
3812,7,240,RPC,0,Wait
1216,0,816,EVQ,0,Wait
2488,0,820,EVQ,0,Wait
2736,0,824,EVQ,0,Wait
3140,0,828,EVQ,0,Wait
3012,0,832,EVQ,0,Wait
2356,0,840,Shift,0,Wait
3336,655015,0,Main, ,
3888,166401,248,Message, ,
3016,190,260,Read, ,
@table pitimeout
The primary key is NAME. The PITIMEOUT table cannot be modified remotely.
PITIMEOUT Attributes Description
Name Tuning parameter name
Value Tuning parameter value as a string
NEWName Used to rename an existing name
The client and PI Data Archive obtain the client's credentials from the operating system,
domain controller, and network software. These include any of the following: domain name, IP
host name, IP address, and user name.
Select this table using the command:
@table PITRUST
Any field specified as NULL string (""), is ignored when incoming connection are matched
against the table.
Domain, IPHost, AppName, and OSUser must be specified exactly or not at all.
IPAddr and NetMask must be specified together. If you provide a value for one, you must also
provide the other.
PIUser must always be specified as either a currently existing PI user in the user database, a PI
group in the group database, a PI identity, or as a dollar sign ($). The dollar sign must be paired
with a $ in either or IPHost. If the trust matches incoming credentials and there is no PIUser
with the same name, an error occurs at run-time. This method of specification matches any
user or any machine that passes the domain controller validation of their login credentials.
To create a trust , type:
@table pitrust
@mode create
@istr Trust,IPHost,PIUser
YourTrustName,server.domain.int,JohnDoe@ends
The description attribute is used to specify any type of user information, such as address or
title. The user may be added to multiple groups.
Users are assigned to groups using the PIUSER table. Attempting to change the group
membership of users via the PIGROUP table has no effect.
This example adds a user called testuser1 to the groups piadmins and piusers:
@table piuser
@mode create
@istr user, description, groups, ...
testuser1, Test User 1, piadmins, piusers
@ends
@exit
This example selects the PI timeout table and specifies create mode. The command @istr
name,value specifies that an input structure consisting of a parameter name and value will be
entered to create a new record in the PI timeout table. Next, the name and value
(MessageLog_DayLimit,60) are entered, creating the tuning parameter
MessageLog_DayLimit and setting its value to 60. The MessageLog_DayLimit tuning parameter
specifies the number of days messages will be retained in the PI message log.
c:\Program Files\PI\adm>piconfig
* (Ls - ) PIconfig> @tabl pitimeout
* (Ls - PITIMEOUT) PIconfig> @mode cr
* (Cr - PITIMEOUT) PIconfig> @istr name,value
* (Cr - PITIMEOUT) PIconfig> MessageLog_DayLimit,60
*> MessageLog_DayLimit,60
* (Cr - PITIMEOUT) PIconfig> @quit
PIconfig 1 Data lines
4 Command line
0 Records in error...
1 Records Created
Use these combined modes to modify existing records and create non-existent records
simultaneously. The specified mode persists until the next mode command is issued.
Enter the character c, for check, with either create or edit mode to combine these modes
without making changes to the PIPOINT table:
@mode create, c
@mode edit, c
Note:
The check-only modifier applies only to the PIPOINT table. For all other tables, this mode
is identical with the normal edit or create mode.
The specified mode persists until the next mode command is issued.
Delimited format
In delimited format, one or more lines of comma-separated attributes describe the format of
the data. One or more lines of comma-separated data values follow. These lines correspond to
the attributes. For example:
@istructure tag, pointsource,pointtype
SINUSOID,R,FLOAT32
You can change the delimiter from a comma to another non-alphanumeric character (Change
the delimiter character).
Note:
The command character @ distinguishes commands from data. Commands must be
preceded by @ or piconfig will interpret the string as data.
Fixed format
In fixed format, data structure includes one or more lines specifying the attribute, line number,
starting position on the line (counting from 1), and field width. For example:
@istructure tag, 1, 1, 12
@istructure pointsource, 1, 14, 1
@istructure pointtype, 1, 19, 7
*
*234567890123456789
SINUSOID R FLOAT32
NEXTPOINT Lab FLOAT16
The lines starting with the asterisk (*) are comment lines and are ignored. Their only purpose
is to improve readability. You can change the comment character (Change the comment
character).
The format lines come first and are all grouped together. This defines a record. If there are
more data lines than are specified in the record, piconfig interprets these as additional
records of the same format.
Fixed format is also used in the OpenVMS PI System PIDIFF utility.
Keyword format
In keyword format, every input line contains only two parts: the attribute and the value for
that attribute, separated by the delimiter character. The default delimiter character is a
comma(, ).
Theistructure command is not used with this format, as each line contains both data and its
description. For example:
tag, SINUSOID
pointsource, R
pointtype, FLOAT32
To select output attributes in keyword format, use the ostructure command. Specify a single
attribute on each line:
@ostructure tag
@ostructure pointsource
@ostructure pointtype
The ellipsis is useful where the same attribute can occur more than once in a single record. For
example, a state set contains variable number of states. A point class contains a variable
number of attributes and their defaults.
Comparison operators
Use these comparison operators with the select command:
= equal
<> not equal (!= also works)
> greater than
>= greater than or equal to
< less than
<= less than or equal to
These operators can be used for date, numeric or text fields. Text comparison is based on
ASCII values.
Wildcards
Wildcards, * and ?, may be used in text fields. * matches all characters; ? matches a single
character.
Batch methods
Topics in this section
Prepare input files
Pass an input file as a parameter
Redirect an input file
Capture output and errors in files
Pass commands as parameters
Redirect output
Reuse an output file as an input file
Start piconfig and run this input file using the input command:
$ piconfig
4 (Ls - ) piconfig> @input list.inp
SINUSOID,Float32,R
SINUSOIDU,Float32,R
SQF100,Float32,R
SQF101,Float32,R
4 (Ls - PIPOINT) piconfig>
Input files may contain all data, all commands, or mixed commands and data. Input files may
be nested; that is, an input file can refer to other input files.
By default piconfig echoes the input commands and input data in the file, as well as the
output data. If you wish to see only the output data in the file, use the echo command with the
data option:
*> @echo data
Redirect output
Use standard redirection from the command line:
$ piconfig < list.inp > list.out
Helpful hints
Abbreviations
All piconfig commands can be abbreviated to four characters.
Case sensitivity
Windows program and file names are case-preserving, but not case-sensitive.
The piconfig commands, attribute names and table names are not case-sensitive, but the
data are case-sensitive. The case-sensitivity on the timeout, firewall, and trust tables may be
changed for both of these parameters by using the case command.
@command @command_file
In a command file, the command specified is prepended to every line in the command file. This
is useful, for example, when a file with input structure lines have been generated from another
program, such as PIDIFF, or when the same complex structure is used for both input and
output. For example, if the file cmds.txt contains the following lines:
tag,pointtype,pointsource
ptowner,ptgroup,ptaccess
ptsecurity
dataowner,datagroup,dataaccess
datasecurity
You can execute these commands by entering the following at the piconfig prompt:
@istructure @cmds.txt
This technique works for both piconfig scripts and for interactive sessions.
Quoted strings
There are two reasons to use quotes (single or double) with piconfig data:
The data contains an embedded delimiter character that will confuse correct parsing either
on input or on output that is used in the future by piconfig itself or by other applications
(such as Microsoft Excel).
The specific table requires certain data to be enclosed in quotes (single or double) for its
own further processing. Examples include the PI Batch tables and the Performance
Equation expressions configured in the extended-descriptor of a point.
piconfig attempts to parse incoming data into fields using the delimiter character. If a field
starts with a quote (either single or double), piconfig ignores any delimiter until a matching
quote is found.
When an already quoted string must contain embedded quotes, there are two options:
Enclose strings containing double quotes in single quotes and vice versa
Escape the embedded quotes with a backslash (\)
A field containing the delimiter character must be quoted. A field that starts with a quote
should be quoted using the other type of quote. A field that starts with one type of quote and
contains the other type as well should be quoted, and the embedded quotes must be escaped.
should be specified as
"unit,function"
or
'unit,function'
The expression
'sinusoid' > 'tag33'
should be specified as
"'sinusoid' > 'tag33'"
or
('sinusoid' > 'tag33')
The expression
'sinusoid' + "t-1d" + "ABC"
should be specified as
"'sinusoid' + \"t-1d\" + \"ABC\""
When the output from piconfig is used in another session or by another program such as
Excel, make sure that fields containing the delimiter character are quoted (on output). Using
the quote command does this:
@quote "
or
@quote '
Boolean values
When a field in any table is a Boolean flag, for example the step flag in the PIPOINT table, the
input data can be specified as:
1 / 0
Yes / No
True / False
piconfig always sends the data to the table as a string as explained above.
The table owner, in this example PI Base Subsystem, interprets the incoming string as a
Boolean value 1 / 0.
This can cause some confusion in the digital states table when states are defined as the strings
1, 2, 3, and so on. We recommend that you configure digital states like this: "One, Two, " or
"State1, State2, "
Similarly, to define the states "true", "false", make a set with "false" in the first position
followed by "true" to correspond to 0 and 1. Alternatively, modify the names slightly; such as
"S-true", "S-false".
Configuration persistence
Table specifications remain in effect until the next table command. Mode specifications
remain in effect until the next mode command.
For all structure formats, the structure specifications remain in effect until a table is changed.
New structure specifications are added to previous specifications until they are used to
process data. After this, new specifications overwrite previous ones. Select and modify
specifications behave similarly. These two commands are also cleared on mode and table
changes.
Procedure
1. Run piconfig.
2. At the piconfig prompt, type:
@Comchar NewCommandCharacter
For example., to change the comment character to an exclamation point (!) you would type
@Comchar !
Procedure
1. Run piconfig.
2. At the piconfig prompt, type the delimiter command, followed by the new character.
For example, to change the delimiter character to a backslash ( \ ) you would type:
@delimiter \
Procedure
1. Run piconfig.
2. At the piconfig prompt, type the comment command, followed by the new character.
For example, to change the comment character to an exclamation point (!) you would type:
@comment !
Procedure
For example, at the piconfig command prompt, type:
@login figaro, piadmin, myadminpassword, 5450
Once the login command is issued, all subsequent commands are executed on the remote PI
Data Archive server.
When turned on, the prompt indicates the piconfig mode and the current table name in
parentheses. The table name in the prompt is set when you issue the @table command:
* (Ls - ) piconfig> @table pipoint
* (Ls - PIPOINT) piconfig> @help
where xxx identifies a command line option. Depending on the specific option, you might
include additional arguments.
Option Description
-did Dumps the server ID file; used for troubleshooting PI collectives.
This command works only when the server is not running. When
the server is running, use Collective Manager or piconfig with
the pisysdump.dif file.
-e code Displays the message associated with an error code.
-ecert [path] Exports the server certificate to a file.
-gap path [-time=secs] [- Estimates gaps in data for an archive. By default it samples the
sample=percent] [- most active 10 percent of tags where the archive gap is at least
matching=percent] 300 seconds long and is uniform across 90 percent of the sampled
tags.
-host Displays host information as used for trust login.
-host -file filename Produces machine signature file (for licensing).
-host -lictocsf licfile csffile Extracts the cluster signature from a license file and stores in a
cluster signature file
-host -lictomsf licfile msffile Extracts the machine signature from a license file and stores in a
machine signature file.
-icert [path] Imports the certificate file to the certificate store.
-qd [HeaderOnly Header| RecNo=n | Dumps header or all/filtered events from the event-queue file.
PointId=ID] path
-qs path Displays statistics of an offline event-queue file.
-tz [ -if path | -ifrule [path] ] [-of Customizes Standard and Daylight Saving Time changes.
path]
-tz [time[TZ]] [ -check | -dump [- Shows time-zone information.
brief] |-full]
-udf path Resets the piadmin (userid #1) password to blank.
-v Shows version information.
where errorcode is the error number displayed in the message log. Error code values may be
positive or negative.
You can also use the pidiag utility to translate operating system error codes, which are
always positive numbers.
Procedure
1. At a command prompt, go to the PI\adm directory.
2. Type the following command:
pidiag -ad path
If you omit the path specification, the command displays the content of the file at the default
location, PI\dat\piarstat.dat.
C:\PI\adm>pidiag -ad
Archive manager data file version is 1
Archive primary archive code is 1
Archive manager data file dump follows:
PInt [$Workfile: pinttmpl.cxx $ $Revision: 13 $]::
Table contains 3 entries, with 3 total slots allocated.
Extend size is 2 slots and the next iCode is 4.
1. C:\PI\dat\piarch.001
2. C:\PI\dat\piarch.002
3. C:\PI\dat\piarch.003
Alphabetical index:
C:\PI\dat\piarch.001
C:\PI\dat\piarch.002
C:\PI\dat\piarch.003
PIobject:
End of Dump
You can use the pidiag-ad command in a procedure to repair the archive manager data
file. For details, see Repair the archive manager data file.
When PI Archive Subsystem is running, use the piartool -al command to get this
information.
If the archive manager data file is corrupted, first try the pidiag -ara command. If that does
not help, use the pidiag-ar command. For more details, see Repair the archive manager data
file.
Procedure
1. Shut down PI Data Archive.
2. At a command prompt, go to the PI\adm directory.
3. Type the following command:
pidiag -ar path
The optional path argument is the full path of the primary archive file that you want to use.
If you do not provide this argument, the command will prompt you for it. When you restart
PI Data Archive, the file is the only archive registered.
Procedure
1. Shut down PI Data Archive.
2. At a command prompt, go the PI\adm directory.
3. Type the following command:
pidiag -ara
The pidiag -ara command attempts an automatic recovery of the archive manager data
file, PI\dat\piarstat.dat, using the existing data in the file.
Procedure
1. At a command prompt, go to the PI\adm directory.
2. Type the following command:
pidiag -ahd path
where path is the path to the unregistered archive.
For example:
pidiag -ahd d:\pi\dat\piarch.001
The output is similar to the output from the piartool -al command for a single archive
file:
Procedure
1. At a command prompt, go to the PI\adm directory.
2. Type the command: pidiag -archk path
Where path is the full path to the archive.
Note:
You can specify the optional complete parameter, as in: pidiag -archk path
complete, to include details about each record in the report, including the start time,
number of events, and fill ratio of the data record.
Points receiving events in order with no edits or remove events typically have a fill ratio close
to 100%.
Note:
Since the last record in a chain is rarely full, the fill ratio is almost never exactly at 100%.
In this example, points 4 and 17 (recno 4 and 11, respectively) have an excessive number of
index records.
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 -archk command can also be run with the optional argument complete, 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 piartool -aw). 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
Procedure
1. At a command prompt, go to the PI\adm directory.
2. Type the following command:
pidiag -gap path [-time=secs][-sample=percent][-matching=percent]
The command checks for data gaps by sampling the most active tags and searching for gaps
in their archived data. By default, the command samples the most active 10 percent of tags.
The command reports any gaps that are at least 300 seconds long and that are uniform
across 90 percent of the sampled tags. You can specify the percentage of tags to sample, the
gap length, and the percentage of tags having the same gap.
For example:
D:\PI\adm>pidiag -gap d:\pi\dat\piarch.001
Analyzing archive: D:\PI\dat\piarch.001
------------------------------------------------------------------
Archive start time: 16-Aug-09 23:08:12
Archive end time: 18-Jan-38 19:14:07
Number of points to sample: 183
Minimum gap time: 300 seconds
164 out of 183 points must have aligned gaps
------------------------------------------------------------------
Procedure
1. Copy the piarstat.dat file to a temporary location. Do not overwrite the original file.
Rename the file, in case you need it later.
2. Stop the PI Data Archive server.
3. Run the pidiag -ad command, collect the dump of the piarstat.dat file, and verify the
output.
4. If the results of the dump look normal, attempt the automated recovery. Otherwise, use the
interactive one.
5. Restart the PI Data Archive server.
6. Check the message log to see if all archives are loaded. If the interactive version is used,
only the primary archive is loaded.
7. Register any remaining archives. If the interactive version was used, all other archives must
be registered.
Procedure
1. At a command prompt, go to the PI\adm directory.
2. Type the following command:
pidiag -qd [HeaderOnly | RecNo=n |PointId=ID] path
where path is the full path of the event queue file. If you specify the HeaderOnly option, the
command only returns the file header and page headers.
Procedure
1. At a command prompt, go to the PI\adm directory.
2. Type the following command:
pidiag -qs path
Licensing management
PI Data Archive requires a PI license file to run. The license file may be machine or cluster
specific, which means it can be used only on a particular computer or the members of a
particular cluster. PI License Manager determines whether a machine- or cluster-specific
license file can be used on a computer or a cluster based on hardware, network, and operating
system information. The signature of a machine or a cluster contains this information. You can
use several pidiag commands to gather and check machine and cluster signatures.
Procedure
1. At a command prompt, go to the PI\adm directory.
2. Type the following command:
pidiag -host -file filename
where filename is the file name of the machine signature file. OSIsoft recommends that you
use the extension .msf for a machine signature file and .csf for a cluster signature file.
For example:
D:\PI\adm>pidiag -host -file D:\vmtest-xp2.msf
Compare signatures
Use the pidiag utility to compare a signature file to another signature file or to local or cluster
configuration.
Procedure
1. At a command prompt, go to the PI\adm directory.
2. Type the following command:
pidiag -host -compare filename [, filename]
This command compares signatures. When your provide only one signature file, the
command compares the information stored in the file with the configuration of the local
computer or cluster. When you provide a second signature file, the command compares the
two signature files.
The licfile parameter is the full path of the license file. The msffile parameter is the output
machine signature file that will contain the extracted machine signature. The csffile parameter
is the output cluster signature file that will contain the extracted cluster signature.
Example:
D:\PI\adm>pidiag -host -lictomsf D:\pilicense.dat D:\test.msf
These commands are useful when you have a machine specific license file but do not know
which computer or cluster it is for. Once you extract the signature, you can use the pidiag -
host -compare command to check it against your machine or cluster.
Miscellaneous commands
Topics in this section describe pidiag commands for various administrative tasks.
Procedure
1. Navigate to the PI\adm directory.
2. Type:
pidiag -crash
3. Debuggers, including Dr. Watson, rely on debug symbols to translate code addresses to line
numbers and meaningful text. The PI System installs these symbols in %SystemRoot%
\Symbols\exe directory where SystemRoot is typically C:\Windows. The system
environment variable, _NT_SYMBOLS_PATH, must include this full path. On a crash, if this
path is not included in _NT_SYMBOLS_PATH the crash symbols will not be correctly
interpreted.
The administrative account is piadmin. To reset the piadmin (userid #1) password to blank:
Procedure
1. Navigate to the PI\adm directory.
2. Type:
pidiag -udf path
This command is useful when the piadmin password is lost. For example:
e:\PI\adm>pidiag -udf e:\pi\dat\
The administrative password has been successfully reset.
Procedure
1. Navigate to the PI\adm directory.
2. Type:
pidiag -host
This may be used on nodes running client applications and interfaces, to help the definition
of trust login records. For example:
D:\pi\adm>pidiag -host
Domain <MyComp>
Machine <PISRV3>
User <user1>
IP Addr <10.0.0.3>
FQDN <PISRV3.MyComp.com>
Primary Domain Controller: <\\controller03.MyComp.com
IPV6 Compatible host address resolution:
Reverse name lookup setting: 1
Name: PISRV3.MyComp.com
Address: fe80::ad49:68df:30ff:fc6d12
Family: PF_INET6
Name: PISRV3.MyComp.com
Address: 10.0.0.3
Family: PF_INET
Name: fe80::ad49:68df:30ff:fc6d12
Address: fe80::ad49:68df:30ff:fc6d12
Family: PF_INET6
Name: 10.0.0.3
Address: 10.0.0.3
Family: PF_INET
This command also tests the availability of the domain controller. The command should
complete in a fraction of a second; if it hangs or takes more than a few seconds to return it
indicates the domain controller access may not be fast or consistent. Failure to have prompt
access to the domain controller results in poor PI System performance.
The optional path is the name of the file to store the certificate. If it is not provided, the
certificate is stored in PI\adm\piserver.cer.
The command to import the certificate file to a cluster node is:
pidiag icert [path]
The optional path is the name of the certificate file. If it is not provided, PI\adm
\piserver.cer is used.
Input options
Input Option Description
-if file_name Read messages in the specified message log file.
pigetmsg filter options valid for group counts with the sum and top options
Filter options
Filter Option (Field) Description
-id msg_id Retrieve messages with the specified message
identification number. (Specify 0 for free-format
messages.)
-mc num_msg Retrieve no more than the specified number of
messages.
-msg text Retrieve messages with the specified text. Text
must match exactly. To retrieve messages with
additional text, include wildcard characters (*).
For example, specify -msg Consumer* to retrieve
messages that start "Consumer" and contain any
subsequent text. Specify -msg "*timed out*" to
retrieve messages that contain "timed out" any
place in the message text.
-ohost name Retrieve messages written by processes acting on
behalf of users from the specified host name.
Without a specified host name, retrieves messages
without an originating host, such as those written
locally or those written by older clients.
-oosuser name Retrieve messages written by processes acting on
behalf of the specified user name.
-opiuser identity Retrieve messages written by processes acting on
behalf of users with the specified PI identity.
-phost name Retrieve messages written by processes running
on the specified host name. With no specified host
name, retrieve messages written by processes
running on localhost.
-pid number Retrieve messages written by programs with the
specified process ID number.
-posuser name Retrieve messages written by processes running
under the specified user account name.
-ppiuser identity Retrieve messages written by processing running
under user accounts with the specified PI identity.
-pr name Retrieve messages written by specified program
name, such as pinetmgr.
Filter options for pigetmsg that are not valid to group counts with the sum and top options
Filter options not valid
Filter Option Description
-cat type Retrieve messages that belong to the specified
category.
-et time Retrieve messages up to the specified end time,
entered in PI time format. Beginning with PI Data
Archive 3.4.385, if you specify just -st, then
pigetmsg assumes the end time is the current
time.
-pri number Retrieve messages marked with the specified
priority (1-10).
-si Retrieve information, warning, error, and critical
messages.
-sw Retrieve warning, error, and critical messages.
-se Retrieve error and critical messages.
-sc Retrieve critical messages only.
-st time Retrieve messages beginning at the specified start
time, entered in PI time format.
-t Retrieve last message in the specified time range.
Without an end-time specification, retrieve most-
recent message.
Prompting options
Prompting Option Description
-qb Run pigetmsg interactively, prompting for basic
options only (start time/end time).
Formatting options
Formatting Option Description
-fb Generate binary message-log output.
-fc Generate CSV-format output.
-ft Generate two-line output (two lines per message).
-fw Generate wide-format output (one message per
line).
-fx Generate XML-format output.
Output options
Output Option Description
-m msg_id Display the message definition for the specified
message ID.
Note:
Cannot combine with other options.
To review messages for a specific time span, enter starttime and endtime.
To review a specific number of messages that begin at a specific start time, enter maxcount
and starttime.
To review a specific number of messages that end at a specific end time, enter endtime and
maxcount.
To review messages that span from a specific start time through either a specific number of
messages or a specific end time, starttime, endtime, and maxcount.
Display the number of critical, error, warning, informational, and debug messages since
midnight.
pigetmsg -st T -sum sl
MessageSeverity, Count
Error,52
Warning,1
Information,17068
Debug,20923
Display the type of error messages reported, sorted to show the top occurrences first. (The
message is shown in a canonical form that ignores the message parameters.)
pigetmsg -st T -se -top msg
MessageID, Count, Message
6088,37,"Connection to pinetmgr lost."
6019,14,"Rpcservertablelist registration failure: %1"
6023,1,"PIsessionmgr::disconnect %1 Status: %2"
Display the occurrences of a particular message broken down over a given interval.
pigetmsg -st T -id 6088 -sum 1h
13-Jan-10 00:00:00,0
13-Jan-10 01:00:00,0
13-Jan-10 02:00:00,0
13-Jan-10 03:00:00,0
13-Jan-10 04:00:00,0
13-Jan-10 05:00:00,0
13-Jan-10 06:00:00,0
13-Jan-10 07:00:00,0
13-Jan-10 08:00:00,4
13-Jan-10 09:00:00,31
13-Jan-10 10:00:00,2
13-Jan-10 11:00:00,0
13-Jan-10 12:00:00,0
13-Jan-10 13:00:00,0
13-Jan-10 14:00:00,0
13-Jan-10 15:00:00,0
13-Jan-10 16:00:00,0
13-Jan-10 17:00:00,0
13-Jan-10 18:00:00,0
13-Jan-10 19:00:00,0
13-Jan-10 20:00:00,0
13-Jan-10 21:00:00,0
13-Jan-10 22:00:00,0
13-Jan-10 23:00:00,0
By default, the utility automatically names the file based on the search start and end time, the
name of the server, and any filtering options you specify. You can specify a file name:
pigetmsg -st * -1d -of mylog.dat
By default, the utility writes message in log-file format, which you can search and filter with PI
SMT or pigetmsg. You can specify alternative formats, including CSV, XML, wide (one message
per line), and two line (two lines per message).
Parameters
SessionID : Int32
Status : Status
Severity : Error
Message ID : 6023
Producer
This is the source of update notifications. For example: PI Snapshot Subsystem produces
snapshot events; PI Base Subsystem produces PI point database and Module Database
changes; PI Archive Subsystem produces archive changes; and PI Batch Subsystem
produces Batch Database changes.
ConsumerA
pplication currently signed up as a consumer. For example, a PI ProcessBook display is a
consumer.
Qual
The qualifier. If the producer is snapshots or archive, the qualifier contains a point ID. If the
producer is PIUnitBatchOnUnitUpdates, the qualifier contains a unit batch storage point ID.
Not used for other producers.
Flags
If the producer is archive, contains archive event modes. Not used for other producers.
Pending
Number of events available for the consumer to retrieve. The value goes up and down as
events come in and the consumer pulls them out. Values that increase continuously might
indicate that the consumer is not working properly or disconnected.
Note:
The Pending column display is not accurate above 65,536 events.
Option Description
-cs Summary of consumer statistics.
-g A list of producers and consumers with their
status. This option is supported for backward
compatibility. The -ps and -qs options provide
more information.
-ps Summary of producer statistics.
-qs consumer Statistics for the specified consumer's event queue.
-sp Summary of signup statistics, sorted by producer.
-ss Summary of signup statistics, sorted by consumer.
-us Summary of PI Update Manager statistics.
-v Show version.
pilistupd modifiers
Modifier Description
-c consumer Select a specific consumer. Use * and ? as wildcard
characters. Enclose the consumer name in quotes if the
name contains Microsoft Windows escape characters. For
example:
pilistupd -c "pialarm|2"
-p producer Select producer. Use * and ? as wildcard characters.
-m min Show only signups with pending >= min
-r [S] [C] Repeat C times every S sec. Default for S is 5 seconds.
pilistupd examples
Topics in this section
Limit output to point updates example
Run pilistupd with PI ProcessBook display example
Determine if client updates occur example
ptupdates Pibatch|1 0 0 0
ptupdates Pitotal|2 0 0 0
ptupdates PipeE|14|3 0 0 0
ptupdates RandE|16|4 0 0 0
ptupdates RmpSE|17|5 0 0 0
The results show signups for all registered consumers for the producer ptupdates.
The last three lines of results are all the same display. For PI SDK applications, the consumer
attributes include:
Application name Procbook
Client hostname zheng2
Process ID 376
Event pipe ID 1 and 2
Consumer ID assigned by PI Update Manager 89 and 90
The qualifier attribute shows the point IDs being trended. There are no Pending events.
No Matching entries
^C
The pipetest utility is limited to equations that are 4,095 characters or less, and you cannot
use the utility to test dynamic response functions.
To run the pipetest utility interactively from a command prompt window, open a command
window, change to the ..\PI\adm directory and type:
pipetest
At the pipetest equation prompt, type in the equation you want to test. If the equation syntax
is not valid, pipetest displays a syntax error. If the syntax is valid, pipetest displays the
result of the equation.
You can also put one or more performance equations in a simple text file, and pass the entire
file to pipetest using the -f switch. In the text file, you put each equation on a single line. You
can include comment lines by beginning the line with an exclamation mark (!).
Here is the text from an example pipetest file, called peTestEquations.txt:
! test calculation for point A
if BadVal('sinusoid') then 0 else ('sinusoid')/25
! test calculation for point B
TimeLT('sinusoid', 'y' , 't', TagVal('sinusoid', '*'))
Each input line in turn is echoed and the evaluated result is displayed.
In this example, SQL query timeout is set to 60 seconds, the default time step (for queries
against the piinterp table) is set to 7200 seconds (that is, 2 hours) and the trace
andaggrtimestart options have been set.
PI SQL Subsystem (pisqlss) supports the following command-line arguments:
Argument Description
-o Options (letter "o", not zero). The options are
specified in a comma-separated list of tokens. The
interpretation of the tokens is not case-sensitive.
See the following table for the list of supported
options.
-t SQL query timeout, in seconds. If this time expires,
PI SQL Subsystem will cause the query to return
either a timeout error, or a subset of the actual
results, if the SUBSET option is set. See the table of
options below.
-ts Default value of the timestep column in the
PIINTERP table. This value can be overridden for
any query by specifying a timestep constraint in
your SELECT statement.
Use caution when editing pistart.bat. This file is overwritten at every PI Data Archive
upgrade.
If you have applied a patch to your PI Data Archive, the version numbers of the executables
affected are different from that shown by piversion -v. To see the version of each
executable and the version of the executable running in memory, use piversion.bat, also in
the PI\adm directory:
piversion.bat
When you use the -v option to run an executable, it does not start; instead, the version number
appears. For example, if you type piarchss.exe -v from the PI\bin directory, you would
see something like this:
Version: PI 3.4.380.36
Program: piarchss.exe
piarstat.dat List of registered archive files. This binary file, called the
archive manager data file, keeps track of registered
archives. PI Archive Subsystem requires this file. If you
are having trouble with archive file registration, do not
delete this file. Instead, repair the archive manager data
file.
PI Data Archive Messages (PI Message Subsystem)
pimsgtxt.dat Message text resource. This binary file stores formatted
message strings used by the pigetmsg utility.
pimdf.dat Message definitions; new on PI Data Archive versions
3.4.380 and later.
pimsg_yymmdd.dat Message logs, where yymmdd represents date covered by
file.
Batch Database (PI Batch Subsystem)
piptunit.dat Legacy Batch Units (deprecated)
piptalia.dat Legacy Batch Aliases (deprecated)
Miscellaneous
shutdown.dat This text file contains directives that tell the PI Shutdown
Interface which points should receive shutdown events.
piarcmem
This binary file is used by PI Snapshot Subsystem. It contains the most recent values that have
been sent to the PI Data Archive server. PI Snapshot Subsystem periodically writes the latest
snapshot values to this file. Contact OSIsoft Technical Support if you need to diagnose and
repair this file.
piarstat.dat
This binary file, called the archive manager data file, keeps track of registered archives. PI
Archive Subsystem requires this file. If you are having trouble with archive file registration, do
not delete this file. Instead, see Repair the archive manager data file.
pidignam
This binary file stores each unique digital state name. Contact OSIsoft Technical Support if you
need to diagnose or repair this database file.
pidigst
This binary file stores the digital sets; it references names stored in the above file. Contact
OSIsoft Technical Support if you need to diagnose or repair this database file.
pilastsnap
This binary file stores the timestamp of the last completed snapshot flush to disk. On PI Data
Archive startup, this timestamp is assumed to be the shutdown time and is used as the
timestamp for shutdown events. On orderly shutdown, this file will contain the true shutdown
time. With a system crash such as a power failure, the snapshot may be as old as the snapshot
flush cycle time period. The snapshot flush cycle is controlled by the SnapFlushCycle timeout
parameter, which is 15 minutes by default.
pimsgtxt
This binary file stores formatted message strings used by the pigetmsg utility. Contact OSIsoft
Technical Support if you need to diagnose or repair this database file.
pipoints
This binary file stores the point database. Contact OSIsoft Technical Support if you need to
diagnose or repair this database file.
piptalia
This binary file contains alias information. Contact OSIsoft Technical Support if you need to
diagnose or repair this database file.
piptattr
This binary file stores the point attributes. Contact OSIsoft Technical Support if you need to
diagnose or repair this database file.
piptclss
This binary file stores the point classes. Contact OSIsoft Technical Support if you need to
diagnose or repair this database file.
piptunit
This binary file stores the PI point units. Contact OSIsoft Technical Support if you need to
diagnose or repair this database file.
piusr
This file stores the PI user database. Contact OSIsoft Technical Support if you need to diagnose
or repair this database file.
piusrctx
This file stores the context database. Contact OSIsoft Technical Support if you need to diagnose
or repair this database file.
piusrgrp
This file stores the group database. Contact OSIsoft Technical Support if you need to diagnose
or repair this database file.
shutdown
This text file contains directives that tell the PI Shutdown Interface which points should
receive shutdown events.
Attribute Description
Connector Events Read Exec Time Time elapsed in milliseconds for one Events Read
for a COM Connector point.
Connector Events Read/sec Rate of events read for mapped points through
COM Connectors. This rate is NOT included in the
Events Read/sec counter.
Connector Read Operations/sec Rate of calls to read events for mapped points
through COM Connectors. This rate is NOT
included in the Read Operations/sec counter.
Connector Summaries Exec Time Time elapsed in milliseconds for one summaries
call for a COM Connector point.
Connector Summaries/sec Rate of summaries for mapped points through
COM Connectors. This rate is NOT included in the
Events Read/sec counter.
Current Cache Record Pool Current maximum number of cache records, this
may be lower that the configured value due to low
memory resources.
Current Max Unflushed Events/pt Current maximum number of unflushed events per
point, this may be lower that the configured value
due to low memory resources.
Empty Archive Count Number of empty, shiftable archives.
Event Queue Chunk Size Number of events read per event queue read
operation.
Event Queue Reader Delay Amount of time (in milliseconds) the event queue
reader thread is being throttled.
Events Cascade/sec Rate of out-of-order events causing record shifts.
Events Read/sec Rate of archive events read.
Failed Archive Shift Flag Indicates if the most recent archive shift failed.
Failed Events/sec Number of events which failed to be added to
memory or archive files.
File Management Operations/sec Rate at which archive file management operations
are performed.
File Management Queue Size Number of pending archive file management
operations in memory queue.
Flushed Events/sec Number of events successfully flushed to archive.
Flush Queue Size Number of pending flush operations in memory
queue.
Full Write Cache Flushes/sec Number of full write caches that were flushed.
GetSnapshot Calls/sec Rate of internal calls to PI Snapshot Subsystem.
High Priority Flush Queue Entries/sec Rate at which flush requests are added to the high
priority flush queue.
High Priority Flush Queue Size Number of flush requests in the high priority flush
queue.
InterpEvents Calls/sec Rate of interpolated events calls.
Out of Order Events/sec Out of order events posted in the archive.
Overflow Data Record/sec Rate at which data archive records are created.
Overflow Index Record/sec Rate at which index archive records are created.
Attribute Description
PIBatches Created/sec Rate of PI Batch creation.
PIBatches Deleted /sec Rate of PI Batch deletion.
PIBatches Edited/sec Rate of PI Batch edits.
PIBatches Read /sec Rate of PI Batch access.
PICampaigns Created/sec Rate of PI Campaign creation.
PICampaigns Deleted /sec Rate of PI Campaign deletion.
PICampaigns Edited/sec Rate of PI Campaign edits.
PICampaigns Read /sec Rate of PI Campaign access.
PITransferRecords Created/sec Rate of PI Transfer Record creation.
PITransferRecords Deleted /sec Rate of PI Transfer Record deletion.
PITransferRecords Edited/sec Rate of PI Transfer Record edits.
PITransferRecords Read/sec Rate of PI Transfer Record access.
PIUnitBatches Created/sec Rate of PI Unit Batch creation.
PIUnitBatches Deleted /sec Rate of PI Unit Batch deletion.
PIUnitBatches Edited/sec Rate of PI Unit Batch edits.
PIUnitBatches Read /sec Rate of PI Unit Batch access.
PlotEvents Calls/sec Rate of plotted (trended) event calls.
Point Flushes Last Cycle Number of points flushed to disk during last cycle.
Busy points might get flushed several times per
cycle.
Preemptive Flushes/sec Rate of preemptive flushes performed.
Primary Archive % Used Percent of used records in primary archive file.
Primary Archive Average Events/record Average number of events per record in the
primary archive.
Primary Archive Flushed Events/sec Rate of events being flushed to the primary
archive.
Primary Archive Index Records Number of index records in the primary archive.
Primary Archive Record Allocations/sec Rate at which archive records are allocated in the
primary archive
Primary Archive Records Fill/sec Fill rate of records in primary archive.
Primary Archive Total Events Number of events in the primary archive.
Primary Archive Number Internal index number of archive current assigned
to primary position.
Read Operations/sec Rate of archive read calls. Each call can return
multiple events. The rate of event retrieval is
Events Read/sec.
Record Disk Reads/sec Rate of archive disk reads (includes Cache Record
Disk Reads/sec).
Record Disk Writes/sec Rate of archive disk writes.
Record Load Time Average BASE Denominator for Record Load Time Average.
Record Load Time Average Average time (in microseconds) required to load a
record from an archive.
Record Write Time Average BASE Denominator for Record Write Time Average.
Attribute Description
Record Write Time Average Average time (in microseconds) required to write
a record to an archive.
Shift or System Backup Flag Indicates if an archive shift or system backup is in
process.
Skipped Flushes/sec Rate of flushes skipped due to point being
previously flushed.
Summary Calls/sec Rate of summary/filter expression calls.
Time to Archive Shift Number of seconds until the archive is projected to
shift. This time is not calculated if the archive is
less than 20% full.
Total Unflushed Events Total number of unflushed events.
Unflushed Points Number of points that have at least one unflushed
event.
Write Cache Flush Size Average BASE Denominator for Write Cache Flush Size Average.
Write Cache Flush Size Average Average size of write caches when flushed.
Write Contention Points Number of points in write contention last cycle.
Write Contentions/sec Rate of write lock contentions.
PI authentication statistics
Performance Counter Description
Delegation Failures/sec Rate of failed delegation attempts made to PI
Network Manager.
Delegation Successes/sec Rate of successful delegations made to PI Network
Manager.
Explicit Login Failures/sec Rate of failed explicit login authentication attempts
made to PI Network Manager.
Explicit Login Successes/sec Rate of successful explicit login authentications
made to PI Network Manager.
HA Authentication Failures/sec Rate of failed HA authentication attempts made to
PI Network Manager.
HA Authentication Successes/sec Rate of successful HA authentications made to PI
Network Manager.
Session Authentication Failures/sec Rate of failed authentication attempts made to PI
Network Manager.
Session Authentication Successes/sec Rate of successful authentications made to PI
Network Manager.
Trust Failures/sec Rate of failed trust authentication attempts made
to PI Network Manager.
Trust Successes/sec Rate of successful trust authentications made to PI
Network Manager.
Windows Authentication Failures/sec Rate of failed Windows authentication attempts
made to PI Network Manager.
Attribute Description
Last Backup Total File Count Total files identified for last backup. Should be
equal to copied + skipped + failed unless the
backup is non-component mode.
Last VSS Freeze Duration Time in milliseconds between start of the freeze
event and the end of the thaw event for the last
VSS backup.
Last VSS Freeze Transition Time in milliseconds to acquire exclusive write
locks in all subsystems participating in backup.
Verification Failures Total number of verification failures.
Counter Description
Module Database Record Count The total number of records in the module
database.
Point Accesses/sec Rate at which point information is accessed, not
including point edits. This will include translations
of tag to point id.
Point Count Total number of defined points. This number
includes the Connector Point Count.
Point Create or Edit/sec Rate at which points are created or edited.
Points Loaded in Memory Indicates the number of points that have all point
attributes loaded in memory. It is updated as the
Base Subsystem is starting and loading the point
database. The Base Subsystem reports progress
messages once a minute while it is loading the
point database. A final message is reported when
loading the point database is complete. This
counter can be compared with PI Base Subsystem
\Point Count to determine the percentage of
points loaded.
Security Descriptor Mismatches Indicator Indicates if there are known security mismatches
between a PI Module security descriptor and its
corresponding AF Element security descriptor
since the last security report was generated. Value
of 1 means there are known errors.
Wild Card Searches/sec Rate of wildcard point searches. This counter
represents the rate at which new searches are
started, not the number of points found.
Attribute Description
Events In Error Number of events not processed locally by the
Buffer Subsystem, including:
1. events with invalid mode, data type, or value
2. events that can't be coerced to the point's data
type
3. events with a digital set that does not match
the point's configuration
These events are still sent to the PI Data Archive
servers.
session. The session persists as long as PI Buffer Subsystem is buffering to this server.
PI collective statistics
Attribute Description
Current Server The index of the current server of the collective
Is Running Normally Is the status normal for all members of the
collective?
Last Config Change Time Last time the configuration of the collective was
modified
Number of Servers The number of member servers in the collective
Attribute Description
Sent Messages/sec The number of messages sent to PI Message
Subsystem per second.
Retrieved Messages/sec The number of messages retrieved by PI Message
Subsystem per second.
Attribute Description
Scheduled Task Delay Delay in milliseconds between when the currently
running task was scheduled and when it was
executed.
Send Errors The number of times an error occurs during a send
of a message to the PI Network Manager.
Statistics for PI Performance Equation Scheduler also include UniInt-specific statistics. See
"UniInt Performance Counters" in the UniInt Interface User Manual for details.
Tag Description
PERF.LOCALHOST.Memory.% Committed Bytes In % Committed Bytes In Use is the ratio of Memory:
Use Committed Bytes to Memory: Commit Limit.
(Committed memory is physical memory in use for
which space has been reserved in the paging file
should it need to be written to disk. The commit
limit is determined by the size of the paging file. If
the paging file is enlarged, the commit limit
increases, and the ratio is reduced). This counter
displays the current percentage value only; it is
not an average.
PERF.LOCALHOST.Memory.Page Faults/sec Page Faults/sec is the overall rate that faulted
pages are handled by the processor. It is measured
in numbers of pages faulted per second. A page
fault occurs when a process requires code or data
that is not in its working set (its space in physical
memory). This counter includes both hard faults
(those that require disk access) and soft faults
(where the faulted page is found elsewhere in
physical memory). Most processors can handle
large numbers of soft faults without consequence.
However, hard faults can cause significant delays.
This counter displays the difference between the
values observed in the last two samples, divided
by the duration of the sample interval.
PERF.LOCALHOST.Processor(0).% Processor Time % Processor Time is the percentage of time that
the processor is executing a non-Idle thread. This
counter was designed as a primary indicator of
processor activity. It is calculated by measuring
the time that the processor spends executing the
thread of the Idle process in each sample interval,
and subtracting that value from 100%. (Each
processor has an Idle thread, which consumes
cycles when no other threads are ready to run). It
can be viewed as the percentage of the sample
interval spent doing useful work. This counter
displays the average percentage of busy time
observed during the sample interval. It is
calculated by monitoring the time the service was
inactive, and then subtracting that value from
100%.
PERF.LOCALHOST.TCP.Segments Segments Retransmitted/sec is the rate at which
Retransmitted/sec segments are retransmitted, that is, segments
transmitted containing one or more previously
transmitted bytes.
PERF.LOCALHOST.TCP.Segments Sent/sec Segments Sent/sec is the rate at which segments
are sent, including those on current connections,
but excluding those containing only retransmitted
bytes.
Tag Description
PERF.LOCALHOST.Process(piarchss).% Processor % Processor Time is the percentage of elapsed
Time PERF.LOCALHOST.Process(pibasess).% time that all of the threads of this process used the
Processor Time processor to execute instructions. An instruction is
PERF.LOCALHOST.Process(pinetmgr).% Processor the basic unit of execution in a computer, a thread
Time PERF.LOCALHOST.Process(pisnapss).% is the object that executes instructions, and a
Processor Time process is the object created when a program is
run. Code executed to handle some hardware
interrupts and trap conditions are included in this
count. On Multi-processor machines the maximum
value of the counter is 100 % times the number of
processors.
PERF.LOCALHOST.PI Archive.Read Events Rate of archive events read.
operations/sec
PERF.LOCALHOST.PI Archive.Cache Record Disk Archive cache disk reads.
Reads/sec
PERF.LOCALHOST.PI Archive.Cache Record Archive cache memory hits.
Memory Reads/sec
PERF.LOCALHOST.PI Base Subsystem.Point Count Total number of defined points. This number
includes the Connector Point Count.
PERF.LOCALHOST.PI Network The number of connections to PI Network
Manager(_Total).Connections Manager. This counter only applies to instance
_Total.
PERF.LOCALHOST.PI Network The number of messages sent to PI Network
Manager(_Total).Messages Sent/sec Manager.
PERF.LOCALHOST.PI Network
Manager(piarchss).Messages Sent/sec
PERF.LOCALHOST.PI Network
Manager(pibasess).Messages Sent/sec
PERF.LOCALHOST.PI Network
Manager(pisnapss).Messages Sent/sec
PERF.LOCALHOST.PI Out of order events sent to the snapshot.
Snapshot.OutOfOrderSnapshots/sec
PERF.LOCALHOST.PI Snapshot.Queued Events/sec Events sent to the event queue.
PERF.LOCALHOST.PI Snapshot.Snapshots/sec Events sent to the snapshot.
PERF.LOCALHOST.PI Update-Manager.Pending Total Events pending in the PIUpdate Manager
events database.
PERF.LOCALHOST.CALCULATED.PI Compression PI Compression Ratio is a performance equation
Ratio that calculates amount of data that is compressed.
PERF.LOCALHOST.CALCULATED.PI Archive.Cache PI Archive.Cache Hit Rate is a performance
Hit Rate equation that measures the rate at which data is
accessed from memory as opposed to disk.
Attribute Description
Is Communicating Is the server communicating to the other members
of the collective?
Is Current Server Is the server the member of the collective sending
this information?
Is In Sync Is the server in sync with the other members of the
collective?
Last Communication Time Last time the server communicated with the
collective
Last Sync Record ID Last sync record processed
Last Sync Time Last time the server synchronized with the
collective
Role The role this server plays in a collective
Server Index The index of the server in the list of members of
the collective
Sync Period The frequency this server is configured to sync
with the collective
Sync Records/sec Sync records processed/sec
PI session statistics
Attribute Description
Bytes Received/sec The number of bytes received by the PI session.
Bytes Sent/sec The number of bytes sent by the PI session.
Messages Received/sec The number of messages received by the PI
session.
Messages Sent/sec The number of messages sent by the PI session.
Receive Errors The number of times an error occurs during a
receive a message by the PI session.
Send Errors The number of times an error occurs during a send
of a message by the PI session.
Attribute Description
Connector Snapshots/sec Rate at which events are sent to mapped points
through COM Connectors. This rate is NOT
included in the Snapshots/sec counter.
Connector Updates Elapsed Time Time elapsed in milliseconds for Updates for COM
Connector points.
Connector Updates/sec Update events received from COM Connectors.
This rate is NOT included in the Connector
GetSnapshots/sec counter.
Digital State Translations/sec Rate of digital strings translated into offsets.
Estimated Remaining Capacity Estimated maximum number of events with
current queue file.
Event Queue Page Shifts/sec Rate of data page shifts in primary queue file.
Event Queue Total Pages Number of data pages in primary queue file.
Event Queue Used Pages Number of full data pages in primary queue file.
Events in Overflow Queues Total of events in the overflow queue files.
Events in Primary Queue Number of events in the primary queue file.
GetSnapshot Calls/sec Rate of individual snapshot value calls.
GetSnapshots Calls/sec Rate of multiple snapshot values calls.
GetSnapshots/sec Rate at which events are read from the snapshot.
Number of Overflow Queues Number of overflow queue files (0 if only the
primary queue is active).
OutOfOrderSnapshots/sec Rate at which out-of-order events are sent to the
snapshot.
Primary Event Queue Id Identification number of primary queue (0 to
65,535).
Queued Events/sec Rate at which events are sent to the event queue.
Remove Snapshots/sec Rate of snapshot values being deleted.
Snapshots/sec Rate at which events are sent to the snapshot.
Attribute Description
Dot Variable Evaluations/sec Rate of "dot" variable evaluations made within the
PI SQL Library. A dot variable in SQL is a table alias
and column name, such as "picomp.tag. This rate
is a measure of PI SQL Subsystem processing not
related to obtaining data from other subsystems.
Handles Number of PI SQL handles currently allocated in PI
SQL Subsystem. This is an indication of how many
clients are actively processing SQL statements.
Next Point With Source Calls/sec Rate at which points are returned by PI Base
Subsystem in searches for points with a specific
PointSource attribute.
PostCalls/sec Rate of RPC calls made to PI Snapshot Subsystem
to post events from execution of SQL INSERT or
UPDATE statements.
PostEvents/sec Rate at which data events are posted to PI
Snapshot Subsystem from execution of SQL
INSERT or UPDATE statements.
SnapshotCalls/sec Rate of RPC calls made to PI Snapshot Subsystem
to obtain a single snapshot value.
SummaryArcValueCalls/sec Rate of RPC calls made to PI Archive Subsystem for
summarized values (such as average, total, and
standard deviation).
WHERE Clause Evaluations/sec Rate of full evaluations of the WHERE clause of a
SELECT statement.
WildcardPoints/sec Rate at which points are returned when
performing wildcard searches of the PI point
database.
WildcardSearches/sec Rate at which new wildcard searches are initiated
in the PI point database.
PI subsystem statistics
Attribute Description
Actual Pending Transactions Only for internal debugging purpose. You should
use it only under the suggestion of OSIsoft
Technical Support.
Avg. Message Execution Time This generic PI Subsystem counter applies to all
subsystems (one counter per instance). It reports
the average execution time, in milliseconds, of
incoming messages (RPC). This counter is the
average equivalent of the existing PI Subsystem
Statistics(INSTANCE)\Message Execution Time
counter. The existing counter tends to over or
under report the actual value because it is simply
the last value reported and suffers from sampling
problems. The average counter should more
accurately report the true message execution time.
Attribute Description
Avg. RPC Requests in Queue This generic PI Subsystem counter applies to all
subsystems (one counter per instance). It reports
the average number of RPCs in queue waiting to be
executed. A consistent and significant number of
RPC requests in queue indicate the subsystem is
saturated processing RPCs.
Attribute Description
Message Complete Time Total message handling time (including results
sending).
Message Execution Time Execution time of incoming message (RPC). See
also Avg. Message Execution Time.
Message Pickup Time Latency of incoming messages (time in message
queue).
Message Queue Length Number of incoming messages in queue.
Pending Transactions Number of pending transactions.
RPC Requests in Queue Number of pending RPCs in queue. See also AVg.
RPC Requests in Queue.
RPC Threads Active Number of RPC worker threads processing a
query.
RPC Threads Total Total number of RPC worker threads (query
processing).
Transaction Avg Time Average execution time of outgoing transactions.
Transaction Canceled/sec Number of transactions canceled per second.
Transaction Completed/sec Number of transactions completed per second.
Transaction Max Time Maximum execution time of outgoing transactions.
Attribute Description
Pending events Total Events pending for this consumer.
Update sign-ups Queued sign-ups for this consumer.
A PI SDK-based client will first publish its name. In this example the client name is AboutPI-
SDK.exe.
I 22-Sep-09 21:41:33 pinetmgr (7039)
>> Connection accepted: Process name: AboutPI-SDK.exe(4372):remote(4372)
ID: 31
The PI Data Archive server will then attempt to authenticate the client. That is, the client will
pass in certain credentials and the PI Data Archive server will accept or reject these
credentials. In this example the client successfully connects via Windows authentication:
I 22-Sep-09 21:41:33 pinetmgr (7082)
>> Successful login ID: 31. Address: 195.10.22.187. Name: AboutPI-
SDK.exe(4372):remote. Identity List: piadmins | PIWorld. Environment Username :
FABRIKAM\testuser. Method: Windows Login (SSPI,Kerberos)
If the client is unable to connect via one method, it may try another. Here it fails to connect via
Windows authentication but is able to connect via trust.
I 22-Sep-09 22:38:27 pinetmgr (7138)
>> Unsuccessful login ID: 35. Address: 195.10.22.187. Name: AboutPI-SDK.exe(43
72):remote. Credentials used: FABRIKAM\testuser. Method: Windows Login
(SSPI,Kerbero
s). Error: [-10433] No identity mapping for this request
I 22-Sep-09 22:38:27 pinetmgr (7076)
>> Successful login ID: 35. Address: 195.10.22.187. Host: . Name: AboutPI-SDK.e
xe(4372):remote. User: piadmin. OSUser: . Trust: addertrust
The server administrator has the option to disable certain authentication methods. In this
example explicit logins have been disabled. The message will look like this:
I 23-Sep-09 12:52:35 pinetmgr (7138)
>> Unsuccessful login ID: 44. Address: 195.10.22.187. Name: AboutPI-SDK.exe(50
The PI Data Archive server then attempts to use the credentials of the incoming connection to
locate a record in the PI trust database. If a match is found, the following message is written
(For PI API-based clients the published application name is truncated. The name is a five-
character name: four characters plus a capital "E". In this example, the client name is RandE):
I 22-Sep-09 21:04:01 pinetmgr (7053)
>> New Pinet 1 connection: RandE Successful Trust-Relation login:
adder2k3_32_1.osisoft.int|127.0.0.1|RandE piadmin.
If a match is not found, the messages are:
I 22-Sep-09 21:53:40 pinetmgr (7054)
>> New Pinet 1 connection: RandE No Trust established for: adder.osisoft.int|19
2.168.5.137|RandE. Explicit login is required for access.
I 22-Sep-09 21:53:42 pinetmgr (7077)
>> Access Denied: [-10413] No trust relation for this request ID: 32. Address
: 195.10.22.187. Host: . Name: RandE. User: . OSUser: . Trust:
When pinetmgr receives notification of new RPCs, it updates the master list, and then sends
the updated list to all PIsubsystems. When a subsystem receives this updated master RPC list,
it writes the following message. At this point, the subsystem is ready to process remote
procedure calls:
0 piupdmgr 27-Oct-05 16:23:27
>> Rpcservertablelist successfully registered to pinetmgr.
If pinetmgr is unable to send the updated list to the new subsystem, it writes a message as
follows:
0 pinetmgr 27-Oct-05 16:32:22
>> Error sending client table(2) to: piupdmgr
A successfully connected subsystem may write messages indicating its initialization progress.
In general, there is no message written when initialization is complete and the subsystem is
ready to process RPC calls.
Disconnect messages
pinetmgr writes messages to the PI message log that track communications between PI
clients and the PI Data Archive server.
The following example show messages from pinetmgr indicating a PI-SDK application
(AboutPI-SDK.exe) is disconnecting from the PI Data Archive server:
I 03-Aug-10 06:47:21 pinetmgr (7096)
>> Deleting connection: AboutPI-SDK.exe(7196), Shutdown request received from
AboutPI-SDK.exe(7196), ID: 39 :0
The following example show messages from pinetmgr indicating a PI-API application
(Random Interface) is disconnecting from the PI Data Archive server:
I 03-Aug-10 10:26:25 pinetmgr (7113)
>> Deleting connection: RandE, A request to abort a connection was received.
Check previous messages for more details. [-10721] PINET: Client Aborted
Connection., ID: 30 ::1:54920
Sometimes when applications exit without properly terminating their connection to the PI
Data Archive server, pinetmgr can report the following:
I 03-Aug-10 10:25:23 pinetmgr (7121)
>> Deleting connection: RandE, Asynch read failed. [64] The specified network
name is no longer available., ID: 43 ::1:53559
FABRIKAM\FABRIKAM
If an RPC is made to a subsystem that is marked off-line, the following message is generated.
[-10733] PINET: RPC Resolver is Off-Line
The following message indicates that the first part of a message was retrieved. This contains
the message length. The pinetmgr attempted to retrieve the rest of the message but a timeout
occurred.
>> Deleting connection: pisnapss, Connection lost(1),
[-10731] PINET: incomplete message
134