PI Server System Management Guide
PI Server System Management Guide
Version 3.4.380
OSIsoft, LLC International Offices
777 Davis St., Suite 250
San Leandro, CA 94577 USA OSIsoft Australia
Perth, Australia
Additional Offices
OSIsoft Germ any Gm bH
Houston, TX
Johnson City, TN Altenstadt, Ger many
Longview , TX OSIsoft Asia Pte Ltd.
Mayfield Heights, OH Singapore
Philadelphia, PA
OSIsoft Canada ULC
Phoenix, AZ
Savannah, GA Montreal, Canada
Calgary, Canada
Sales Outlets/Distributors OSIsoft, LLC Representative Office
Middle East/North Africa Shanghai, People’s Republic of China
Republic of South Africa OSIsoft Japan KK
Russia/Central Asia
South America/Car ibbean Tokyo, Japan
Southeast Asia OSIsoft Mexico S. De R.L. De C.V.
South Korea Taiw an Mexico City, Mexico
OSIsoft do Brasil Sistem as Ltda.
Sao Paulo, Brazil
OSIsoft, the OSIsoft logo and logotype, PI Analytics, PI ProcessBook, PI DataLink, ProcessPoint, Sigmafine, Analysis Framework, IT
Monitor, MCN Health Monitor, PI System, PI ActiveView, PI ACE, PI AlarmView, PI BatchView, PI Data Services, PI Manual Logger, PI
ProfileView, PI WebParts, ProTRAQ, RLINK, RtAnalytics, RtBaseline, RtPortal, RtPM, RtReports and RtWebParts are all trademarks of
OSIsoft, LLC. All other trademarks or trade names used herein are the property of their respective owners.
Manage Points............................................................................................................. 23
PI Point Classes and Attributes ........................................................................... 23
Exception Reporting and Compression Testing...................................................... 43
Change PI Point Type........................................................................................ 48
Create, Delete, or Edit PI Point Classes and Attribute Sets...................................... 51
Digital State Sets .............................................................................................. 65
Manage Archives......................................................................................................... 69
About Archives ................................................................................................. 69
Create a New Archive in SMT............................................................................. 74
Register and Unregister Archives ........................................................................ 78
Edit Archives .................................................................................................... 79
Delete an Archive ............................................................................................. 80
Display an Unregistered Archive ......................................................................... 80
Make Writeable/Read-only ................................................................................. 80
Move an Archive ............................................................................................... 80
Backup Archives ............................................................................................... 81
Note on Digital State Reprocessing ..................................................................... 81
Manage Archive Shifts ....................................................................................... 82
Backfilling Data................................................................................................. 83
Manage Archives of an Offline PI Server (piarchss)................................................ 85
List Archive Record Details (Archive Walk) ........................................................... 90
iv
On-site service ................................................................................................235
Knowledge Center ...........................................................................................235
Upgrades........................................................................................................235
Index .........................................................................................................................237
Note: PI Server 3.4.380 allows you to manage your PI Server authentication through
Windows and Microsoft Active Directory (AD). This model improves PI Server
security, reduces your management workload, and provides users a single-sign on
experience. PI Server 3.4.380 also continues to support previous PI Server
security mechanisms.
In addition to the PI directory, the PI Server installation creates the pipc directory, if it does
not exist. The pipc directory is actually created when you install the PI SDK, which is
included in the PI Server installation. The pipc directory contains files for the PI SDK, for
bundled PI Interfaces, and for a variety of other tools and utilities, including PI SMT, the
Collective Manager, and the ICU.
PI Server Subsystems
The PI Server Subsystems are a set of several interdependent processes, referred to as
subsystems. Some subsystems depend on other subsystems for proper behavior. All
subsystems wait at startup for any dependent subsystems. The executable for each of the PI
subsystems is installed in the PI\bin directory.
2
PI Server Subsystems
Generally, the PI Server requires seven core subsystems to function to a minimum level:
Subsystem Executable Purpose Dependencies
Archive piarchss.exe Stores and serves the data after it Snapshot Subsystem,
comes out of the Snapshot Update Manager, and
Subsystem. Data consists of License Manager
multiple time-stamped
measurements for each data
point. Values represent on/off,
pressures, flows, temperatures,
setpoints, and so on.
Base pibasess.exe Maintains the Point Database, Update Manager and
Digital State Table, and License Manager
configuration databases for
authentication. Hosts the PI
Module Database.
License pilicmgr.exe Maintains license infor mation for
Manager the PI Server and all connected
applications.
Message pimsgss.exe Records status and error Messages are routed to
messages for the PI Server in a the Windows Event log
log file. if this subsystem is not
available
Netw ork pinetmgr.exe Manages communication
Manager betw een PI Server subsystems,
interfaces and client applications.
Also validates clients at time of
connection. Clients may be
standard products such as PI
Pr ocessBook, or they may be
custom PI A PI or PI SDK
programs.
Snapshot pisnapss.exe Stores the most recent event for Update Manager and
each point, applies compression, License Manager
sends data to the Event Queue,
serves Snapshot events, and
sends updates for client
applications to the Update
Manager.
Update piupdmgr.exe Queues notifications of changes Essential for proper
Manager in data values, point attributes, operation of a PI
modules, and so on to any Server; it is required by
interface or client application that most of the PI
is signed up for notification. Subsystems and most
client applications
In addition to the core PI Subsystems, the PI Server includes additional subsystems that are
not essential to run the PI Server. Some of these subsystems are licensed separately and might
not be installed on your PI Server:
Subsystem Executable Purpose
*
indicates a separately licensed subsystem
OSIsoft recommends that you do not Windows File System Compression. Although
compression may save disk space, it requires more CPU resources each time data arrives at
the Archive and clients access database files.
You can slow access to Archive files and degrade performance of the entire PI System if you
use compressed files. This is especially true for files that change constantly, such as the
primary Archive and Event Queue files, and the current message log file.
4
Time Specifications and Considerations
OSIsoft recommends that you configure anti-virus software on production systems to exclude
scans of the PI\dat directory and any directories containing PI Server database and Archive
files. The PI\dat directory does not contain any executable programs or scripts.
Anti-virus software immediately scans files with contents that change. The contents of the PI
Server Archive files change constantly as Archive cache records are regularly flushed from
memory to disk. Archive files tend to be large, and thus the time required to scan can be quite
long. In addition, if any random bit pattern in an Archive file happens to match a known virus
signature, the anti-virus software can lock or otherwise quarantine the Archive file. Such a
corruption of the Archive file system would result in the unrecoverable loss of production
data. The same situation can occur for other PI Server database files.
Note: Archive timestamps in PI Server are stored as the number of seconds past
January 1, 1970. Two-digit years from 00 through 69 are interpreted as 21st
century. Two-digit years from 70 through 99 are interpreted as the 20th century
(1900s). For example, 70 translates to 1970; 00 translates to 2000; and 37
translates to 2037.
PI Time Format
Many PI System utilities prompt for a date and time. The PI time formats are:
• Relative
• Absolute
• Combined
Absolute Time
Absolute times have one of the following formats:
Form at Description/Notes
DD- MMM-YY hh:mm:ss.ssss day-month-year hour:minute:second. If any of the date fields
are left out, they default to the current date. Time fields
default to 00.
* current time
T 00:00:00 on the current day ( TODAY)
Y 00:00:00 on the previous day (YESTERDAY)
Monday 00:00:00 on the most recent Monday
Sun,Mon,Tue,Wed,Thu,Fr i,Sat 00:00:00 on the most recent Sunday, Monday, ..., Saturday
You can specify a time zone in an absolute time string (Specifying Time Zones (page 9)). You
do not typically need to include a time zone in an absolute time because the PI Server can
determine the correct time zone. In this manual, a time string that does not specify a time
zone is called an unqualified time string. You should be aware of how the PI Server interprets
unqualified time strings during Daylight Savings Time (Daylight Savings Time
Considerations (page 8)).
The following tables show examples of absolute time strings.
Exam ple Description
25 00:00:00 on the 25th of the current month
25-Aug-86 00:00:00 on that date
8: 08:00:00 on the current date
25 8 08:00:00 on the 25th of the current month
21:30:01.02 9:30:01.0200 PM on the current date
Use caution with the default settings. Here are some examples of timestamps that may be
confusing.
8: 08:00:00 on the current date
:8 08:00:00 on the current date
::8 00:08:00 on the current date
The confusion comes from the ambiguity in the first two examples above. Following this
theme, when minutes are added to the next examples, the time stamps are still similar.
8:01 08:01:00 on the current date
:8:01 08:01:00 on the current date
6
Time Specifications and Considerations
The difference in the two notations is evident when a date is added to the time. When a date
is added to the front of the time the default notation is hh:mm:ss.ssss not :hh:mm:ss.ssss.
2 8: 08:00:00 on the 2nd of the current month
2 :8 00:08:00 on the 2nd of the current month
If extra colons and times are added that is greater than the given DD-MMM-YY
hh:mm:ss.ssss format the last part of the time is disregarded.
2 :::8 00:00:00 on the 2nd of the current month
2 8:01:30 08:01:30 on the 2nd of the current month
A value for the seconds must be used if sub-seconds are used. Hence use caution when
considering timestamps containing sub-seconds.
8::30.01 08:00:30.0100 on the current date
Relative Time
Relative time is some number of days, hours, minutes, or seconds. The leading sign (+ or -)
is required.
+/- d | h | m | s
The default starting point for relative time is usually the current time. Therefore, a time of -8h
is eight hours before the current time. Fractional times may be entered. For example, use -
1.5d for one and one-half days. Only a single operator is supported, + or -. For example, this
is not supported:
-1d+1h
Combined Formats
Combined time scales use both an absolute and a relative time. The absolute part of the time
can be *, T, Y, or a day of the week. The following table shows examples.
Exam ple Description
For time zones that observe daylight savings time, there is a period (typically one hour) per
year in which an unqualified absolute time string is ambiguous. (An unqualified absolute time
string is a time string in which the time zone is not specified.) This always occurs during the
last hour of daylight savings time before the beginning of standard time. In the Northern
Hemisphere, this occurs in the fall. In the Southern Hemisphere, this occurs in the spring. The
above time string of 25-Oct-98 01:30 in North America is an example. PI cannot
determine from this time string alone whether standard time or daylight savings time is
intended.
If the unqualified time is passed, PI uses the current time to resolve the ambiguity. This
means that 25-Oct-98 01:30 is considered daylight savings if the translation takes place
before 25-Oct-98 02:00:00 Pacific Daylight Time, and is considered
standard time otherwise. If this is not your intent, suffix your time string with the appropriate
time zone name.
8
Time Specifications and Considerations
Time Zone Information and Day Light Saving Time Transition Rules
Without the optional TZ parameter, pidiag -tz displays the time zone information and
Daylight Saving Time (DST) transition rules that are being used by the PI server. If the file
PI\dat\localhost.tz is resent and valid, then the time zone information is from the
file. Otherwise, the information is from the operating system.
C:\PI\adm>pidiag -tz
# Time Zone name:
Eastern Time
# TZ environment variable: <not set>
# Bias (offset) from UTC (TAI) time:
18000
# January is standard / Northern hemisphere:
1
# Standard Time Name:
Eastern Standard Time
EST
# Daylight Time Name:
Eastern Daylight Time
EDT
# StartYear, EndYear, Month, Week, Day, Time, Offset
1970, 1973, 4, 5, 1, 7200, -3600
1974, 1974, 1, -1, 6, 7200, -3600
1975, 1975, 2, -1, 23, 7200, -3600
1976, 1986, 4, 5, 1, 7200, -3600
1987, 2006, 4, 1, 1, 7200, -3600
2007, 2037, 3, 2, 1, 7200, -3600
1970, 2006, 10, 5, 1, 7200, 0
2007, 2037, 11, 1, 1, 7200, 0
A StartYear, EndYear, Month, Week, Day, Time, and Offset define the daylight and standard
time trans ition rules.
The transition rules are:
• StartYear is the first year that the rule is in effect
• EndYear is the last year that the rule is in effect
• Month is the month (1-12) that the rule is applied.
• Week is the week (1-5) that the rule is applied. If Week is 5 and there are only four weeks
in the month, then 5 designates the last week in the month. If Week is -1, then Week is
ignored and day becomes absolute.
• If Week is greater than 0, then Day is the relative day (1-7) that the rule is applied. A Day
of 1 represents Sunday, a Day of 2 represents Monday, and so on. For example, a Week
of 1 and a Day of 1 means the first Sunday in April. If Week is -1, then Day is an absolute
day (1-31).
• Time is the time in seconds after midnight that the rule is applied.
• Offset is the time in seconds to subtract from standard time to get the local time. For
example, when daylight saving time is in effect, -3600 is subtracted from standard time.
10
Time Specifications and Considerations
If your time zone does not observe daylight savings time, the output indicates this.
C:\PI\adm> pidiag -tz
TZ environment variable: <not set>
Standard Time Name: US Mountain Standard Time (UMST)
Daylight Savings Time: <not observed>
See Adjust Standard and Daylight Savings Times (page 12) to change this setting.
Display options
The -check option generates no output at all, unless the time zone settings on your system are
invalid.
The -dump option dumps the whole time zone table. This includes fall/spring changes in
every year. The dump is in comma-separated variable (CSV) format and can be loaded
directly into a spreadsheet, if all time-change information for the local time zone.
The -dump option can be combined with -brief. The output with this option includes the year
and spring and fall time changes, each marked with D or S to denote daylight or standard
time.
The -full option can be used to display additional information about the localhost.tz
file, such as the file’s UID, creator, creation time, and so on. The information is valid only if
localhost.tz was successfully loaded by the PI server.
12
Time Specifications and Considerations
C:\PI\adm>pidiag -t t+1h
21-Oct-98 01:00:00 PDT - Local: 908931600 UTC: 908956800
C:\PI\adm>pidiag -t "*"
21-Oct-98 20:00:10 PDT - Local: 909000010 UTC: 909025210
C:\PI\adm>pidiag -t 0909025210 U
21-Oct-98 20:00:10 PDT - Local: 909000010 UTC: 909025210
Offsets, as a function of time, are defined in the time conversion file. This can be used to
apply corrections to times on some systems that had incorrect timestamps due to run-time
library problems, or non-standard DST setting.
This adds a given time offset to every event:
-tfix conversion_file
14
Time Specifications and Considerations
828871200,-57600
846403200,-61200
860320800,-57600
Note: If you use Microsoft clusters, always use the Microsoft Windows Cluster
Administrator to start and stop the PI Server. Do not start and stop PI Server with
the SMT PI Services tool or with the command-line scripts.
Note: If you use Microsoft clusters, do not use pisrvstart.bat, or PI Server Management
Tools (SMT) to stop the PI Server. Use the Microsoft Windows Cluster
Administrator instead.
Verify Startup
The PI Subsystems may take several minutes to start. The PI Subsystems that must start up
before interfaces and other applications can connect to the PI Server are Archive, Base,
License Manager, Network Manager, Snapshot, and Update Manager. When these
subsystems are ready to service requests, the TCP/IP listener is opened.
To verify that the PI Server has started, you can:
1. Determine that the PI Server port is open:
netstat -an
2. Or, review the PI Server log for the following message:
>> TCP/IP connection listener opened on port: 5450
Connection attempts will fail if the port is not open. Most interfaces and client applications
will retry automatically until a connection is established.
For troubleshooting purposes, you can start the PI Server interactively. Do this only if you
need to monitor, test, or troubleshoot the PI Server.
To start PI Server interactively:
1. Log on to a Windows account that has full access to the PI Server files and permission to
start PI services.
2. Open a Command Prompt window.
3. Change to the PI\adm directory and type:
pistart.bat [-nosite] [–stdout] [–base]
To run the server without starting the interfaces and other site-specific programs, use the
optional nosite parameter. To prevent the PI Message Subsystem from being started, use the
optional stdout parameter; all messages will be sent to the standard output instead of the PI
Server message log.
18
Stop the PI Server
If you are troubleshooting and want to start only the core PI Server subsystems, use the
optional base parameter. When you use this parameter, these subsystems will start in the
following order: Network Manager, Base, Message, License Manager, Snapshot, Archive,
Backup, and Update Manager.
Note: Some Windows interfaces cannot be run as services. Refer to the interface
documentation for details.
Note: If you use Microsoft clusters, do not use pisrvstop.bat, or PI Server Management
Tools (SMT) to stop the PI Server. Use the Microsoft Windows Cluster
Administrator instead.
Stop Services
Note: If you plan to completely start or stop a PI Server, it is important that you use the
startup and shutdown scripts; these files will start or stop services in the order
required by system dependencies.
Windows has a registry entry that defines the maximum wait time for a service to exit. On PI
Servers with large point counts, the maximum wait may need to be increased to allow the
services enough time to shut down properly. The PI Server installer sets the default value to
300,000 milliseconds, or 5 minutes. This is generally enough time for proper shutdown on
systems with fewer than 50,000 points. Larger servers may require more time.
Failing to allow proper shutdown of the PI Server can result in lost data or corrupted data
files.
To determine if a longer wait time for shutdown is required:
1. Use pisrvstop.bat to stop the PI Server (page 19).
2. Record the time it takes the PI Server to shutdown.
3. If it takes more than 5 minutes for the server to shutdown, check the registry entry:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\WaitToKillSer
viceTimeout
If necessary, edit the WaitToKillServiceTimeout parameter to equal the time
required for shutdown.
To shut down a PI Server that was started in interactive mode, type Ctrl+C in each of the
Command Prompt windows corresponding to the PI processes. You should shut down these
processes in the following order:
1. Utilities (such as piconfig)
2. Interfaces (such as RampSoak and Random)
3. pinetmgr (When you instruct pinetmgr to stop, the remaining processes are told to exit
in the proper order and, finally, pinetmgr stops.)
Note: If you plan to completely start or stop a PI Server, it is important that you use the
startup and shutdown scripts; these files will start or stop services in the order
required by system dependencies.
20
Shutdow n Events
Note: This procedure should not be done on a Microsoft Cluster. Use the Microsoft
Windows Cluster Administrator instead.
Note: This procedure should not be done on a Microsoft Cluster. Use the Microsoft
Windows Cluster Administrator instead.
Shutdown Events
PI Points have a configurable attribute to determine whether shutdown events are written.
The timestamp of the shutdown event normally represents the actual shutdown time of the PI
Server as recorded by the Snapshot Subsystem. If the PI Server is shutdown ungracefully, this
timestamp will be accurate to within 15 minutes by default.
The Shutdown attribute has two possible values: 1 (On) and 0 (Off). If the shutdown attribute
of a point is set to 1, the Shutdown Subsystem writes a shutdown event if the PI Server shuts
down. Beginning with PI Server PR1 SP1, unless you configure points to receive shutdown
events, only test points such as sinusoid and sinusoidu will receive shutdown events.
For details, see Set Shutdown Events for Specific Points.
OSIsoft recommends using the default setting of 0 (Off) for points collected by remote
interfaces that are configured for buffering or PI High Availability (PI HA). The reason: if
you run remote interfaces with buffering or PI Collectives, shutdown events are not an
accurate indicator of data loss when a PI Server is shut down.
With properly configured buffering, data will simply be queued up for a PI Server while it is
shut down, provided the remote interfaces continue running. Also, if a PI Server is part of a
collective, shutting down one member has no effect on the other members' ability to continue
receiving and serving data.
Note: OSIsoft recommends that you do not run interfaces on the same machine as the
PI Server; however, if you do use such a configuration, these local interfaces
should be configured for shutdown events. Unlike most PI subsystems, the
Shutdown Subsystem exits after completion, except when running on Microsoft
Clusters.
Points that receive shutdown events are specified in the file PI\dat\shutdown.dat.
Note: If you have a new installation of PI Server version 3.4.375.38 (PR1) or later, the
default configuration of shutdown.dat targets only points with a point source of
R and a shutdown attribute set to 1. If you upgrade to PI Server 3.4.375.38 (PR1)
or later, the installer will not change the configuration of shutdown.dat.
You may edit shutdown.dat to restrict shutdown events to certain groups of tags. To
specify more than one tag name use a tag mask. Use the wildcards * and ?. An asterisk (*)
matches all possibilities with any number of characters. The question mark (?) matches a
single character and may be used any number of times.
You can use other point attributes and values in addition to, or instead of, the shutdown flag.
All conditions are logically ANDed together. If no point attributes are specified, all tags
specified by the tag mask are selected to receive shutdown events.
For example, this configuration file entry selects only tags that start with s, have the location1
attribute set to 0, and the point source set to H. No other tags receive shutdown events:
! tag mask
s*
! point attributes
location1,0
pointsource,H
22
Chapter 3
Manage Points
The Introduction to PI Server System Management provides the basics on working with PI
Points. This chapter does not repeat the information provided there. However, it does discuss
the following additional topics in detail:
• PI Point Classes and Attributes (page 23)
• Exception Reporting and Compression Testing (page 43)
• Change PI Point Type (page 48)
• Create, Delete, or Edit PI Point Classes and Attribute Sets (page 51)
• Digital State Sets (page 65)
You can create point classes and attribute sets. You can also edit and delete both attribute sets
and point classes (PI Server version 3.4.370 and later) although this poses risks and it is rare
that you should need to do so.
Alarm base
alar mparam
Base base
Classic base
classic
SQC_Alarm base
sqcalm_parameters
Totalizer base
totals
24
PI Point Classes and Attributes
alarmparam
Attribute Type Default
action1 String
action2 String
action3 String
action4 String
action5 String
AutoAck String yes
ControlAlg String
ControlTag String
Deadband Float32 0
Options String
ReferenceTag String
Srcptid Int32 0
test1 String
test2 String
test3 String
test4 String
test5 String
txt1 String
txt2 String
txt3 String
txt4 String
txt5 String
base
Attribute Type Default
Archiving BYTE 1
Changedate TimeStamp 31-Dec-69 16:00:00
Changer Uint32 for 3.4.380 0
and later
(Uint16 for earlier
versions)
Com pdev Float32 2.
Com pm ax Uint32 28800
Com pm in Uint16 0
Com pressing BYTE 1
Creationdate TimeStamp 31-Dec-69 16:00:00
Creator Uint32 for 3.4.380 0
and later
(Uint16 for earlier
versions)
Descriptor String
DisplayDigits BYTE -5
EngUnits String
Excdev Float32 1.
ExcMax Uint32 600
ExcMin Uint16 0
ExDesc String
PointSource String Lab
PointType UBYTE 12
Scan BYTE 1
Shutdow n BYTE 1
Span Float32 100.
Step BYTE 0
TypicalValue Float32 50.
Zero Float32 0.
26
PI Point Classes and Attributes
classic
Attribute Type Default
Convers Float32 1.
Filtercode Int16 0
Instrum entTag String
location1 Int32 0
location2 Int32 0
location3 Int32 0
location4 Int32 0
location5 Int32 0
Squareroot Int16 0
Srcptid Int32 0
Totalcode Int16 0
userint1 Int32 0
userint2 Int32 0
userreal1 Float32 0.
userreal2 Float32 0.
sqcalm_parameters
Attribute Type Default
AutoAck String yes
ChartType Int32 0
ClearOnLim itChange String true
ClearOnStart String false
CLTag String
CommentTag String
LCLTag String
LSLTag String
Mixture String
OneSideofCL String
Options String
OutsideControl String
OutsideOneSigm a String
OutsideTwoSigm a String
PIProductLim its String no
ProductTag String
ReferenceTag String
ResetTag String
SQCAlarm Priority Int32 0
Srcptid Int32 0
Stratification String
TestStatusTag String
Trend String
UCLTag String
USLTag String
WaitOnLim itChange String false
28
PI Point Classes and Attributes
totals
Attribute Type Default
Conversion Float32 1
EventExpr String
FilterExpr String
MovingCount Int16 2
Options String
PctGood Float32 85
Srcptid Int32 0
Zerobias Float32 0
The Base class is a common set of attributes that all other point classes include. Some of
these attributes can be changed only by the system. These attributes are described in System-
Assigned Attributes (page 42).
Archiving
The Archiving flag mus t be set to ON (1) for a point to be archived. This flag can be set to
OFF (0) to stop archiving of a point.
Compressing Flag
Compression should be turned on for all real-time points in the system. Set compression OFF
for laboratory and manually entered tags so every value is recorded in the Archive. Even with
compression turned off, the number of events for these tags is usually small.
To turn compression on, set the Compressing attribute should be set to ON (1) for most
points. With compression off, every value sent to the Snapshot is saved in the Archive.
Compression affects digital points, since a new value is recorded only when the current value
changes. Points of types Blob and string have a similar behavior; new events pass
compression only when the value changes. String values are compared ignoring case.
(VaLuE and valUe are equal) For Blob events, any change is significant.
30
PI Point Classes and Attributes
Descriptor
The Descriptor is a text field that appears on various client application displays and can be
used in reports. It can be of any length up to 65,535 characters. When this value is read
through the PI API it is truncated to 26 characters.
Some interfaces use the descriptor for tag configuration on external system. Having quotes or
wild card characters might lead to confusion when these attributes are passed to other
applications.
DigitalSet
Only digital type tags use the DigitalSet attribute. It is ignored for any other type.
A collection of digital states is called a digital state set. For example, a digital state set can
consist of two states, OPEN and CLOSED. You might also define a digital state set that
consists of {RED, GREEN, BLUE, YELLOW, and ORANGE}. Typically there are many
digital state sets defined for a system.
For digital points, the DigitalSet attribute specifies the name of the digital state set associated
with the tag. All tags are associated with the system state set. The system state set contains a
collection of all the states that may be used for any point. Examples are Shutdown, Over
Range, and I/O Timeout.
DisplayDigits
The DisplayDigits attribute controls the format of numeric values on screens and in reports.
Zero or a positive number indicates the number of digits to display to the right of the decimal
point. A negative number indicates the number of significant digits to display. In this case,
the absolute value of DisplayDigits is the number of significant digits.
The following table shows how a value of 23.45 would appear on the screen for different
values of DisplayDigits:
DisplayDigits Form at
3 23.450
2 23.45
1 23.5
0 23
-1 2E+001
-2 23
-4 23.45
EngUnits
The Engineering Unit string describes the units of the measurement. You may use any
string, and the string may be of any length. However, the PI API retrieves only the first 12
characters. The PI SDK does not truncate the string.
Examples include:
DEGF
Degrees Centigrade
Gal/Min
Gallons Per Minute
'"Hg
Engineering Unit strings are case preserving, but not case sensitive on search. The system
trims leading and trailing blanks are trimmed during input.
ExDesc
The extended descriptor is a text field of any length (although it is truncated to 80 characters
when reported through PI API). For most points, it is used only to provide additional
information for documentation. Several interfaces use the ExDesc attribute to encode
additional configuration information.
NewTag
The NewTag attribute is used for renaming tags.
Point Security
You can independently configure security for point attributes and point data. Use the Point
Security and Data Security attributes respectively (older versions of some client tools refer
to these as the Point Access and Data Access attributes).
Setting the values of security attributes is different for PI Server 3.4.380 and later than it is
for earlier versions of the PI Server. On PI Server versions 3.4.380 and later, you can set
point security access permissions for any PI Identities, PI Users, and PI Groups. Earlier
versions of the PI Server use the owner/group model.
32
PI Point Classes and Attributes
In the owner/group model, you define an owner and a group for each security attribute. The
owner must be a PI User and the group must be a PI Group. You then set access permissions
for owner and for group, as well as world access.
See the Configuring PI Server Security for complete details on security.
PointSource
The PointSource attribut e is a string that associates a tag with an interface or PI application.
An interface uses the point source to retrieve all its points.
The default point source is Lab. Use this for points that are not associated with any interface
to specify lab-input points.
Avoid using the % (percent) character as a point source, as it has also special meaning for
SQL and other applications. Similarly, avoid using ? or * as point source characters.
PointType
There are many point types in the PI Server. PointType is assigned when the point is created.
Prior to PI Server version 3.4.370, this attribute could not be changed, but in versions 3.4.370
or later it can be edited. For details, see PI Point Class Edit (page 51).
Point Type Used for
Digital Points w hose value can only be one of several discrete states, such as ON/OFF or
Red/Green/Yellow . Nearest equivalent to the PI Server 2.x Digital type.
Int16 Points w hose values are 15-bit unsigned integers (0 to 32767). Nearest equivalent to
the PI 2.x Integer type.
Int32 Points w hose values are 32-bit signed integers (-2147450880 to 2147483647). PI
reserves the low est 32K values of the 32bit range for digital states.
Float16 Floating point values, scaled. The accuracy is one part in 32767. Nearest equivalent
to the PI 2.x Real type.
Float32 Single-precis ion floating-point values, not scaled.
Float64 Double-precision floating-point values, not scaled.
String Storing string data of up to 976 characters.
Blob Storing any type of binary data up to 976 bytes.
Timestamp Storing values of type Timestamp. Any Time/Date in the Range 1-jan-1970 to 1-Jan-
2038.
The higher precision point types require more disk space for each stored value. Float16 points
use 16 bits or 2 bytes per value. Float32 and float64 use 4 and 8 bytes per value,
respectively. Int16 and int32 values use 2 and 4 bytes, respectively. Int16 is similar to a PI 2
integer type; it supports only 15-bit unsigned integers.
If you want to store negative integers, select the int32 point type. Note that PI reserves some
values in the negative range of a 32-bit integer. The smallest value that can be stored is
shown in the table above.
Interface manuals sometimes refer to point types R (real), I (integer), and D (digital).
• Use float16 or float32 for type R. If the data is coming from an analog-to-digital
converter (ADC), float16 is sufficient
• Use int16 or int32 for type I or integer values
• Use digital for type D or discrete values
PtClassName
The point class must be defined before the point is created. PtClassName specifies the point
class. Prior to PI Server 3.4.370, the point class of a point could not be changed once the
point was created. In versions 3.4.370 or later, it can be edited. For details, see PI Point Class
Edit (page 51).
Scan Flag
Some interface programs use a Scan flag. Interfaces that honor this attribute do not update
points whose scan flag is set to OFF. See the documentation to find out if your interface
program uses it.
34
PI Point Classes and Attributes
Shutdown Flag
In some cases it is useful to record, to PI points, when the Archive was shut down. That way
there is a clear indication of a gap in the data collection. Points may be configured so that PI
Server automatically records a time-stamped event to indicate when a shutdown occurs.
These are called shutdown events.
The shutdown flag for a point is set to ON (1) to indicate that shutdown events should be
recorded for this tag. The default is ON.
For points collected from interfaces on distributed collection nodes, set this flag to OFF (0)
because data buffering in PINet or PI API retains the data until the home node is running
again. Therefore, there are no data gaps to identify with shutdown events.
Many sites configure points that store laboratory test values so that the lab test points do not
receive shutdown events. Lab values are assumed to be constant between tests. Inserting
shutdown events for these points can be misleading.
The shutdown flag is used in conjunction with the configuration file dat\shutdown.dat.
SourceTag
For data output to other systems, the SourceTag is the PI tag of the data source. For example,
you can define a tag ABC to receive data using point source A, and then define another tag
DEF to send this information to another instrument system using point source B. The source
tag for tag DEF would be ABC. This attribute is used by some interfaces, while other
interfaces use the extended descriptor (ExDesc) for this information.
The SourceTag attribute is not stored in the Point Database. It is only a more readable
representation of the srcptid attribute which holds the source point ID. srcptid does not exist
in all point classes. For example, it is part of the classic point class but not of base.
Span
The Span is the difference between the top of the range and the bottom of the range. It is
required for all numeric data type points.
For float16 point types, the Span is used with the Zero for scaling values in the Archive. The
Span must be a positive value. If the value for a point type float16 point is greater than the
top of range, it is recorded in the Archive as Over Range. For other point types, Zero and
Span do not affect the values recorded in the Archive.
The Span is also used when defining a PI ProcessBook trend with a vertical scale of
database.
This attribut e is not used for non-numeric points.
The Span for a tag can be changed without affecting data already in the Archive. For points
of type float16, the old Span is used for retrieving the Archive data collected before the edit.
The new Span is used for data collected after the edit. When Span is changed, the exception
and compression deviation percents are preserved. This means that the ExcDev and
CompDev fields, which are expressed in engineering units, are modified internally. If any of
the deviation fields is specified in the editing operation they take precedence.
Note: Some interfaces might use Span information to filter incoming data. These
interfaces often convert out- of-range data to digital states over range and under
range. However, interfaces might use Span configuration in other ways. The PI
Server itself does not change out of range data except for tags of type float16.
Step
The Step flag affects only numeric points. It defines how numeric archived values are
interpolated. The default behavior, step OFF (0), treats archived values as a continuous
signal. Adjacent archived values are linearly interpolated. For example, at 12:00:00, the value
101.0 is archived and at 12:01:00, the value 102.0 is archived. A request for the archive value
at 12:00:30 would return 101.5.
A step flag of ON (1) treats the archived values discretely. Adjacent archived values are not
interpolated; an archived value is assumed constant until the next archived value.
For example:
• At 12:00:00, the value 101.0 is archived
• At 12:01:00, the value 102.0 is archived
• A request for the value at 12:00:30 would return 101.0
Note: For points with non-numeric type (digital, string, and timestamp) set the Step
attribute to ON (1). Some plotting algorithms in user applications use the step
attribute to determine trend behavior. Setting Step to ON (1) prevents any
confusion about interpolating non-numeric values.
In general, data coming from continuous signals should be archived in points with the step
flag OFF. Examples might include signals from thermocouples and flow meters. Data
coming from discrete measurements should be archived in points with the step flag on.
Examples are sampled lab data, batch charge weight.
In addition, the step flag affects the compression calculation. When it is ON (1) a linear
change of value greater than or equal to CompDev passes compression. This is essentially the
same as the exception calculation explained above. When the step flag is OFF (0) the
complete swinging-door algorithm is applied.
Tag
The Tag attribute is the name of the point. Each Tag must be unique to a PI System. Since the
tag is the name that identifies the point to users, use a consistent tag-naming convention that
is meaningful to people in your organization. For example, you could reserve the first two
characters of a tag to indicate a unit name or an area of the plant. You could reserve another
six characters to match the standard instrument tag, and so on.
Tags may be any length and can include letters, numbers, and spaces. Tags are subject to the
following constraints:
36
PI Point Classes and Attributes
• The first character must be alphanumeric, an underscore (_), or a percent sign (%)
• Control characters, such as linefeeds or tabs, are not allowed.
• The following characters are not allowed:
* ' ? ; { } [ ] | \ ` ' "
These characters are allowed, however, in other tag attributes, such as the descriptor.
Any tags that follow the above rules are, technically, allowed. However, be aware that some
legal characters are used by other applications in special ways. For example, SQL uses the
underscore (_) and percent sign (%) as wild cards. Using these characters in tags may cause
problems with these applications.
Note: The PI API functions pipt_tag and pipt_updates truncate the tag to 12
characters. Functions pipt_findpoint, pipt_wildcardsearch, pipt_taglong, and
pipt_tagpreferred report only the first 80 characters.
Case Sensitivity
The system preserves the case of all strings, including the tag, but searches are not case-
sensitive. For example, a string entered as BatchStart is stored exactly as entered. Subsequent
retrievals of this string retain the same capitalization. A search for this string does not require
that the capitalization match.
TypicalValue
The Typical Value is used only to document an example of a reasonable value for this point.
For a numeric tag, it must be greater than or equal to the Zero point attribute, and less than or
equal to the Zero plus the Span point attributes. Some interfaces us e this as an initial or
default value.
Zero
A Zero attribute is required for all numeric data type points to indicate the lowest value
possible. It does not have to be the same as the instrument Zero, but that is usually a logical
choice. Certain interfaces require that the Zero and Span match the instrument system range;
see the interface documentation for details.
The Zero is the bottom of the range used for scaling float16 values in the PI Archive. If the
value for a float16 type point is less than the bottom of range, the value is recorded in the
Archive as the Under range state when the Archive cache is flushed to disk. The Zero is also
used when defining a PI ProcessBook trend with a vertical scale of database.
Note: Some interfaces might use Zero information to filter incoming data. These
interfaces often convert out- of-range data to digital states over range and under
range, however, interfaces might use Zero configuration in other ways. The PI
Server itself does not change out of range data except for tags of type float16.
Many OSIsoft interfaces rely on classic attributes. Use the Classic point class for all PI
Interface points if the interface uses the InstrumentTag or location code attributes.
Filtercode
The Filtercode indicates the time constant of a first-order filter used to smooth incoming
data. While it does impact the compressed data, it does not affect exception reporting.
We recommend not altering incoming data by leaving this code at its default value of 0. The
other options are:
Code Time Constant (Seconds)
1 10
2 60
3 120
4 600
Instrument Tag
When a value is retrieved from or sent to an external system such as a DCS, the instrument
tag is used by some interfaces as the tag in the external system. The InstrumentTag field can
be any length. However, most interfaces only use the first 32 characters of this attribute.
Some interfaces use the extended descriptor (ExDesc) instead.
38
PI Point Classes and Attributes
SquareRoot
Some interface programs use the square root code. Check the manual for your interface.
Srcptid
Srcptid is the PI point number corresponding to the tag specified in the SourceTag attribute.
If this attribute is edited, PI Server changes SourceTag to the corresponding tag. Do not
directly alter the Srcptid attribute; change SourceTag instead.
COM Connectors allow the PI Server to obtain data from foreign data systems. To do this,
you must create a special PI Server point whose attributes identify the location of the data in
the foreign system.
The term map is used throughout this manual to mean making a relationship between a point
on the foreign system and a point on the PI Server. During PI Server operation, clients make
requests for data by using PI Server point information. The PI Server then obtains data from
the foreign system point to which the PI Server point is mapped.
For mapped points you must define a point class that includes the following attributes:
Attribute Description
ctr_progid COM Program ID, as stored in the Window s registry. This name is used to
instantiate the COM Connector object.
Attribute Description
ctr_lm ap Longw ord mapping parameter.
ctr_strm ap String mapping parameter.
When you create a point you must, at a minimum, name the point with the tag attribute. If
you do not assign values to all other attributes, the PI Server uses the default value. The
default values for PI point attributes are:
Point Field Nam e Default Value Lim its
Class
Base Archiving ON ON, OFF, 1, or 0
Base ChangeDate System-assigned
Base Changer System-assigned
40
PI Point Classes and Attributes
Built-in DigitalSet no default Used only for digital tags This must
be specified w hen the point is
created.
Base Display Digits -5 -20 ≤ x ≤ 10
Classic Filtercode 0
Classic Location1 0
Classic Location2 0
Classic Location3 0
Classic Location4 0
Classic Location5 0
Built-in NEWTag
Classic Srcptid 0
Base Zero 0
Note: Programmatic access to some of the attributes may be limited or unavailable from
the PI API.
42
Exception Reporting and Compression Testing
System-Assigned Attributes
When you create a point, several attributes are assigned by the system. You cannot change
the values of these attributes.
ChangeDate
The date and time when the point was last edited.
Changer
The last user to edit the point.
CreationDate
The date and time when the point was created.
Creator
The user who created the point.
PointID
The Point Identifier is a unique number that identifies the point internally. PointID is never
reused, even when a point is deleted. This is the PI Point Identifier that is passed as a
parameter to most of the PI API functions. In the PI API Manual, this identifier is referred to
as the point number, or PtNum.
RecNo
The record number contains the point's primary record number in the Archive. This is useful
when using tools such as piartool -aw to examine the Archives. RecNo is not to be confused
with the PointID attribut e.
Exception Reporting
PI Interfaces use the exception reporting process to evaluate the significance of new events.
The interface sends significant events to the PI Server and discards events that are not
significant. The purpose of exception reporting is to avoid sending changes that are smaller
than the instrument can measure, from the interface to the PI Server.
The interface compares each new value to the previously sent value. The interface sends the
new value to the PI Server only if it is different from the previous value by an amount larger
than the value in the ExcDev attribute.
Exception reporting uses a simple dead band algorithm to determine whether to send events
to PI. For each point, you set exception reporting specifications (the ExcDev, Exc Min and
Exc Min attributes) to create the dead band. The interface ignores values that fall inside the
dead band.
Interface programs that do exception reporting apply the following algorithm rules whenever
a new value is received: A new value is compared to the last value reported; if the new value
does not fall within the dead band, an exception occurs; when an exception occurs, the
interface sends the event (both timestamp and value) that caused the exception and the
previous event to the Snapshot.
The new value is not reported:
• Unless the difference between the new value and the last value is greater than the
exception deviation specification, and the difference between the times of the new and
last values is greater than or equal to the exception minimum time specification.
• Or, the difference between the timestamp of the new value and the timestamp of the last
reported value is greater than or equal to the exception maximum time specification.
Note: The time between exception reports might be greater than the exception maximum
time if no new values are received by the interface for a point. Neither the PI
Server nor the interface will create data.
44
Exception Reporting and Compression Testing
Some interfaces do not support exception reporting. See the documentation for your interface
to determine whether it supports this capability. Manually entered data is not normally
reported by exception so that every value can be retained.
Most OSIsoft interfaces report new events on exception. The exception algorithm relies on
the following parameters:
• Exception Maximum: Maximum time span between exceptions, expressed in seconds.
This value is configured for each point in the attribute Exc Min.
• Exception Minimum: Minimum time span between exceptions, expressed in seconds.
This value is configured for each point in the attribute Exc Min.
• ExcDev: Dead band when exceeded causes an exception. This is configured for each PI
Point in either the ExcDev or ExcDevPercent attribute.
• OldEvent: Value/status/timestamp of last event sent to the Snapshot; this is the last
event that passed exception report.
• PrevEvent: Value/status/timestamp of last event compared to determine whether or not
to send to the Snapshot.
• NewEvent: Value/status/timestamp of event to test for exception.
Exception reporting works by comparing the new event to the old event as follows.
• If the time new event timestamp and old event timestamp is greater than or equal the
Exc Min, the new event is sent to the Snapshot.
• For digital points, if the new value differs from the old value, the new event is sent to the
Snapshot regardless of Exc Min time.
• For numeric points, if the status changes from good to bad, or bad to good, the new event
is sent to the Snapshot.
• For numeric points, if the time between the old event and the new event is greater than or
equal to ExcMin and the absolute value of the difference between the new value and the
old value is greater than ExcDev, the value is sent to the Snapshot.
• If the new event was sent to the Snapshot, the old event is replaced by the new event.
The last step is a test to see if the PrevEvent should also be sent the Snapshot. If the
PrevEvent was not equivalent to the original OldEvent, the PrevEvent is sent to the
Snapshot. The only time the PrevEvent is not sent to the Snapshot is when two consecutive
exception reports send the new event to the Snapshot. The PrevEvent is used to accurately
indicate what really happened to the value; without it, a step change would look like a ramp
change. Basically, if a measurement holds steady for hours, then makes a step change, just
sending the new value to the Snapshot results in interpolating between the old value and the
new value. By also sending the PrevEvent, the step change is stored.
typical value is 1 percent of Span. The exception deviation should be less than the
compression deviation by at least a factor of 2.
You can set either the ExcDev or the ExcDevPercent attribute. If you change one, the other
is automatically changed to be compatible. If you try to change both at once, ExcDevPercent
takes precedence.
ExcMin
The Exception Minimum attribute, Exc Min, is a dead band after the previous value. This is
used to suppress noise. It is specified in seconds. A new data value that is received before the
end of the Exc Min interval is discarded.
ExcMin
The Exception Maximum attribute, Exc Min, puts a limit on the length of time that values can
be discarded due to exception testing. For example, it is possible for the incoming data to be a
single value for many days. If Exc Min is set to 28800 seconds (8 hours) then a value will
not be discarded due to exception if the previous event timestamp was more than 28800
seconds before that. Note that the interface does not manufacture data. If there are no
incoming values within 28800 seconds, then nothing is passed to the PI Server.
Compression Testing
When a new Snapshot arrives, the previous one is evaluated according to the compression
specifications to see if it is a significant event. If so, it is sent to the Event Queue. If not, it is
discarded. This process is called compression . The point of compression testing is to store
just enough data to accurately reproduce the original signal.
PI uses a sophisticated compression algorithm to determine which events it needs to keep in
order to provide an accurate data history. The compression method used by PI allows PI to
keep orders of magnitude more data online than conventional scanned systems. The data is
also much more detailed than in an archiving system based on averages or periodic samples.
The compression method is called swinging door compression. Swinging door compression
discards values that fall on a line connecting values that are recorded in the Archive. When a
new value is received by the Snapshot Subsystem, a new archive value will be recorded and
the timestamp of that new value will be that of the last snapshot value received before the
latest snapshot value. This value is recorded only if any of the values since the last recorded
value do not fall within the compression deviation blanket. The deviation blanket is a
parallelogram extending between the last recorded value and the new value with a width
equal to twice the compression deviation specification.
46
Exception Reporting and Compression Testing
Each point has three attributes that comprise the compression specifications : CompDev
(compression deviation), Com pMin (compression minimum time), and CompMax
(compression maximum time). CompDev is the half-width of the deviation blanket (as shown
in the illustration). CompDevPercent is similar to CompDev, but it specifies the
compression deviation in percent of Span rather than in engineering units.
Com pMin and CompMax are limits that refer to the time between events in the Archive. A
new event is not recorded if the time since the last recorded event is less than the compression
minimum time for the point. The Snapshot event is always recorded if the difference between
the time of the most recent Snapshot event is greater than or equal to the compression
maximum time.
Note: The maximum time specification does not guarantee that a value will be written to
the Archive within a certain time. The Archive waits for events to be sent to it. It
does not check to see if a point has timed out. It does not create new values.
You can adjust the compression parameters to produce efficient Archive storage without
losing significant data. The compression maximum time is usually set to one value for all
points in the system. It should be large enough that a point that does not change at all uses
very little Archive space. A compression maximum time of one work shift (for example, 8
hours) is often a good choice.
Use the compression minimum time (Com pMin) to prevent an extremely noisy point from
using a large amount of Archive space. This parameter should be set to 0 for any point
coming from an interface that does exception reporting. In this case, the exception minimum
time should be used to control particularly noisy points. For a data acquisition system with a
slow scan time, this parameter is not important. There are few cases where you want to use a
non-zero compression minimum time.
The most significant compression parameter is the deviation specification, CompDev. This
parameter is often adjusted after the point is defined. A reasonable starting point is one or two
percent of Span for transmitters and 0.5 to 1.0 degrees for thermocouples. Look at trend
displays to find points for which the reproduction of the data is not acceptable. The goal is to
filter out instrument and process noise and still record significant process changes. The effect
of changing the compression deviation is not predictable.
For digital points, any change is a significant change. Only the compression maximum and
minimum time are important. The compression deviation specification is ignored for digital
points.
There are three instances where an event will bypass the compression process and be put in
the Event Queue:
• If the Compressing attribute for the point is set to OFF.
• If the timestamp is older than the timestamp of the current snapshot. Such an event is
considered out of order.
• If the Status attribute of the Point has changed.
Step Flag
The step attribute setting affects both display and compression.
Data for points with this attribut e set to 1 is assumed to remain fixed between events, whereas
for points with step=0 data is assumed to change linearly between valid numeric events.
The swinging-door compression, explained above, is not used when the step flag is set.
Instead, an exception calculation is applied using the CompDev value. If the absolute
difference between the current Snapshot and the last Archive value is greater than CompDev
then the Snapshot is sent to the Archive.
Compression maximum and minimum limits work the same as for tags with the step flag not
set.
48
Change PI Point Type
In order for a point type attribute to be changed successfully, you must change between point
types that can be coerced.
Following is the matrix of allowed type coercions:
int16 int32 float16 float32 float64 digital string blob timestam p
int16 ok ok5 ok ok ok ok N/A N/A
1.
Assuming values in the range of 0 to 32767
2.
Assuming values in the range of -2,147,450,880 to 2,147,483,647
3
Assuming positive, integer values that are lower than number of digital states
4
Assuming exact, case-insensitive match with a state string
5
Assuming the range of the source is compatible with the range of the target
Not e: When you change point types to int16 or digital, you must enter a value for the Zero
and Span attributes.
Effects on Archives
When you change a point type attribute, the current Archive record is closed and a new
record is open. The new record uses the changed point type attribute.
Point type edits affect how users will see both newly generated data and data that was
previously archived. For this reason, you should consider whether you want to:
• Preserve the original point type in the Archive history, or
• Convert all Archives to reflect the point type change.
Effects on Users
Data from the previous type(s) is coerced to the current type at retrieval time if possible. In
order for a point type attribute to be successfully coerced and subsequently changed, you
must make changes only between point types that are allowed. For details about point type
coercions that are allowed, see Allowable Point Type Coercions (page 49).
If an event in the Archive cannot be coerced to the edited point type, the digital state
Coercion Failed is returned by default. The Coercion Failed digital state acts as a
placeholder for an event that the Snapshot Subsystem failed to coerce. Out-of-order events
may also result in a Coercion Failed digital state.
You can use the parameter Archive_DataCoercionPolicy to translate a digital state, as
appropriate. For details, see Configure Error Handling (page 50).
50
Create, Delete, or Edit PI Point Classes and Attribute Sets
Caution: The modification of attribute sets and point classes can trigger a cascade of
edits through a multitude of points and across a multitude of group and user
boundaries. Do this only if absolutely necessary. Do a backup before you begin.
Only the piadmin user or the piadmins group can create, delete or edit attribute sets and
point classes. You must also have read and write permissions on the Point Database
(PIPOINT). The piadmin user always has read/write access to PIPOINT, but if you are using
piadmins, you might need to set the permissions explicitly.
The following restrictions apply when editing and deleting attribute sets and point classes
(but not when creating them):
• Attribute sets and point classes may be edited or deleted only in standalone mode, in
which PI Net Manager closes the TCP/IP listener and disallows any client connections.
Existing PI SDK, PI API and PI Server Application connections close, and reconnection
attempts are refused for the duration of the standalone mode. Subsystems and locally run
utilities such as piconfig and piartool can connect. Default-only attribute edits are
supported in Normal mode.
The command piartool -standalone on puts the system in standalone mode,
that is, no clients can connect, and piartool -standalone off sets it in normal
operating mode. Use piartool -standalone query to query the system's
current mode.
• You may add attributes to any set, except the Base attribute set.
Note: Any attribute added to a predefined set cannot be removed. The predefined
attribute sets are required by predefined point classes, which cannot be
deleted, so they are always in use. When expanding a point class, we
recommend that you create a new attribute set with new attributes rather than
adding new attributes to a predefined set. For a list of predefined attribute sets
and point classes, see Predefined Point Classes.
• You may delete attributes from any set (only if not in use in any point class) except:
ο required attributes contained in sets predefined in PI Server
ο attributes contained within in-use attribute sets
• You may not rename attributes
• You may rename attribute sets, except predefined attribute sets
• You may delete any attributes sets except:
ο predefined attribute sets
ο in-use attribute sets
• You may add attribute sets to any point class
• You may delete attribute sets from a point class (only if not used by any point) except:
ο required attribute sets contained in predefined point classes; For a list, see Predefined
Point Classes.
ο in-use point classes
• You may rename any point classes, except predefined point classes
• You may delete any point classes, except:
ο predefined point classes
ο in-use point classes
These restrictions protect the attribute sets and point classes that PI system uses as building
blocks. These restrictions can limit the user's ability to easily undo some actions. Always
make a backup of the PI Point Database before attempting to edit attribute sets or point
classes. You can delete attribute sets from predefined point class as long as the class is not in
52
Create, Delete, or Edit PI Point Classes and Attribute Sets
use and the set to be deleted is not a required set for that point class. Any attribute added to a
predefined attribute set can never be removed.
The piconfig utility can be used to perform these edits and deletes after placing the PI Server
in standalone mode using the piartool utility.
The sections that follow discuss how to create, delete, and edit the PI Attribute Set database.
Note: Only the piadmin user or the piadmins group can create, delete or edit attribute
sets and point classes. You must also have read and write permissions on the
Point Database (PIPOINT). The piadmin user always has read/write access to
PIPOINT, but if you are using piadmins, you might need to set the permissions
explicitly.
Note: Boolean values show as either 1 or 0 instead of true or false. All non-zeros are
interpreted as true and 0 is interpreted as false.
Reserved names:
Class NEWSET
NEWCLASS Set
The built-in attributes are added to all points. Users cannot modify their types and defaults.
However, users can modify the default values of non system-assigned attributes, such as
PtSecurity, DataSecurity, PtOwner, PtGroup, PtAccess, DataOwner, DataGroup,
DataAccess, DigitalSet, ExcDevPercent, CompDevPercent, and SourceTag.
OSIsof t creates the base attribute set. See Attribute Set Edit (page 56) for details. Attribute
name checks are case-ins ensitive.
54
Create, Delete, or Edit PI Point Classes and Attribute Sets
@table piatrset
@mode list
@ostru set
@ostru attrib,type,default
@ostru ...
@select set=MyAttributeSet
@ends
The output will look like:
MyAttributeSet
MyAttribute1,BYTE,0
MyAttribute2,Int32,2
MyAttribute3,String,Default string
MyAttribute4,Float32,0.
* End Repeat...
*----------
Built-in Attributes
Built-in attributes are a part of every PI point, but do not belong to any particular attribute set.
The types and defaults of built-in attributes do not belong to any attribute set explicitly and
cannot be edited.
Note: In PI Server versions prior to 3.3, ExcMax and CompMax were type uint16.
56
Create, Delete, or Edit PI Point Classes and Attribute Sets
To change the attribute MyAttrib2 to type String and add another attribute, MyAttrib4 of
type uint16 in piconfig:
@table piatrset
@mode edit
@istru set
@istru attrib,type,default
@istru ...
MyAttribSet
MyAttrib1,int32,22
MyAttrib2,String,default string
MyAttrib3,float32,
MyAttrib4,uint16,1
@ends
Now list the resulting set:
@mode list
@ostru set
@ostru attrib,type,default
@ostru ...
@select set=MyAttribSet
@ends
MyAttribSet
MyAttrib1,Int32,22
MyAttrib2,String,default string
MyAttrib3,Float32,0.
MyAttrib4,Uint16,1
When editing an attribute set, you must explicitly redefine the attribute name, type, and
default. If a pre-existing attribute is not specified in the new definition, it is permanently
removed from the set. If you had not wanted to edit the existing attributes, but only wanted to
add a new attribute MyAttrib4, you would still need to specify all attributes in his definition.
For example:
@table piatrset
@mode edit
@istru set
@istru attrib,type,default
@istru …
MyAttribSet
MyAttrib4,uint16,1
@ends
produces MyAttribSet containing only one attribute, MyAttrib4.
When you edit an attribute set, you must completely specify all the attributes, exactly as on
creation. If an attribute set is edited and its pre-existing attribute name (but not the type and
default) is specified, float32 and value 0.0 is assigned, overwriting the original type and
default. If the user specifies only the type, a new default is assigned even if the type is
identical to the previous one. The default of MyAttrib3 attribute was changed to 0.0 from the
origina l 5.0 because it was not explicitly specified in the edit.
58
Create, Delete, or Edit PI Point Classes and Attribute Sets
When you are finished with the edit, place the system back in normal mode so that
applications can connect.
piartool -standalone off
Renaming an attribute set does not trigger any implicit edits of point classes or points and
does not require standalone mode.
See Overview (page 51) for attribute set edit restrictions.
Informational Messages
Some messages are not directly returned to the application that initiates the edit, such as
piconfig, but are instead sent to the PI Message subsystem. Examples of these messages are
information regarding the status (success or failure) of the edit steps (rename the old set, add
a new set, implicitly edit dependent point classes and points, and remove the old set) and the
number of dependent point classes found. These messages are useful in verifying that the
steps correctly followed during the edit.
For details on indirect (that is, implicit) edit of PI Point Class Database, see Attribute Set Edit
(page 56). This section explains how to explicitly create, edit, or delete a point class.
Note: Only the piadmin user or the piadmins group can create, delete or edit attribute
sets and point classes. You must also have read and write permissions on the
Point Database (PIPOINT). The piadmin user always has read/write access to
PIPOINT, but if you are using piadmins, you might need to set the permissions
explicitly.
60
Create, Delete, or Edit PI Point Classes and Attribute Sets
62
Create, Delete, or Edit PI Point Classes and Attribute Sets
Informational Messages
Some messages are not directly returned to the user but are instead are sent to the PI Message
Subsystem. Examples of such messages are information regarding the status of the steps
involved in point class edit (rename the original class, add a new class, implicitly edit
dependent points, remove the original class) and the number of dependent points found.
A point class may be renamed by an edit unless it is one of the pre-defined point classes. This
rename does not require standalone mode.
You can change the point class of a PI point. As in the case of implicitly edited point, the
attributes of the point are rebuilt. The important difference is that unlike in an implicit point
edit, some existing attributes may be removed because a point class edit does not allow
removing any attributes if there are any dependent points. This prevents points from
inadvertently losing existing attributes. However, if a user deliberately moves a point from
one class to another and the new point class does not contain some of this point's current
attributes, they are deleted without prompting.
When you change a point's point class, any new attributes are added and set to default values.
Attributes that do not belong to the new point class are removed. Existing attributes are
copied if they are in the new point class. Compatible types retain their values and
incompatible types are set to new default values.
When editing a point with piconfig, new attributes can be modified simultaneously. That is, it
is acceptable to edit the PtClassName attribute and include new attributes that only belong to
the new point class and did not previously belong to the point's old class. However, the target
class must be set before such an edit is attempted.
To illustrate, try editing a point that belongs to Totalizer point class to Classic point class in
piconfig as follow s:
@table pinpoint
@ptclass Totalizer
@mode edit
@istru tag,ptclassname,location4,pointsource
The following error is returned:
*piconfig Err> Unknown parameter <location4> in structure
*@istru tag,ptclassname,location4,pointsource
*piconfig Err> Complete Structure line removed
*@istru tag,ptclassname,location4,pointsource
This is because @ptclass Totalizer sets the environment for this edit to Totalizer point
class, which does not have the location4 attribute. If you want to edit the PtClassName
attribute and new attributes unique to the target point class at the same time, set the
environment to the target point class, Classic, by using @ptclass Classic first:
@ptclass classic
@istru tag,ptclassname,location4,pointsource
tagname,classic,1,C
If it is not necessary to edit the PtClassName attribute and new attributes at the same time,
issuing:
64
Digital State Sets
@ptclass classic
is not necessary since PtClassName is a built-in attribute and every point has this attribute.
Point class of a point can be edited using piconfig in PI Server 3.4.370 or later.
Both Attribute Sets and Point Classes are included in the Audit Database. The EnableAudit
parameter in the PI Timeout Table bit (which starts from 0) is used for Attribute Sets Audit
Database and bit 4 for Point Classes Audit Database.
Datab ase Bit Value to Enable (decim al)
Point DB 0 1
Attribute Sets DB 2 4
Point Classes DB 4 16
Use the AuditViewer tool to work with the Audit Database. See the AuditViewer help and
Audit the PI Server for more details.
The default set is called the System digital state set and contains over 300 digital states that
may apply to any point. A sample of pre-defined digital states that represent typical system
states are as follows:
State Description
I/O Tim eout Interfaces use this state to indicate that communication w ith a remote device has
failed.
No Data Data-retrieval functions use this state for time per iods w here no archive values
for a tag can exist 10 m inutes into the future or before the oldest mounted
archive.
Under For float16 point types, this state indicates a value that is less than the zero for
Range the tag.
Over Range For float16 point types, this state indicates a value that is greater than the top of
range ( Zero+Span) for that tag.
Pt Created This state is assigned to a tag w hen it is created. This is a tag's value before any
value is entered into the system.
Shutdow n All tags that are configured to receive shutdow n events are set to this state on
system shutdow n.
Arc Off-line Used by data-retrieval functions to indicate a period of time not covered by any
mounted archive.
Bad Input Interfaces use this state to indicate that a device is reporting bad status.
Note: The last possible state in the System digital state set is number 16383. It is
reserved for internal PI Server use. OSIsoft recommends that you keep changes
to the System digital state set to a minimum. At most, you can translate the states
into another language without changing their meaning. Digital points should use a
user-defined digital set, not the System digital state set.
You can define digital state sets with the PI System Management Tools (PI SMT) or
piconfig. For digital points, there are typically only a small number of valid states. Before
you can configure a digital point, you need to define the digital state set that it will use.
For example, you can configure a point to use an instrument system that reports a valve
position as having a digital code value of 0 or 1 and assigns the value 0 to a state of
CLOSED and the value 1 to a state of OPEN.
Before you configure this point, you must first establish a digital state set with two strings,
CLOSED and OPEN. You might name it Valve Position. You could also define other points
that also have CLOSED and OPEN states to use the same Valve Position digital state set.
Points that have states of ON and OFF would use a different digital state set, which you
could call Switch Position.
66
Digital State Sets
The digital code value, that is 0 or 1, is determined by the PI Server according to the position
of the digital state string in the Digital State Table. The first value is 0, the second is 1; the
third is 2, and so on. The position in the set is termed digcode in PI API.
When retrieving state strings, PI API returns a maximum of 79 characters.
Note: There is no need to include system states in custom digital sets because the
system states contained in the System State Set is used where needed by the PI
Server. You may define up to 16383 state sets with up to 16383 states in each
set. For details, see System State Set for All Points (page 66).
Manage Archives
PI Archive management includes significant tasks. Most of these tasks can be performed in
SMT, however there are still a few tasks (such as performing an archive walk or backfilling
data) that require command-line utilities. This chapter explains how to perform tasks in SMT,
wherever possible and provides command-line instructions where necessary. For complete
information on using command-line tools for managing archives, see the PI Server Reference
Guide.
About Archives
PI Archives are the files that the PI System uses to store PI Data. Each Archive file contains
events for a time period specified by the Archive start time and end time. Archive files range
in size from 2 MB to 2 terabytes (2,048 GB).
Archive files can be either fixed or dynamic. Fixed Archive files are always the same size,
regardless of how much data they contain. Dynamic Archive files grow in size as they get
data. See About Fixed and Dynamic Archives (page 72) for details.
piarchss: The Archive Subsystem, piarchss, includes an Offline Archive Utility. You
use this utility to process existing offline archives. Among the tasks you use piarchss for
are: to combine multiple archives into one; to divide large archives into multiple
archives; to recover corrupted archives, and so on.
The Archive receiving current data is called the primary Archive. When the primary Archive
becomes full, an Archive shift occurs and the next available Archive becomes the new
primary Archive.
PI performs an Archive shift before the primary Archive is completely full. As a result, the
Archive contains some extra space so that, if necessary, you may add data later. For an
Archive file to be eligible to be the new primary Archive, it must be registered, writable, and
large enough to handle the current size of the Point Database. When an Archive file is
registered, it is visible to the PI Server and indirectly to its client applications. See Register an
Archive and Choose an Archive Size (page 76) for more details.
If no eligible Archives are available for an Archive shift, PI us es the oldest available filled
Archive as the new primary Archive and, in the process, overwrites the data in the old
archive. For example, in the preceding illustration there are no empty registered Archives left
on the Server after the shift from piarch.003 to piarch.004. If the system manager
does not create new Archives on this PI Server, Filled Archive: piarch.001 becomes the
next primary Archive and the PI Server overwrites the existing data in that Archive.
It takes PI a few minutes to complete an Archive shift. During that time, you are not allowed
to add, edit or delete points. PI stores incoming data in the event queue until the shift is
complete and then writes the queued events into the new primary Archive.
70
About Archives
Archive gaps are times for which no Archive file is registered. If an event is sent to the
Archive and no Archive file is registered within the appropriate time range, the event is
discarded and an error is logged. If data retrieval is attempted for a time range that overlaps
with a gap, the returned data inc lude s a digital state Arc Offline that indicates the
beginning of the gap. This prevents values from being interpolated when data is missing.
PI Archives store events as data records. Data records are either primary records or overflow
records. Each point in the Point Database has one primary record allocated in every archive
file. Primary records are stored at the very beginning of the Archive file. When the primary
record for a point fills up, the data for that event goes to an overflow record in the Archive
file. Overflow records start at the end of the Archive file and are filled backwards. Each
record is one kilobyte.
A point can have as many overflow records as needed. Points that receive events at a slow
rate might never need to allocate an overflow record, whereas points that receive events at a
fast rate might need to allocate many overflow records. The PI System uses index records to
keep track of multiple overflow data records for a point.
Note: When the Archive allocates a new overflow record for a point, it immediately writes
to disk both the new record and any existing records that reference the new
record.
The primary Archive is the Archive file that covers the current time range. For the duration of
time that its state is the primary Archive, it has a defined start time but no defined end time.
The end time is always assumed to be now.
The end time for the primary Archive is redefined when an Archive shift occurs. An Archive
shift is the process of replacing the primary Archive with a new or cleared Archive. The time
of the shift becomes the end time and that archive is no longer the primary Archive.
If registered, an empty Archive is selected to be the new primary Archive. If no empty
archive is registered, then the oldest archive becomes the primary Archive and its existing
data is overwritten.
You may also set up automatic Archive creation using the
Archive_AutoArchiveFileRoot Tuning parameter; if this is in effect, a new Archive
with the same characteristics as the current primary Archive is created during the shift. For
details on how to set up automatic Archive creation, see the SMT help files or Intro to PI
Server System Management.
The PI Server ensures that some space is still available at the time of the shift. This way, out-
of-order events can still be stored in the Archive after it is no longer the primary Archive. For
more information, see Manage Archive Shifts (page 82).
Fixed Archives
Use fixed Archives for all normal operations. Fixed Archives:
• Have all of their disk space allocated at creation time. An empty Archive and a full
Archive take the same amount of disk space.
• May or may not participate in Archive shifts, depending on the point count-to-Archive
size ratio and the state of the shift and write flags.
• May have new points added, if the fixed archive is the primary archive.
Note: As of version 3.4.375, fixed-sized archives will become dynamic whenever they
are full if there is sufficient disk space. A fixed-sized archive that has become
dynamic will remain shiftable. When the changed archive becomes primary, it will
convert back to fixed-sized. The allocated disk space for archives will not be
modified. For details, see If Fixed Archives Are Full (page 73).
The default Archives that are installed with a PI Server are fixed Archives.
72
About Archives
Dynamic Archives
Dynamic Archives:
• Cover a specific time range.
• Are not eligible for Archive shift if they already contain data. Newly created dynamic
Archives participate in the standard shift algorithm.
• Do not contain unallocated space waiting to be used for overflow records. Rather, the file
grows as overflow records are added. You must specify a maximum Archive size when
you create a dynamic Archive. Dynamic Archives grow as they are filled, up to the
specified maximum size, or maxsize, but no larger than 2 terabytes.
• Are initialized with a fixed number of primary point records. Once a dynamic Archive is
created, the number of primary records cannot grow beyond the initial allocation, even if
there is space in the file.
Note: You can create dynamic Archives with a number of primary records higher than
the current number of points. This allows users to create additional points in a
dynamic primary Archive. Users can add new points as long as the number of
points does not exceed the number of primary records allocated when you created
the dynamic Archive. See Example: Create a Dynamic Archive for details.
Caution: You must consistently monitor disk space usage to ensure that you have
adequate disk space for new Archives. If you run out of disk space, you risk data
loss.
overflow records are appended at the end. If the Archive that was filled is the primary, an
Archive shift is also scheduled immediately. This arrangement allows all the incoming events
to be stored so there is no data loss. The fixed Archive that was converted is marked as non-
shiftable, like all non -empty dynamic Archives. As a result, some additional management
may be required. For example, you may need to register a new empty Archive for the next
shift or reprocess the converted Archive to fit a certain size. Converted Archives are clearly
marked as a different type on Archive displays such as piartool -al.
Note: To prevent the automatic conversion of full fixed archives to dynamic archives, set
the Archive_Enable_AutoDynamic parameter to 0. To update this the parameter in
SMT, use the Archive Tab in the Tuning Parameters tool.
Archive files that have a read-only file-system attribute, or files on a read-only device (CD
ROM) are mounted as read-only. Their status will show up on the piartool -al display as not
writable. Read-only files cannot participate in Archive shifts.
New events in the time range of such an Archive go into the Archive cache, but when flushed
to disk, an error message is logged for each event. This includes attempts to edit, delete or
annotate events in a read-only archive.
About Annotations
Every value in the Snapshot or the Archive may be annotated. An annotation can be of any
data type. Annotations are stored in an Annotation file. Each Archive file has a single
associated Annotation file, with an .ann extension. The Annotation file is created if it does
not exist. It is important the Archive and Annotation files remain together, especially when a
backed up Archive file is restored.
You can view, add, and edit annotations using the SMT Archive Editor. To open the
Archive Editor, select Data > Archive Editor in the PI Server System Management Tools
pane.
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.
74
Create a New Archive in SMT
Note: Start and end times must not overlap an existing Archive.
Archive Names
To name PI Archives, you must use a naming convention that is valid for the underlying
operating system and the file location must have sufficient disk space. There are no other
limitations to name PI Archives.
The default archive file names are piarch.xxx, where xxx is 001, 002, 003 and so on.
The associated annotation file has the same full path name as its archive file with .ann
appended. For example, the annotation file for the piarch.001 archive file would be
piarch.001.ann.
Archive files can have a fixed size or can be configured to grow dynamically as they receive
more data. The archive size affects backups, frequency of shifting, and total number of points
allowed.
Apply these guidelines to determine the minimum and maximum size for your PI Archives:
• Minimum Archive Size: Double the number of points and divide the result by 1000 to
calculate the minimum Archive size, in MB. For example, to allow for 20,000 configured
points, the minimum archive size is:
(20,000 x 2) / 1000 = 40 MB
• Maximum archive size: 2 terabytes (2000 GB).
The minimum file size is 1 MB or the current point count multiplied by 1024, whichever is
highe st. The maximum file size is 2,096,128 MB, that is, approximately 2 terabytes.
76
Create a New Archive in SMT
To set the maximum Archive size, use piarcreate or piartool. For example:
piarcreate -acd D:\PI\dat\piarch.115 2000 20000
Attempting to create a 0 Mbyte fixed archive file: -acd
Initializing archive file: -acd
Archive -acd is prepared to be registered.
Note: The default archives are sized at the time of installation when the installer answers
prompts from the installation wizard.
Register an Archive
To register an existing Archive for use with a particular server, use the Archives tool
(Operation > Archives):
1. Select the Archive in list view and click the Register Archive button on the toolbar, or
right-click and choose Register Archive.
2. Browse to the Archive file you want to register and click Open. The list of Archives is
refreshed. Be sure to verify that the register succeeded and that the Archive is in the list.
Unregister an Archive
To un-register an Archive from a particular server, taking it out of the queue, use the
Archives tool (Operation > Archives):
1. Select the Archive in the list and click the Unregister Archive button on the toolbar, or
right-click and choose Unregister Archive.
A dialog box prompts you to confirm before un-registering the Archive.
2. Click Yes to un-register the Archive, or No to cancel the operation.
Note: If the PI Server is not on the local machine, this feature requires the PI Server's
piadmin password.
Bulk Operations
To register or unregister archives in bulk, you need to use the piartool utility. With this
utility, you can use the wildcard characters * and ? to perform bulk operations. The symbol *
matches all possibilities with any number of characters. The symbol ? matches a single
character and may be used any number of times.
78
Edit Archives
Register in Bulk
To register archives, you use the piartool -ar command. The syntax is:
piartool -ar path
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
The specified path must be a complete, not relative, path of an existing archive file. You can
use the wildcard characters * and ? to register 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 registers all archive files in the PI\dat directory that
begin with the piarch.0 prefix:
piartool -ar D:\PI\dat\piarch.0*
Unregister in Bulk
To unregister an archive, use the piartool -au command. The syntax is:
piartool -au path
where path specifies a complete, not relative, pathname. 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
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*
Edit Archives
Note: All archive edits are first handled by the Snapshot Subsystem. The Snapshot
Subsystem performs some security and data checks then, if appropriate, forwards
the edit events to the Archive Subsystem.
For large scale changes and repair use the Offline Archive Utility (piarchss). For example,
inadvertently moving the computer system clock ahead may cause considerable problems.
You can configure a time limit on insertion and editing of events. The Snapshot rejects events
with timestamps earlier than the limit. By default there is no limit, which is consistent with
earlier versions of PI.
To configure a time limit on insertions and event edits, add an entry to the PITimeout table:
EditDays, nnn
where nnn is the number of days (prior to current time) in which changes and additions are
allowed. The Snapshot Subsystem must be restarted for the changes to take effect. To add the
Tuning parameter, you can use the SMT Tuning Parameters tool (Operation > Tuning
Parameters).
Delete an Archive
You must first unregister an archive before you can delete it. Use the Archives tool
(Operation > Archives) in SMT to delete the archive. Then delete the related annotation file.
Make Writeable/Read-only
To change the protective Write flag for an Archive, right-click the Archive in list view, and:
• choose Make Read-Only to make a writable Archive read-only.
• choose Make Writeable to make a read-only Archive writeable.
Move an Archive
To move an archive you must unregister it, move it to a new directory, and then re-register it.
Remember to move the associated annotation file as well. Moving the primary archive
requires some additional steps, since you cannot unregister it while the PI archive process is
running.
To move the primary archive:
1. Unregister it.
80
Backup Archives
2. If any empty archives exist in the original directory, move them to the new directory and
register them there. One of these archives will become the new primary archive.
3. Verify that there is at least one empty archive registered in the new directory. Create one
if it does not exist. See Create a New Primary Archive for details.
4. Force an archive shift. This results in a new primary archive, which is one of the empty
archives in the new directory.
5. Move the previous primary archive to the new directory by the usual method: unregister
it, copy it to the new directory, and then reregister it.
Note: It is not generally necessary to rename archive files. If you do, remember to
rename the annotation file as well. Check the release notes for a description of
issues associated with archive file renaming.
Backup Archives
You can use the SMT Archive tool to backup an Archive and its corresponding annotation
file for PI Server versions 3.4.370, or earlier:
1. Select the Archive to back up in the list, and click the Backup button , or right-click
and choose Backup.
2. Browse to the desired backup directory, and enter a new file name or select an existing
backup file, then click Save.
Note: Backups may be created only for local PI Servers, version 3.4.370 or earlier. The
backup process differs for later versions. See Back up the PI Server (page 97).
Note: The oldest shiftable archive is the oldest writable archive large enough for the
current point count. Also, dynamic archives containing data are not shiftable.
The process of clearing the oldest archive and preparing it to be the new primary archive is
called an archive shift. It is important that all eligible archives are backed up prior to the
archive shift to ensure that no data is lost.
When an archive is assigned a start time, it is initialized. Archives are only initialized during
an archive shift, or when registered with pre-defined start and/or end times.
The archive shift process takes a few minutes to initialize a new archive file. You cannot add,
edit, or delete points during an archive shift. Events sent to the Archive during an archive
shift are queued. When the shift is complete, the queued events are written to the Archive.
Note: Dynamic archives that contain data do not participate in archive shifts. That is,
newly created dynamic archives may be shifted into, but they are shift disabled
after the first overflow record is allocated.
For an archive file to be eligible to be the new primary archive, it must be registered,
shiftable, writeable, and large enough to handle the current size of the Point Database. If an
archive does not meet these criteria, it is skipped over during an archive shift. By making an
archive non-shiftable or read only, an archive may be excluded from the shift cycle.
The SMT Archives tool (Operation > Archives) has a shift prediction column that predicts
the time for the next archive shift, based on the average number of archive records cons umed
per hour, plus the rate of consumption. If the primary archive is less than 20 percent full, the
prediction is based on the previous archive rates.
82
Backfilling Data
If an archive shift fails for any reason, all further shifts are disabled and a message is sent to
the log. When the cause of the failure is resolved, restart the Archive Subsystem to enable
archive shifts. If the cause of failure was a lack of available archive to shift into, then register
a new empty archive to automatically resolve the situation and enable a shift into the new
archive.
Failed shifts do not cause any data loss since the archive goes into read-only mode and
prevents data from being written to the archive file. All incoming data is queued in the Event
Queue by the Snapshot Subsystem.
Make Shiftable/Non-shiftable
To change the Shift flag for an Archive, right-click the Archive in list view, and:
• choose Make Non-shiftable to make the Archive non-shiftable
• choose Make Shiftable to make the Archive shiftable.
To force a selected server to shift from one Archive file to another, select the server's primary
Archive in the list and click the Force Shift button . A dialog prompts for confirmation
before forcing the shift.
Backfilling Data
At times it may be useful to make data available in PI that was collected prior to the PI
installation. Several applications can be used for this procedure, known as backfilling. You
may use a PI API or PI SDK application, piconfig, or the batch file interface. Your choice
depends mainly on how the data that will be entered into PI is currently stored.
Note: Entries that allow access to specific names or addresses override the
DISALLOW. Edit all other entries to DISALLOW. Local connections are not
affected by PIFirewall table entries; verify that applications that may
write data are not running.
3. Start PI with the -base parameter. This ensures that PI starts up with only the minimum
required subsystems. Enter the command:
pisrvstart.bat -base
4. Use piartool -ac or -acd to create and register archive files for the backfilling period.
5. Use piconfig or other tools to insert one event for every point at the earliest time on-line.
6. Delete all the PointCreated events from the snapshot. This will bring into the
snapshot the old events. This can be done with a PI API or PI SDK program or with the
piconfig utility. Verify that the old event is in the snapshot.
7. Backfill the archives by reading in the data in Time Sequential Order. This way the data
is compressed.
Caution: The Archive Subsystem assumes the snapshot time is the most recent
time stamp written to any point. To enable compression, it is important to keep
all current data sources from writing to the PI Server. This is why Random,
Ramp Soak, Performance Equations, PI Total, PI Alarm, or any other
interfaces cannot be running.
8. If you used the technique of modifying the PIFirewall table in Step 2 above, run piconfig
to either change the hostmask value to Allow or delete the above hostmask altogether.
9. Start the interfaces using pisrvsitestart.bat.
1. Install PI Server and create all points. The points that you want to backfill must be
created prior to the archive initialization, otherwise the archive has no primary records for
these points.
Note: You can backfill data using an archive created with a start time prior to point
creation time, provided the point data exists when that archive is created.
Reprocessing an old archive with the offline utility adds to that archive all
existing points, while preserving all the old data.
2. Use piartool -ac to create and initialize back fill archives. The start and end times must
be specified. The start time should be the timestamp of the oldest data to be backfilled;
the end time should be just prior to the oldest archive time specified using piartool -al.
3. Backfill the data. The data that you backfill is not compressed, since it is prior to the
snapshot time.
84
Manage Archives of an Offline PI Server (piarchss)
4. If the backfill archive is filled before all of the backfill data is entered, you must delete
the backfill archive, and create two backfill archives. Next, divide the target time range
between the two, or create a single larger archive, and then retry the data backfilling.
Note: The archives that are created by the Offline Archive Utility may be either fixed or
dynamic. Their format is not different from any other archives created by piartool -
ac.
When you run piarchss as the offline archive utility, indicate an input archive file and an
output archive file, along with relevant command parameters. The basic format is:
piarchss -if inputPath -of outputPath
where inputPath is the full path and file name of the input archive file and outputPath is the
full path and file name of output archive file.
The piarchss utility takes the input file, processes it according to the command parameters,
and then outputs the processed file to whatever location you specified. The piarchss utility
does not modify the input file under any circumstances.
• If the input file is registered, the Offline Archive Utility unregisters it when processing
begins.
• If the input archive is the primary Archive, it cannot be unregistered. To work around
this, force an archive shift using piartool -fs or temporarily shut down the Archive
Subsystem.
• If the output file does not exist, the utility creates it.
• If a full path name is not specified for the output archive, the utility places the output
archive in the current directory.
• At the end of processing, neither the input nor the output archives are registered.
• By default, the piarchss offline archive utility creates dynamic archives. Use the -f
argument to specify a fixed archive.
• You can run the piarchss offline archive utility while the PI System, including piarchss
itself, is running. At a minimum, the pinetmgr, pibasess, and pisnapss
subsystems must be running, because the utility needs to access the Point Database
during off-line operations.
86
Manage Archives of an Offline PI Server (piarchss)
-tfix Time fix Apply a specified time transformation to input data. See
Transforming Event Timestamps (-tfix) (page 14).
-tzf pathname Time zone Use w hen input is different from standard DST.
specification
file
-vah Validate Apply a validation algorithm. Multiple events
annotation referencing a single annotation are detected and fixed.
handles Batch Database annotations are checked for
consistency.
Time Ranges
event Sets the end time to the time of last event in input file.
time Sets the end time to the specified time string. Times are specified in absolute PI
(w here time is time for mat. Relative times are not supported. Times must be enclosed in double
specified in quotes w hen containing spaces. If only date is specified the time defaults to
absolute PI time 00:00:00 ( midnight).
format) For example:
“22-JAN-02 23:59:59”
23-JA N-02
21-Feb
Output file start and end times must differ by at least one second.
NFE Sets the end time to time of last event w hich passes the time filter.
primary Sets the end time to indicate the archive is a primary archive.
NoChange End time is not altered.
From a user perspective, archive files are organized according to the time ranges that they
span. It is sometimes useful to change the initial file organization of the archive. The Offline
Archive Utility can be used to accomplish each of the following tasks:
• Combining archives with overlapping dates into one archive
• Combining archives with adjacent time ranges into one archive
• Dividing an archive into smaller archives, each covering a portion of the original time
span
88
Manage Archives of an Offline PI Server (piarchss)
In this example, january.dat and february.dat do not exist prior to the operation.
They are created as dynamic archives by default. After they are created, they may be
registered using piartool -ar, and then events may be added to the archive files in the usual
way. Both output archives are not shiftable because they were created by the Offline Archive
Utility as dynamic archives.
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 (page 87) and Specify an End Time for the Output File (page
88).
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 it again.
Note: The Offline Archive Utility will not work in descending or random time order.
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.
This example demonstrates how to combine archives:
piarchss -if D:\pi\dat\oldest.dat -of D:\pi\dat\bigfile.dat
piarchss -if D:\pi\dat\newer.dat -of D:\pi\dat\bigfile.dat
piarchss -if D:\pi\dat\newest.dat -of D:\pi\dat\bigfile.dat
In this example, bigfile.dat does not exist prior to the operation. It is created in the first
session and events are added to it in the second and third session. It is created as a dynamic
archive by default. After it is created, it may be registered, and then events may be added to
the archive through the Snapshot Subsystem.
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.
To view a detailed listing of archive records, use piartool -aw. After issuing this command,
you are prompted for the target archive number and the target record.
Use piartool -al to determine the archive sequence number. See Determine Archive Sequence
Numbers (page 90) for more details. After you determine the archive sequence number, you
can display archive records, view record details and examine broken pointers.
90
List Archive Record Details (Archive Walk)
92
List Archive Record Details (Archive Walk)
94
List Archive Record Details (Archive Walk)
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 (RecNos 4 and 11, respectively) clearly have an excessive
number of index records. See Maximize PI Server Performance.
Note: The Backup tool in SMT only allows you to evaluate the success or failure of Step
1. The tool gives no indication as to the success or failure of Step 2.
Note: By default, the backup task uses Microsoft's Volume Shadow Copy Services
(VSS) to enable access to the PI Server during backups. If VSS is not supported
on the PI Server computer, then there are some limitations to access during
backups. See VSS and non-VSS Backups (page 106) for more information.
98
Configure a Daily Backup Task
Upgrade Considerations
If you had the 3.4.370 or 3.4.375 backup scheme in effect before the upgrade, your backup
will continue to work in the same or similar manner as it did before the upgrade. If you are
upgrading from any PI Server version prior to 3.4.370 or if you are moving your PI Server to
a different machine, your scheduled backups will cease to function and you need to convert to
the 3.4.380 backup scheme.
• How can I tell if the 3.4.380 Backup Scheme is in effect? (page 99)
• How do I convert to the 3.4.380 Backup Scheme? (page 100)
• What archives are backed up after converting to the 3.4.380 Backup Scheme? (page 100)
• Why should I convert from the 3.4.375 Backups Scheme to 3.4.3.380 Backup Scheme?
(page 101)
• How will the 3.4.375 Backup Scheme change after upgrading to 3.4.380? (page 100)
• Why should I convert from the 3.4.370 Backups Scheme to 3.4.3.380 Backup Scheme?
(page 101)
• What is the pibackup_3.4.370.bat script? (page 102)
• What are there "Unknown" Last Modified Times listed in piartool –al? (page 102)
4. On the Summary tab, look at the Method Field. If this field says INCREMENTAL, then
the 3.4.380 backup scheme is in effect.
How will the 3.4.375 Backup Scheme change after upgrading to 3.4.380?
If you configured your backups in 3.4.375, the 3.4.375 backup scheme will still be in effect
after you upgrade to 3.4.380. This means that archives will still be selected for backup
according to the number of archives and/or the archive cutoff date that is configured in the PI
Server Backup scheduled task.
However, there will be a slight difference in the file copy behavior of the PI Backup
Subsystem. In 3.4.380, the PI Backup Subsystem always skips file copies for any archive that
has the same file size and last modified date in the source and target directories. Previously,
in 3.4.375, such file copies were skipped only on Mondays and this functionality was referred
to as incremental backups. In 3.4.380, the meaning of incremental backups has changed.
Another change is that backup verification will start occurring automatically without any
need to reconfigure your backups.
100
Configure a Daily Backup Task
Why should I convert from the 3.4.375 Backups Scheme to 3.4.3.380 Backup
Scheme?
The 3.4.380 backup scheme offers true incremental backups. With this scheme, the scheduled
backup task backs up all archives that have changed since the last scheduled backup. In the
3.4.375 backup scheme, you cannot back up all files that have changed; you can only specify
a particular number of archives or an archive cut-off date as the selection criteria for the
backup. This means you might miss some modified archive files in the backup.
It is possible to configure a 3.4.375-style backup to be effectively the same as a the new
3.4.380 backup scheme. However, the 3.4.380 backup scheme is easier to manage and
guarantees that any archives that have been modified are included in the backup.
To configure a 3.4.375-style backup to be a true incremental backup, you need to keep a full
PI Server backup in your scheduled backup directory and you need to select all archives for
backup. Because of the changes to the backup tools in 3.4.380, file copies are always skipped
for any file that has the same last modified date and file size in the source and target
directories.
How will the 3.4.370 Backup Scheme change after upgrading to 3.4.380?
If you configured your backups in 3.4.370, the 3.4.370 backup scheme will still be in effect
after you upgrade to 3.4.380. If PI is installed on Windows Server 2003 and you are using
NtBackup.exe to backup the PI Server, your backups should behave in exactly the same
manner as they did before the upgrade.
If PI is installed on Windows 2000, the non-VSS backups will behave in a similar fashion as
they did before the upgrade. Archives will still be selected for backup according to the
number of archives and/or the archive cutoff date that is configured in the PI Server Backup
scheduled task. There will, however, be a slight difference in the file copy behavior of the PI
Backup Subsystem. In 3.4.380, the PI Backup Subsystem will always skip file copies for any
archive that has the same file size and last modified date in the source and target directories.
In 3.4.370, file copies would never be skipped. Another change to the non-VSS backups is
that backup verification will start occurring automatically without any need to reconfigure
your backups.
Why should I convert from the 3.4.370 Backups Scheme to 3.4.3.380 Backup
Scheme?
The 3.4.370 backup scheme has a number of limitations:
• VSS backups in 3.4.370 used NtBackup.exe. NtBackup.exe is no longer delivered with
Windows beginning with Windows Vista/Windows Server 2008. Further, NtBackup.exe
creates a single backup file called PI_Backup.bkf. Unlike the new backup scheme, files
do not accumulate in the backup directory. A backup of the single PI_Backup.bkf file
typically does not correspond to a full backup of the PI Server.
• You cannot back up all files that have changed as you can with the new incremental
backups in 3.4.380. You can specify only a particular number of archives or an archive
cut-off date as the selection criteria for the backup; this means you might miss some
modified archive files in the backup.
What are there "Unknown" Last Modified Times listed in piartool -al?
After upgrading, the last modified times of some archive files may appear to have Unknown
last modified times as displayed by piartool -al. These archives have had their last modified
time reset to a universal coordinated time of 1-Jan-70 because their last modified time was
more recent than their last backup time before the upgrade. Prior to 3.4.380, the last modified
time could not be used as a reliable mechanism for incremental backups. As a conseque nce of
resetting the last modified time, only those archives that have been modified subsequent to
the 3.4.380 upgrade are backed up for incremental backups.
102
Configure a Daily Backup Task
If you decide to backup the secondary node, keep in mind that the files used to create
customized backups, pintbackup.bat and pisitebackup.bat, are copied to the secondary
node when the secondary node is synchronized to the primary. For this reason, these files
should be written so that they will work on both nodes of the collective. The
pisitebackup.bat.example was written with this in mind.
When restoring a secondary node from backup, keep in mind that the data that will be
restored in the primary and secondary nodes will not be identical due to slight differences in
timing as to when the backups are taken and due to slight differences in timing as to when
data arrives to the primary and secondary nodes. You can use the archive editor Plug-In from
the PI System Manager tools to independently examine the data the in the various nodes in
the collective.
After you upgrade a PI Server, you need to establish a baseline backup (new installations do
not require a baseline backup). You have two basic configurations to choose from:
• If you plan to keep a full backup of the PI Server in the backup directory itself, then you
use the following command (from the PI\adm directory) to establish the baseline
backup:
piartool.exe –backup backupdir –type full –arcdir -wait
where backupdir is the full path to the backup directory. The path can be a UNC path.
Here are a few examples of valid paths:
C:\pibackup\
\\myserver\c$\pibackup\
\\myserver\share\pibackup\
Note: The UNC path can be a path to a shared directory on a remote computer, but
mapped network drives cannot be used in the full path.
location. In this case you use the following command (from the PI\adm directory) to
establish the baseline backup:
piartool -backup backupdir -numarch num -arcdir -wait
where backupdir is the full path to the backup directory, as above and num is the number
of archives you want to keep in the backup directory. For example, specifying -
numarch 2 backs up the primary archive and archive 1, provided that the primary
archive and archive 1 contain data. Empty archives are not identified for backup. So, to
establish a baseline backup with four archives and D:\PI\backups as the backup
directory, you would change to the PI\adm directory and type the following command:
piartool -backup D:\PI\backups -numarch 4 -arcdir -wait
Note: On Windows 2000 Server, the task name will be of the form Atn, where n is
the next available task number when the task was created. If you have
installed the scheduled task on Windows 2000, rename the scheduled task to
PI Server Backup by right-clicking the task name and choosing Rename.
5. Open the scheduled task to verify that it got created. On Windows 2000 Server and
Windows Server 2008, open the Scheduled Tasks Windows Control Panel. On Windows
Server 2008 and Windows Server 2008 R2, open the Task Scheduler Windows Control
Panel under Administrative Tools.
6. Optional: Configure site-specific files for backup. See Configuring Site-Specific Files
for Backup (page 107).
7. Optional: Customize the scheduled backup task. You can change the time the task runs,
the name and location of the scheduled backup directory, and so on. See Customize the
Default Backup (page 108).
8. Configure step 2 of the Two-Step backup.
104
Configure a Daily Backup Task
Backup Verification
By default the PI Server Backup task performs an incremental backup of PI Server files.
The PI Backup Subsystem attempts to maintain a consistent backup without corrupt or
partially copied files in the PI Backup directory. It does this by temporarily copying files to a
precommit directory before moving the files to their final destination. This precommit
directory is a subdirectory under the PI Server backup directory. If the backup is aborted, if
the PI Backup Subsystem crashes, or if the files in the precommit directory do not pass
verification, the files in the precommit directory are not moved to their final destination.
Therefore, unless some corruption was not detected, the last good backup should always be
available.
The following illustration represents a simplified view of a typical backup. First, the
components represented by the yellow blocks are selected for backup. Second, the files
corresponding to these components are copied to a precommit directory. Third, the primary
archive and the files that correspond to the base and snapshot subsystems are verified in the
precommit directory. Finally, if verification passes, the files are moved to the backup
directory. Any files with the same name that already exist in the backup directory are
renamed before the move operation. If all move operations are successful, the renamed files
are deleted.
If the backup fails verification, the files are left in the precommit directory, and the reason for
the failed backup id s logged in a pibackupverify_*.log file written to the PI Server
backup directory. If successive backups fail verification, files will start accumulating in the
precommit directory. After the next successful backup, all files are copied to their final
destination.
The following table shows commands that the PI Backup Subsystem spawns to perform the
verification.
Com ponent Verification Comm and
Archive components pidiag -archk
pibasess pibasess -verifydb
pibasess pidiag -fb
Although only the primary archive is verified by default, the number of archives to be
verified can be set with the BackupVerification_NumArch tuning parameter. Alternatively,
all verification can be suppressed by setting the BackupVerification tuning parameter to 0.
Although the last good backup should not be corrupt, it is still imperative to backup the PI
Server backup directory, preferably with third-party backup software. For example, if you
accidentally delete a PI Point and subsequently perform a backup, the PI Point is deleted in
the last good backup as well. To retrieve the deleted PI Point, you might need to restore a
previous backup. If you are not keeping multiple backups of your PI Server backup directory,
there will be no means to do this restore.
106
Configure a Daily Backup Task
Backing up the files in your backup directory is a crucial step to safeguarding your PI Server.
The backup directory contains only the most recent backup. As new backup files are copied
into the backup directory, the old backup files are overwritten. This means that the backup
directory contains only the most current verified backup. This does not help you if you need
to restore to an older backup.
For example, suppose you discover that two days ago you accidentally deleted a point. You
cannot recover the deleted point from the files in the backup directory because the last backup
occurred after the point was deleted. You need to recover the point from an earlier backup.
Your backups of the PI Server backup directory will provide the backup history that allows
you to restore the point.
The recommended method of backing up the PI Server backup directory is to use a third-
party backup program. You can use any backup strategy that is available with the third-party
backup program. For example, you might choose to do a combination of full and incremental
backups, full and differential backups, a combination of full, incremental, and differential
108
Configure a Daily Backup Task
backups, and so on. The exact terminology and strategies vary from backup program to
backup program.
If third-party backup software is not available, you can use the pisitebackup.bat script to
automatically copy the backup directory to a remote computer. The
pisitebackup.bat.example file contains instructions for setting this up.
Next, follow the procedure below to run a couple of test backups. In this example, the backup
directory is assumed to be E:\pibackup\ and the PI Server directory is assumed to be
C:\pi\.
1. Run the pige tmsg -f command to monitor messages that are written to the PI Message
log during the backup.
2. In the Windows Task Scheduler, start a test backup by right-clicking on the PI Server
Backup scheduled task and selecting Run. Files will be backed up to the following
directories.
ο Archives will be backed up to E:\pibackup\arc\.
ο Files from C:\pi\dat, C:\pi\adm, C:\pi\log, and C:\pi\bin are
backed up to E:\pibackup\dat, E:\pibackup\adm, E:\pibackup\log,
and E:\pibackup\bin, respectively.
3. Monitor the PI Message Log messages from the pige tmsg -f command. At the beginning
of the backup, you should see the message Backup operation started. You
may see -15033 errors because the PI Message Subsystem is briefly unavailable for
logging during the backup. Because of this, you may not see the Backup operation
completed successfully message in the pige tmsg -f output, even though the
message does eventually get written to the message log. You can tell when the backup is
complete by examining the task status in the Windows Task Scheduler or from the output
of the piartool -backup -query command.
4. After the backup is complete, examine the backup log in E:\pibackup\. The log will
have a name of the form pibackup_dd-MMM-yy_hh.mm.ss.txt.
ο Near the beginning of the log you will see the list of the currently registered archives.
This archive list can be helpful during restore operations. For example, when
restoring the PI Server, it is helpful to know at the time of the backup which archive
was the primary and which directories the archives were in.
ο At the very end of the log you should see the message pibackup.bat script
completed successfully if the backup was successful.
ο The log contains a Verbose File Backup Report indicating which files were copied to
the backup directory.
ο The log displays the list of subsystems that were registered for backup and the
subsystem version numbers.
ο The log also contains a summary of the backup that looks similar to the following.
Backup in Progress: FALSE
Files Copied: 24
Files Skipped: 36
File Copy Failures: 0
Total File Count: 60
Last Backup Start Pending: 1-Nov-09 03:15:05
Last Backup Start: 1-Nov-09 03:15:26
End: 1-Nov-09 03:15:42
Status: [0] Success
Last Backup Type: INCREMENTAL, VSS, Component
Mode
Last Backup Event: BACKUPSHUTDOWN
Last Backup Event Time: 1-Nov-09 03:15:43
Verification Start Time: 1-Nov-09 03:15:42
VSS Supported: TRUE
The type of the backup should be INCREMENTAL, which is true for all newly ins talled
backup tasks in 3.4.380. The first incremental backup of a newly installed PI Server should
be equivalent to a full backup. A backup type of NUMARCH/CUTOFF is possible only if the
backup task is left over from an upgrade.
Fundamentally, the only way to know for sure whether your backup is working correctly is to
periodically restore a backup. It is not sufficient to restore the latest backup from your
scheduled backup. Instead you should restore one of the backups taken from your third-party
backup software or from pisitebackup.bat.
OSIsoft recommends that you monitor the following Windows performance counters for the
PI Backup Subsystem:
• Last Backup Failed will be 1 if the last backup failed; otherwise it will be 0.
• Backups Started should increase by 1 every night if you have a nightly backup
task installed.
• Failed Backups will inc rease by 1 for every failed backup.
All of these counters are reset to 0 when the PI Backup Subsystem is restarted. The values for
these performance counters can be stored into PI Points with the PI Performance Monitor
interface, the basic version of which is installed by default on the PI Server node.
If you have PI Notifications, you can configure e-mail alerts based on Last Backup
Failed or Failed Backups. Otherwise, you can view the values of these performance
counters with PI ProcessBook.
110
How to Monitor and Maintain Your Scheduled Bac kups
If the pisitebackup.bat fails or if a third-party backup of your backup directory fails, this is
not reflected in Last Backup Failed or Failed Backups.
Although you can perform on-demand backups in SMT by clicking the Backup Now icon ,
the main purpose of the backup plug-in is to monitor your backup history. On-demand
backups with SMT should be used only for troubleshooting purposes. They are not a
substitute for regularly scheduled backups.
To do check the backup history for a PI Server, use the SMT Backup tool. Follow these steps:
1. Open PI SMT.
2. Check the check box for the PI Server in the Collectives and Servers panel.
3. Select Operation > Backups.
4. Select the Server from the PI Server drop-down menu. The menu includes all of the
servers that are selected in the Collectives and Servers panel. The backup history for
that Server appears.
5. Right-click on the column headings to see a complete list of columns you can display in
this table.
6. Double-click on a backup entry to see the details for that particular backup. You can
choose to view a backup summary or the entire list files that were backed up.
By default, you can view reports for the last 100 PI Server backups. These reports only tell
you whether or not the backup of the PI Server itself was successful. The reports do not tell
you whether or not your pisitebackup.bat script ran successfully or whether or not a third-
party backup of the backup directory was successful.
The history tells you the Type of backups that are being performed. If the Type column is not
shown, you can right-click on the column header and add it from the drop down menu. The
following backup types are possible.
Periodically examine the backup logs in the PI Server backup directory. These logs have a
name of the form pibackup_DD-MMM-YY_hh:mm:ss. You can determine whether the PI
Server backup and the pisitebackup.bat script ran successfully by examining this log.
PI SMT allows you to search the message logs for messages from the backup subsystem. If
you think there might be a problem with your automated backups, or with the backup
subsystem, this is a good place to look. Follow these steps:
1. Open PI SMT.
2. Select Operation > Message Logs. From here you can look at all the message logs
produced by PI.
3. Under Time, select the time period that concerns you.
112
How to Restore a Backup to an Existing PI Server
5. Click the Retrieve Messages icon on the tool bar. The log messages appear. Check the
log messages for errors. You can select a message to see more details about it.
114
Restore a Server Backup to a New Computer
a. Register the primary archive in the new location with the following command from
the PI\adm directory:
pidiag –ar
After this command completes, only the primary archive will be registered.
If you are uncertain which of the backed up archives is the Primary Archive (archive
0), use pidiag -ahd and examine the archive dates. The primary should have the
latest start date and an end date of "Current time." The syntax of the command is:
pidiag -ahd C:\TempRestoreDir\arc\piarch001.dat
After you start the PI Server in a later step, register additional archives with the
piartool -ar command. For example:
piartool -ar path_and_archive_file_name
12. If the backup was performed using PI Version 3.4.370 or greater, then skip this step
because the snapshot is backed up as of 3.4.370. Otherwise, follow steps a – b below.
a. Rename the PI\dat\piarcmem.dat to PI\dat\piarcmem.dat.old.
b. Re-create the snapshot file with the command:
\pi\bin\pibasess -snapfix
13. Start the PI Server.
14. If you had to run pidiag -ar earlier in the procedure, register additional archives with the
piartool -ar command now.
15. Use piartool -al and the client tools (PI ProcessBook and PI DataLink) to verify that all
the data has been recovered. If the data is intact, you are done. Run the clients locally,
since the PI Server should be isolated from the network. It is very important to confirm
correct PI Server recovery before exposing the PI System to buffered data. Failing to do
so may cause data loss.
16. Connect the PI Server to the network. Verify the PI Server is reachable from clients on
the network. Monitor all buffered interface nodes.
Note: The PI Server will not allow registering archives with overlapping dates. If you find
overlapping dates, you can use pidiag -ahd to check the exact start and end
times.
Many databases are interconnected. For example, the Point Database must be synchronized
with the Snapshot and Primary Archive. Generally, if one database must be restored from
backup, all databases must be restored from backup, as well as the primary archive. Partial
backup restoration should be done under the advice of OSIsoft Technical Support.
To restore a database, shut down the PI Server. Replace the existing database files and the
Primary Archive from the most recent backup. Restart the PI Server.
The scheduled backup task calls the pibackuptask.bat script to launch the backup. The script
calls pibackup.bat and redirects the standard output to a backup log. The backup log is
written to the target directory of the backup and the log file has a name of the form:
pibackup_dd-mmm-yy_hh.mm.ss.txt
For example:
pibackup_5-Aug-05_14.16.22.txt
This script can be used to install a backup as described in Create the Scheduled Backup Task
(page 104). The pibackup.bat script performs the actual backup of the PI Server and calls the
116
The PI Server Bac kup Scripts
pisitebackup.bat script after backing up the PI Server. When the backup task runs, the
pibackuptask.bat script is called directly, which itself then calls pibackup.bat.
The pibackup.bat scripts starts the backup of the PI Server by running a single piartool -
backup command.
Note: Do not directly customize the pibackup.bat script. This script is overwritten on PI
Server upgrades.
After the backup of the PI Server has completed, pibackup.bat calls pisitebackup.bat,
provided that pisitebackup.bat exists.
The pisitebackup.bat script can be used to::
• Backup site-specific files. See Include Site-Specific Files from PIPC Directory (page
107) for instructions.
• Copy files from the backup directory to a safe location. This should be done only if a
3rd-party backup program is not available.
• Trigger a backup of the backup directory with a third-party backup program.
The pisitebackup.bat does not exist by default. However, the PI Server installs the
pisitebackup.bat.example file to the PI\adm\ folder. By simply removing the .example
extension, the script backs up all files ending in .bat, .log, .ini, .txt, and .sql under
the 32-bit and 64-bit PIPC home directories. If you want to backup any other files or do any
other task, you must customize the script. Customization instructions are in the
pisitebackup.bat.example file itself.
Note: The pisitebackup.bat script is not overwritten when the PI Server is upgraded.
The pibackup_3.4.370.bat script is created by the PI Server installation only when upgrading
from 3.4.370 to 3.4.375 or greater. The purpose of the pibackup_3.4.370.bat script is to
maintain the behavior of the backups from 3.4.370 so that a user’s site-specific backup is not
broken by the upgrade.
The pibackup_3.4.370.bat script is created by the PI Server installation only when upgrading
from 3.4.370 to 3.4.375 or greater. The purpose of the pibackup_3.4.370.bat script is to
maintain the behavior the backups from 3.4.370 so that a user’s site-specific backup is not
broken by the upgrade.
Troubleshooting Backups
This section explains how to identify common backup problems.
• Log Messages (page 118 )
• Performance During Backups (page 118)
• Common Problems with VSS Backups (page 119)
• Failure Due to Offline Subsystem (page 119)
Log Messages
Any backup on the PI Server node has the potential to impact PI Server performance. You
can largely avoid this impact by using the recommended disk configuration (Recommended
Disk Configuration (page 99)). However some impact is unavoidable because CPU resources
and file system cache resources are consumed.
Monitor your PI Server during a backup to determine how the backup affects archiving rate,
archive reads, and the CPU usage of the PI Server. Also monitor the Windows Performance
118
Troubleshooting Backups
counters Avg Disk Write Queue Length and Avg Disk Read Queue Length for the
Physical Disk performance object. If the disk queue length is greater than one, then the disk is
falling behind.
Once a subsystem registers for backup, the subsystem must remain online during the next
backup or else the backup will fail with the following error:
Backup start failed, Status: [-16896] RPC Resolver offline for a
subsystem to which the backup subsystem is communicating. Find
-10733 error in message log to identify problematic RPC
Two messages will appear in the PI Server Message log with the -10733 error similar to the
follow ing:
E 19-Oct-09 13:54:57 pibackup (5059)
>> Callback failed for <pibatch> for the IDENTIFY event. Error
[-10733] PINET: RPC Resolver is Off-Line.
E 19-Oct-09 13:54:57 pibackup (5061)
>> Error [-10733] PINET: RPC Resolver is Off-Line., failed to
send the IDENTIFY backup event to pibatch
To fix the problem, you can either start the subsystem that is not running, or you can do the
following, if the subsystem was purposefully stopped:
1. Run the command piartool -backup -query and make note of the subsystems that are
currently registered for backup.
2. Restart the PI Backup Subsystem.
3. Wait for the previously registered subsystems to register for backup again, with the
exception of the problematic subsystem. Subsystems may take up to 5 minutes to re-
register for backup after the backup subsystem has been restarted.
120
Chapter 6
Manage Interfaces
About PI Interfaces
PI interfaces are software modules for collecting data from any computing device with
measurements that change over time. Typical data sources are Distributed Control Systems
(DCSs), Programmable Logic Controllers (PLCs), OPC Servers, lab systems, and process
models. However, the data source could be as simple as a text file. Most interfaces can also
send data in the reverse direction, from PI to the foreign system.
We refer to a computer running one or more PI Interfaces as a PI Interface Node. In most
cases, you should not run interfaces on the PI Server computer. Running interfaces on a
separate node allows the PI Server to be taken down for maintenance while data is still
collected and buffered on the Interface Node. Also, you do not want interfaces competing for
computer resources with the PI Server.
For most interfaces, it is important to configure buffering on the Interface Node. This
prevents loss of data when the PI Server is not available for some reason (such as an upgrade
on the Server). The exceptions are:
• Some interfaces do not require buffering because the data source itself is buffered. For
example, the UFL Interface and batch interfaces such as the Emerson DeltaV Batch
Interface do not require buffering.
• There are a very few interfaces that should not be run with buffering. Consult the
documentation for your interface.
The majority of OSIsoft interfaces use the PI Application Programming Interface (PI API) to
retrieve configuration information from the PI Server and to write data to the PI Server. A
few non-batch interfaces also use the PI Software Development Kit (PI SDK) to retrieve
configuration information from the PI Server and to create PI Points, Digital States, and so
on. Almost all batch interfaces use the PI SDK to write batch data to PI. The PI API and the
PI SDK are described in more detail below.
There are hundreds of different PI interfaces and each interface is fully documented in its
own dedicated manual. However, most interfaces are based on UniInt therefore share a
common set of features.
About UniInt
Most interfaces written by OSIsoft are written using UniInt, UniInt stands for Universal
Interface. UniInt is an OSIsoft-developed template used by the OSIsoft developers that is
integrated into many interfaces. The purpose of UniInt is to keep a consistent feature set and
behavior across as many of our interfaces as possible.
UniInt performs many tasks that need to be performed by most interfaces: such as loading
points, parsing command line, arguments, and scheduling scans for data. UniInt-based
interfaces use some of the UniInt supplied configuration parameters and some interface-
specific parameters. UniInt uses the standard PI API to write and read data from the PI
Server.
The PI Application Programming Interface (PI API) is a library of functions that allow you to
read and write values from the PI Server, and also let you retrieve point configuration
information. OSIsoft has used the API to create interfaces that run on a variety of platforms.
The PI API also provides the ability to buffer data that is being sent to PI. This allows PI to
be taken offline for software or hardware upgrades without compromising data collection.
When PI becomes available again, the buffered data are then forwarded to PI.
API Nodes are workstations that run programs such as interfaces that are based on the PI API.
In practice, the term API Node is sometimes used as a synonym for Interface Node, because
historically, most interfaces are API based.
You can call PI API from C, C++, Visual Basic, or other languages. For more information on
the PI API, refer to the PI API Programmer's Help. You can access this from the PI SDK help
file.
The PI Software Development Kit, (PI SDK), is an ActiveX in-process server that provides
COM access to OSIsoft historians. The product provides an object-oriented approach to
interacting with PI systems in contrast to the procedural methods used in the PI API.
The PI SDK can only be installed on Windows. Only interfaces that run on Windows can take
advantage of the functionality provided by the PI SDK. All interfaces written for UNIX or
VMS must use the PI API exclusively for all communication with the PI Server.
Some interfaces use the PI SDK because certain functionality is not provided via the PI API.
For example, the PI SDK allows interfaces to create points, digital sets. Also, any interface
that writes batch data to PI, such as the PI Batch Generator Interface (PIBaGen), must use the
PI SDK to write its data.
Any data that is written to PI via the PI SDK is not buffered via the BufServ service. For this
reason all interfaces write time-series data to the PI Server via the PI API.
Interfaces that connect to the PI Server with both the PI SDK and the PI API must maintain
two separate connections to the PI Server.
Each PI Server includes several interfaces. These interfaces are installed in the
pipc\Interfaces directory. Each interface is installed in its own subdirectory, and each
has an accompanying user manual. This section briefly lists the interfaces included in the PI
122
About PI Interfaces
Server installation, grouped according to function. For more information, see the user manual
for the relevant interface.
The following interfaces are useful to monitor the health of your system and network. The
basic version of each interface is installed. These basic versions must be run on the PI Server
and have limited point counts and other restrictions. Full versions of these interfaces are
available. See the interface user manuals for more information.
• PerfMon reads Windows Performance Counters and stores the values in PI points. This
interface is located in pipc\Interfaces\PIPerfMon_Basic.
• SNMP collects performance data from computer systems and network routers using the
Simple Network Management Protocol, and stores the values in PI points. This interface
is loc ated in pipc\Interfaces\SNMP_Basic.
• Ping monitors the network availability of computer systems by pinging them and stores
the response times in PI points. This interface is loc ated in
pipc\Interfaces\PING_Basic.
The PI Interface Status Interface is a utility that determines whether an interface program is
writing new values to its points. PI Interface Status periodically checks whether a particular
PI point, known as the watchdog tag, is receiving new values. This interface is located in
pipc\Interfaces\PIIntStatus.
Random and Ramp Soak are simulator interfaces that can be configured to simulate random,
sinusoidal, and batch data. By default they are installed on the PI Server, but you can run
them remotely. These interfaces are located in pipc\Interfaces\Random and
pipc\Interfaces\rmp_sk respectively.
The PI Batch Generator Interface (PIBaGen) collects data from the PI Server, generates
batch data and writes the batch data to the PI Server in the PI Batch Database. PIBaGen is
used when there is no native interface to generate and store batch data in the PI System.
PIBaGen should be run directly on the PI Server. This interface is located in
pipc\Interfaces\PIBaGen.
In addition to this document, the following OSIsoft manuals provide general information with
regard to interface configuration and management. They are available on the OSIsoft
Technical Support Web site: http://techsupport.osisoft.com (http://techsupport.osisoft.com)
Manual Nam e Notes
PI API Installation On Window s, this manual is installed into the pipc\bin directory
Instructions by the PI SDK installation kit. The manual provides several
important post-installation details for configuring the PI A PI and
buffering.
PI Buffer Subsystem User On Window s, the PI Buffer Subsystem provides an enhanced
Guide buffering solution designed specifically for High Availability ( HA).
This manual describes how to install and configure the Buffer
Subsystem.
1. Confirm that you can use PI SMT to configure the PI Server. You need not run PI SMT
on the same computer on which you run this Interface.
2. If you are running the Interface on an Interface Node, edit the PI Server’s Trust Table to
allow the Interface to write data.
3. Run the installation kit for PI Interface Configuration Utility (ICU) on the interface node
if the ICU will be used to configure the interface. This kit runs the PI SDK installation
kit, which installs both the PI API and the PI SDK.
124
Interface Installation Chec klist
4. Run the installation kit for this Interface. This kit also runs the PI SDK installation kit
which installs both the PI API and the PI SDK if necessary.
5. If you are running the Interface on an Interface Node, check the computer’s time zone
properties. An improper time zone configuration can cause the PI Server to reject the data
that this Interface writes.
6. Run the ICU and configure a new instance of this Interface. Essential startup parameters
for this Interface are:
ο Point Source
ο Interface ID
ο PI Server
ο Scan Class
7. Use the Connection Tool to confirm connection between the Interface Node and the
device.
8. If you will use digital points, define the appropriate digital state sets.
9. Add the X, Y, and Z states to the System State Set.
10. Build input tags and, if desired, output tags for this Interface.
11. Start the Interface interactively and confirm its successful connection to the PI Server
without buffering.
12. Confirm that the Interface collects data successfully.
13. Stop the Interface and configure a buffering application (either Bufserv or PIBufss).
14. Start the buffering application and the Interface. Confirm that the Interface works
together with the buffering application by either physically removing the connection
between the Interface Node and the PI Server Node or by stopping the PI Server.
15. Configure the Interface to run as a Service. Confirm that the Interface runs properly as a
Service.
16. Restart the Interface Node and confirm that the Interface and the buffering application
restart.
Interface Diagnostics
1. Configure the Interface for Disconnected Startup. Refer to the UniInt Interface User
Manual for more details on UniInt Disconnect startup.
2. Configure UniInt Failover, see that section in this document for details related to
configuring the interface for failover.
126
Chapter 7
128
View System Messages
To view messages in SMT, select Operation > Message Logs. To narrow your message
search in PI SMT, you can use the Source, Message and Count menus. By default, Message
Filter Options are set to display messages from connected PI servers:
• over the past 5 minutes, and
• without filtering for content.
To use the message filter options you may:
• Select the Refresh Automatically check box if you need to review more than 25 log
messages.
• Select a message source from the Source menu, which lists all source programs found in
the list of displayed messages.
• Enter contents from the Message column or diagnostic information of the message.
• Indicate the maximum number of messages you would like to retrieve.
• Enter a Start time in a PI time format; the value may be either a relative time or an
absolute time.
• Enter an End time in a PI time format; the value may be either a relative time, or an
absolute time.
Note: The end time is not used when navigating forward or backward with the
toolbar. To reset the end date and time to current time, right-click anywhere in
the End frame and select the Set to Current Time menu item. The wildcard
character is asterisk (*).
Interpret a Message
Severity Levels
There are 5 severity levels defined (in order of greater to lesser severity): Critical, Error,
Warning, Information and Debug. The leading character indicates the severity level.
• Critical: Loss of System Functionality. Requires immediate attention. Here is an example
of a critical message:
C 23-Jul-08 09:27:46.243
piarchss:piarcmgr (2050)
>> Primary archive file failed to load or has invalid dates.
Archiving will be turned off.
Note the first character, C, which indicates that this is a critical error.
• Error: Action failed. Here is an example of an error message:
E 23-Jul-08 09:27:46.243
piarchss:piarcmgr (2049)
>> Failed to load archive file F:\PI Archives\8-Sep-04_14-
Sep-04: [3] The system cannot find the path specified.
• Warning: An anomaly has occurred that does not impact the user (yet). Here is an
example of a warning message:
W 23-Jul-08 09:41:32.733 piarchss:pievqreader
(6012)
>> Invalid queue creation path "E:\PI\dat\", using default
location
• Information: Action succeeded. Here is an example of an information message:
I 29-Jul-08 18:31:53.211
pinetmgr (7039)
>> Connection accepted: Process name: pigetmsg(6260) ID:
3
• Debug: Debug/Tracing message. Here is an example of a debug message:
D 29-Jul-08 15:22:59.421
pibackup (5136)
>> PIvsswriter::OnFreeze. succeeded
The message definition file stores information about the messages. This database associates a
message ID with each message, along with the message text, parameters, severity, and other
information. The message definition file is called pimdf.dat and it is stored in the
PI\dat directory.
130
View System Messages
Every product installation may update the definition with new messages. If the message
definition file is not present, or is an old version, then some messages may not be able to be
rendered into readable text. In this case the message will read something like:
E 29-Jul-08 17:44:17
pibasess (8020)
>> Unknown Message # 8020
To see what version of the message definition file is ins talled, type :
pidiag -mdfv
Messages with an ID of 0-5 are considered free form. This means that they don't require a
definition in the message definition file to be read. All messages generated prior to the
introduction of the message database have an ID 0. With the introduction of the message
database, five new IDs for free-form messages (1-5) are introduced, one for each severity
leve l.
ID Severity Level
1 critical
2 error
3 warning
4 information
5 debug
Messages are written to the Windows event log if the Message Subsystem is not available.
On Windows, use the Event Viewer to see messages when PI is running as Services, or check
the command windows if running interactively. The PI Server messages that went to the
event log messages are stored back to the PI message log on system startup and on regular
time intervals.
Note: Some startup messages may be written to the Windows event log before the PI
Message Subsystem is active.
Use the pidiag utility to interpret any error codes that are included in the message logs. To
display the error message, enter:
pidiag -e errorcode
where errorcode is the error number displayed in the message log. Error code values may
be positive or negative.
Every few minutes, the pinetmgr sends a health check message to each of the PI
subsystems. If pinetmgr does not receive a response within a given amount of time, it
generates the following message and the subsystem (RPC resolver) is marked off-line:
>> Deleting connection: pisnapss, Subsystem Healthcheck failed.
If an RPC is made to a subsystem that is marked off-line, you will see this message:
[–10733] PINET: RPC Resolver is Off–Line
The output will include details if only the first part of a message was retrieved. In this
example, the message contains the message length. However, a timeout occurred when the
pinetmgr attempted to retrieve the rest of the message:
>> Deleting connection: pisnapss, Connection lost(1),
[-10731] PINET: incomplete message
Log Files
During normal operation, the PI Message Subsystem maintains central log files for messages
from all PI Server subsystems. PI Server creates a new log file every day, on universal time
coordinate (UTC) time, puts the log files in the PI\log directory and names each log
according to the date. The file names use the format, pimsg_YYYMMDD.dat, where:
• YYY is years since 1900. For example, if the year is 2007, YYY is 107.
• MM is the month. For example, if the month is January, MM is 01.
• DD is the day. For example, if it is the fifth of the month, DD is 05.
For example, the log file for January 5, 2007 is named pimsg_1070105.dat.
You can use the PI SMT Message Logs tool or the pige tmsg utility to view these PI Message
Log files and search for messages by time, subsystem, source, severity, or message ID. PI
Server must be running to view messages.
The PI Server creates a new log file every day and stores them for 35 days, before it
automatically purges log files. To keep log files beyond 35 days, you must back up the log
files before the PI Server deletes them. Then, if necessary, you may restore and investigate
the backed up files later.
132
Window s Performance Counters
Move PI Servers
PI Servers are designed for platform independence. All the databases and tables are stored in
a format that allows you to:
• move a PI Server to a different computer, or
• move a PI Server to a different location on the same computer, or
• migrate a 32-bit PI Server that is running on Windows x64 to a 64-bit PI Server on the
same computer.
These instructions describe how to move a Windows- or UNIX-based PI Server that is release
3.2.332 or greater. If your PI System is an earlier release, upgrade it before continuing.
Note: To move a VMS-based PI Server, you must first migrate your PI Server version
2.x to PI Server version 3.x. See the OSIsoft Technical Support Web site
(http://techsupport.osisoft.com/) for details on migrating VMS Servers.
Definitions
Term Definition
Source The original location of the PI Server before the move
Target The destination of the PI Server after the move
Buffering process Buffering of data occurs on the interface nodes w hile the PI Server is being
moved. Buffering processes include the PI Buffer Subsystem (pibufss) or the
API Buffer Server (bufserv).
Note: Some interface nodes can recover historical data from their data sources and
require neither the PI Buffer Subsystem nor the API Buffer Server. See
documentation specific to each interface to determine if an interface requires
buffering.
To minimize the amount of data buffered by interfaces, it is important to spend as little time
as possible completing the steps required to move a PI Server. OSIsoft recommends that you
review and become familiar with the procedure to move a PI Server before you begin.
To prevent data loss while moving a PI Server, take the following precautions:
• If the interface node uses buffering, verify that the buffering process is working properly.
To test buffering, remove the interface node from the network for a few minutes then
reconnect it. When the node is reconnected to the network, buffered data should be sent
to the PI Server and you should see a continuous flow of data in the application you use
to view PI Server data.
• If an interface node does not use buffering, verify that its history recovery process is
working properly. Remove the interface node from the network for a few minutes and
then reconnect it. When the node is reconnected to the network, the interface should
historically recover data from its data source and you should see a continuous flow of
data in the application you use to view PI Server data.
• If you plan on changing the IP Address or FQDN of the PI Server node during the move,
determine whether your interfaces connect by IP Address or by host name.
• Create a license activation file. The PI Server Installation and Upgrade Guide contains
instructions for this.
You can use the procedures in this section to move a standalone PI Server, or tomove either a
primary or secondary PI Server in a collective. The basic procedure in this section can be
followed without alteration if the following conditions are met:
• The archive directory corresponds to the same drive letter and directory paths on the
source and target servers. Otherwise, alter the procedure according to Different Archive
Directory (page 139).
• The event queue directory corresponds to the same drive letter and directory paths on the
source and target servers. Otherwise, alter the procedure according to Different Event
Queue Directory (page 140), which also describes how to determine the event queue
directory.
• The fully qualified domain name (FQDN) for the source and target servers are the same.
Otherwise, alter the procedure according to Different FQDN (page 140).
• The IP Address for the source and target servers is the same. Otherwise, alter the
procedure according to Different IP Address (page 141).
• The basic procedure assumes the operating system for the source and target servers is
Windows. Otherwise, alter the procedure according to Moving from UNIX to Windows
(page 142).
If your PI Server Setup is not reflected in any of these scenarios, contact OSIsoft Technical
Support (page 233) before you begin.
136
Move PI Servers
Note: Install the same PI Server version on the target node that is installed on the
source node.
Note: Forcing a shift ensures that the primary archive is nearly empty. When the
target node is eventually brought online, a flood of events will come in from
the buffered interface nodes, which can cause a nearly-full archive to shift. It is
better to force a shift ahead of time under controlled conditions.
3. Run the piartool -al command on the source PI Server and redirect the output to a file.
Record this file location; you will use the output later in the procedure to determine
which archive to move to the target node first.
4. Determine the directory where the PI Server writes its event queues. This directory is
determined by the Snapshot_EventQueuePath tuning parameter.
You can dump all tuning parameters with the following command:
piconfig table pitimeout ostru name,value ends exit
If Snapshot_EventQueuePath does not appear in the output, the event queue
directory is PI\dat.
5. Stop the source PI Server.
6. On the source server, use the Windows Control Panel to disable the PI Network Manager
Service. Disabling PI Network Manager ensures that the PI Server on the source
computer is not restarted accidentally.
7. Assign a new IP Address to the source node and rename it.
8. Restart the source node so that the new IP Address and source server name take effect.
The PI Server will not start again after the restart, provided you disabled the PI Network
Manager Service on the source server.
138
Move PI Servers
Note: If you configured the target PI Server to restart services automatically, the PI
Server starts and collects data after the reboot. If you want to prevent the PI
Server from starting after a reboot, disable the PI Network Subsystem Service
before rebooting, and then enable it after the reboot.
2. If the PI Server is not started after the reboot, start it manually with the
PI\adm\pisrvstart.bat command. The server should begin collecting data from
the buffered interface nodes.
3. Examine the PI Message Log. If you have intentionally not copied all archives to the
target PI Server node, you will see archive files not found errors, which can be ignored.
4. Copy the remaining archives from the source node. Restart the PI Archive Subsystem on
the target node to bring the remaining archives online.
5. Verify that the target node PI Server is functioning correctly. For example, verify that PI
Performance Equations, PI Totalizer, and PI Alarm perform as expected.
6. Configure backups on the target node. See Back up the PI Server (page 97).
7. Verify that the full path names in site-specific files, such as pisitebackup.bat, are
still valid.
attribute to 0 for these points. This setting will prevent -11043 errors when the target PI
system is first started.
• Change to Step 4: Register a new primary archive when the target PI Server is not
running before you reboot and continue with the remaining Step 4 tasks.
Note: The primary archive on the target server must be available and have enough
free space to handle a potential flood of buffered events from interface nodes,
because no empty archives will be available on the target server for an
archive shift. In this case, archives are stored in a new location and the PI
Server does not register them automatically when started on the target node.
ο To register the primary archive in a new location, run the pidiag -ar command.
When prompted, enter the full path name of the primary archive file copied to the
new archive location on the target PI Server. This creates a new
PI\dat\piarstat.dat file with only the primary archive registered.
ο As an additional precaution, you may want to disconnect the target server from the
network while initially bringing the target PI Server online. This allows you to
register the remaining archives before the flood of events from buffered nodes.
• Change to Step 4: After the target PI Server is bought online, only the primary archive
will be registered. Register the remaining archives with the piartool -ar command. You
can use wildcard characters to specify archive names to register archives in bulk.
Different FQDN
The following considerations apply to the basic procedure if the target node has a fully
qualified domain name (FQDN) different from the source node:
140
Move PI Servers
Note: Although this section describes many complicating factors that can arise from
changing the FQDN, it is not an exhaustive list. Contact OSIsoft technical support
if you have questions about changing the FQDN of the PI Server.
• While the source and target PI Servers are down, shut down the buffering process and
interfaces on all interface nodes. Configure the buffering process to point to the target PI
Server using the new FQDN. Change the startup command file for each interface to point
to the new server node.
• Bring the target server online and export the PI Module Database from the source node PI
Server, using the PI Module Database Builder add-in for Excel. Search for and replace all
references to the old server name with the new target server name. Then import the PI
Module Database contents into the target PI Server.
• Edit the PI SDK Known Servers Table (KST) on computers where SDK client
applications, such as PI ProcessBook and PI DataLink, are used. Leave the old entry in
the KST and change the pointer to the network node to reflect the new target server.
• All PI Servers are identified by the server hostname that is stored as ServerID in the
PIServer database table. When the PI Server is moved to a machine with a different
hostname, it is automatically given a new entry in the PIServer table the first time it runs.
To transfer the ServerID use piconfig to copy the ServerID of the target server from the
existing server. This approach allows you to transfer the ServerID without creating a new
entry and thereby avoid client application connection problems. For example, if
oldname is the previous name of the server and newname is the new name of the
server:
* (Ls - ) PIconfig> @tabl piserver
* (Ls - PISERVER) PIconfig> @ostr name,ServerID
* (Ls - PISERVER) PIconfig> @sele name=oldname
* (Ls - PISERVER) PIconfig> @ends
oldname,9166a4b4-7600-4fd8-8557-f20693fff729
* (Ls - PISERVER) PIconfig> @mode ed
* (Ed - PISERVER) PIconfig> @istr name,ServerID
* (Ed - PISERVER) PIconfig> oldname,0
*> oldname,0
* (Ed - PISERVER) PIconfig> newname,9166a4b4-7600-4fd8-
8557-f20693fff729
*> newname,9166a4b4-7600-4fd8-8557-f20693fff729
Different IP Address
If the target node has a different IP address, alter the basic procedure as described in this
section:
• As long as interfaces connect via the PI Server name rather than IP address, no corrective
action need be taken on interface nodes. If interfaces connect by IP address, the
procedures used to move the server using a different FQDN apply also to interface nodes.
• Change to Step 2: If PI Trusts are configured for the old server IP address, add a trust for
the new IP Address before stopping the source server.
You can remove a trust for an old IP address at any time after a move is complete. The IP
address of the server node is not required in the TRUST table unless there are interfaces
that run on the same machine as the PI Server and that connect by IP address.
To move a PI Server to a different directory on the same computer, follow these steps:
1. Move Archives
2. Move the PI Installation Directory
If you prefer not to move the directory where your archives are registered, skip to Move the
PI Installation Directory (page 143).
Move Archives
1. Create a new directory for the archives.
142
Move PI Servers
2. In the new archive directory, create a new archive and force an archive shift. You can use
the SMT Archives tool (Operation > Archives) to do this. After the shift, the new
primary archive will be the archive that you created.
3. Move each archive to the new archive directory, as follows:
a. Unregister the archive (you can use the SMT Archives tool).
b. Move the archive and the associated annotation file to the desired location.
c. Reregister the archive (you can use the SMT Archives tool).
Merge PI Servers
You can merge data from multiple PI Servers if would like to retire a PI Server yet preserve
its data. Use the merge process to stop using two or more PI Servers and transfer all data onto
another PI Server.
144
Merge PI Servers
4. Force an archive shift on the PI Server to be retired. See Force a Shift on the Retired
System (page 149) for details.
5. Shut down the retired PI Server. For instructions on how to stop a server, see Start and
Stop the PI Server (page 17).
6. Transfer Archives from the retired server to the destination server. See Manage Archives
(page 69) for instructions on how to transfer archives.
7. Create a Binary ID Conversion table on the destination server. See Create Binary ID
Conversion Table on Destination System (page 149) for details.
8. Convert the Retired Archives. See Reprocess the Archives on the Destination Server
(page 150) for details.
9. Verify that the merge is complete.
You must follow special steps to merge systems containing batch data. There are two types of
data stores for batch data in the PI Server; you must use different procedures to maintain and
process each of these distinct data stores. Batch data may be stored in either the PI Batch
Subsystem, or the PI Batch Database. To ensure you successfully merge batch data from your
PI Servers you must follow the procedures for each type of batch data stored on your PI
Server. For more information, see PI Batch Database Considerations (page 145) and PI
Batch Subsystem Considerations (page 145 ).
Note: If you are merging two PI Servers and only one server has Batch data, replicate
the PI Server that has the Batch data to the destination PI Server, as described in
Move PI Servers. Then follow the instructions in Merge the PI Servers (page 149)
and Merge Batch Data (page 151).
Note: You can also use these lists at the end of the merge process to verify the merge is
complete.
Note: All points do not need to be merged; just the points with a history that you
want to preserve.
4. Default points such as sinusoid have identical names on both servers. If you want to
preserve the history of default points on the retired server, rename the points. Otherwise,
delete the default points from the retired server.
146
Merge PI Servers
Note: This example assumes all tags are being merged. If all tags are not merged,
edit the output file or use a tag selection of other than "tag=*".
The ID conversion input file must only have entries of the format:
pointid,recno,tag
2. If your server has data stored in the PI Batch Subsystem, delete pibaN tags from the
input file, where N is an integer, from the input file you created for the Point ID
Conversion Table. You will move these points separately when you follow the
procedures in Merge Batch Data.
3. If your PI server stores data from the Batch Database or Module Database, delete storage
points for the Batch Database. To recognize storage points, look for these characteristics:
ο A point class of Base
ο Long GUIDs
ο A description that indicates the points are storage points for campaign, Batch,
UnitBatch or transfer records.
Note: Ensure that a new line follows the last entry of the input file.
Caution: If a digital set from the retired system already exists in the target system, verify
that the digital state sets names are identical for both servers before you complete
the merge. If the names are not identical, rename the digital state set before
transferring it to the new server.
Digital points created on the target system are assigned a digital set by name. During archive
conversion, only the offset is preserved, thus the data is interpreted according to the point's
current digital-set.
Note: The endsection command is not needed when creating the state set because
data lines are processed as they are entered.
148
Merge PI Servers
Note: If your server includes PI Batches, Module Database data, or data created by the
PI Batch Subsystem, see Merge Batch Data (page 151).
Note: This step will add data to the points transferred from the old server in the new
server archives; the output archive time range of the converted_archive_path
will be adjusted to that of the retired_archive_path.
3. Compare the data with the retired system to ensure correct conversion before proceeding
with other archives.
4. Proceed with the archive processing from oldest to newest and observe the changes in the
archive time ranges. If there are any overlapping archives in the converted archives, you
will need to use the offline archive utility to further process and combine these archives.
This may be time consuming, especially if there are many overlapping archives.
5. Register and view archives as they are completed.
150
Merge PI Servers
For a detailed example of the archive conversion process, see Reprocess the Archives (page
162).
Note: Complete the steps explained in Prepare the PI Servers (page 146) and Create
Points on Destination Server (page 149) before you start the steps explained in
this section.
MERGE PI BATCHES
1. Identify all the active tags (for UnitBatches, SubBatches) and all batch property tags
(BatchID, ProductName, PIBatch Index, etc).
2. Verify that all these tags exist on the destination PI Server. If you have not yet copied
tags to the destination system, see Prepare the Destination Server.
3. Using Module Database (MDB) Builder, import all the PI Units and PI Modules and
export them to the destination PI Server. Include the full module path when importing
and edit all server name entries to the correct value before exporting. For details, see
Merge Module Database Servers (page 153).
4. If the destination server already has the PIBaGen module, then edit the Properties to
match the property settings on the retired system. If there is no PIBaGen module on the
destination server then you must import the module from the old server by either using
the Module Database Builder or by dragging and dropping using System Management
Tools (SMT) as follows:
a. Under the %OSI module on the retiring system, find the module called PIBaGen.
Import this module and all its PIProperties. It should not have PIAliases.
b. If you are using the Module Database Builder, export these properties to the
destination server.
5. If there are PIHeadings on the retired server, then re-create all the PIHeadingSets and
their PIHeadings with the same name and level number on the destination server. You
can copy and paste PIHeadingsSets from one PI Server to another with the PI SMT
Module Database Plug-in.
6. If the destination server is a PI 3.4 or later server, then go to step 8. If the destination
server is PI 3.3 Server, then using MDB Editor on the destination server, add a dummy
PIUnitBatch (start time and end time do not matter), and then delete it. This action will
create the necessary header/tags for the PIUnitBatch storage. Also, add a dummy PIBatch
and delete it. This action will create the PIBatch storage. On a PI 3.4 server, the unit
batch storage tag is created as soon as the PIUnit is created and the PIBatch storage tag is
created during installation.
7. Stop all interfaces that are sending data to the PI Server. For details, see Stop Cutover
Interfaces (page 149). Then, continue with the remaining steps in Merge the PI Servers
(page 149).
152
Merge PI Servers
If you would like to make any changes to the SubBatch Hierarchy, do it after you have
verified the batch data was successfully merged. PIBaGen 1.x had only one level of
SubBatches. PIBaGen 2.x can create configuration for hierarchical subbatches. In order to
achieve that, the configuration must be modified after migrating. See the help files for the PI
SMT Batch Generator plug-in for details about how to configure SubBatch hierarchy.
Save the configuration if any changes are made. If the unit is not Registered (the Register
button is disabled and the Unregister button is enabled), then Register it if you want PIBaGen
to recover batches on that unit. Registering a PIUnit is equivalent to turning the SCAN ON
for a traditional PIPoint.
Start the PIBaGen Interface. Please note that the interface might take up considerable amount
of resources and time to recover all the batches for all these units. It really depends on how
many events need to be recovered. If you think there would be a lot of events, you can try
registering one unit at a time.
Note: You cannot merge Batch data this way. For details on how to merge data from a
batch database, see Merge Batch Data (page 151).
Retired Server
This list indicates the points that will be merged from the retired system to the destination
system. Point names have been modified.
BA:Active.1
BA:CONC.1Retired
BA:LEVEL.1Retired
BA:PHASE.1Retired
BA:TEMP.1Retired
batchid-1Retired
CDEP158Retired
CDM158Retired
CDT158Retired
piba1
pipe:sine2Retired
pipe:sine2tRetired
pipe:sine3Retired
pipe:sine4Retired
pipe:sine5Retired
pipe:sineRetired
pitot1Retired
pitot2Retired
pitot3Retired
pitot4Retired
pitot5estRetired
pitot5rampRetired
pitot5Retired
pitot5runRetired
pitot6countRetired
pitot6timeNERetired
pitot6timeRetired
pitot_1Retired
pitot_avgRetired
pitot_maxRetired
pitot_minRetired
productid-1Retired
sin:h2Retired
sin:hourRetired
SINUSOIDRetired
SINUSOIDURetired
t_minRetired
t_state1Retired
Archive: D:\PI\dat\piarch.002
PIarcfilehead [$Workfile: piarfile.cxx $ $Revision: 21 $]:
Version: 4 Path: D:\PI\dat\piarch.002
State: 4 Type: 0 Write Flag: 1 Shift Flag: 1
154
Merge PI Servers
Destination Server
This list reflects all of the points and archives that are currently on the destination system.
Use this list to compare points to ensure that duplicate point names do not exist.
BA:ACTIVE.1
BA:CONC.1
BA:LEVEL.1
BA:PHASE.1
BA:TEMP.1
batchid-1
CDEP158
CDM158
CDT158
piba2
pipe:sine
pipe:sine2
pipe:sine2t
pipe:sine3
pipe:sine4
pipe:sine5
pitot1
pitot2
pitot3
pitot4
pitot5
pitot5est
pitot5ramp
pitot5run
pitot6count
pitot6time
pitot6timeNE
pitot_1
pitot_avg
pitot_max
pitot_min
productid-1
sin:h2
sin:hour
SINUSOID
SINUSOIDU
test1
test10
test11
test12
test13
test14
test15
test16
test17
test18
test19
test2
test20
test3
test4
test5
test6
test7
test8
test9
t_min
t_state1
Archive: E:\PI\dat\piarch.001
PIarcfilehead [$Workfile: piarfile.cxx $ $Revision: 21
Version: 4 Path: E:\PI\dat\piarch.001
State: 4 Type: 0 Write Flag: 1 Shift Flag: 1
Record Size: 1024 Count: 2048
Offsets: Primary: 59/512 Overflow: 2037/2048
Start Time: 2-Mar-05 12:21:11
End Time: Current Time
Backup Time: Never
Archive: E:\PI\dat\piarch.002
PIarcfilehead [$Workfile: piarfile.cxx $ $Revision: 21
Version: 4 Path: E:\PI\dat\piarch.002
State: 4 Type: 0 Write Flag: 1 Shift Flag: 1
Record Size: 1024 Count: 2048
Offsets: Primary: 1/512 Overflow: 2047/2048
Start Time: Current Time
End Time: Current Time
Backup Time: Never
Archive: E:\PI\dat\piarch.003
PIarcfilehead [$Workfile: piarfile.cxx $ $Revision: 21
Version: 4 Path: E:\PI\dat\piarch.003
State: 4 Type: 0 Write Flag: 1 Shift Flag: 1
Record Size: 1024 Count: 2048
Offsets: Primary: 1/512 Overflow: 2047/2048
156
Merge PI Servers
Reactor1Retired,ba:active.1Retired,"'batchid-1Retired'", "Retired
Reactor 1","'productid-1Retired'"
158
Merge PI Servers
The text file requires modification. The PI Batch tag, piba1, cannot be migrated and
therefore, must be removed, as do any other tags that are not collecting data. Here are the
contents after the edit:
9,9,ba:active.1Retired
8,8,BA:CONC.1Retired
7,7,BA:LEVEL.1Retired
10,10,BA:PHASE.1Retired
6,6,BA:TEMP.1Retired
11,11,batchid-1Retired
5,5,CDEP158Retired
4,4,CDM158Retired
3,3,CDT158Retired
34,34,pipe:sine2Retired
35,35,pipe:sine2tRetired
36,36,pipe:sine3Retired
37,37,pipe:sine4Retired
38,38,pipe:sine5Retired
33,33,pipe:sineRetired
18,18,pitot1Retired
19,19,pitot2Retired
20,20,pitot3Retired
21,21,pitot4Retired
25,25,pitot5estRetired
24,24,pitot5rampRetired
22,22,pitot5Retired
23,23,pitot5runRetired
29,29,pitot6countRetired
31,31,pitot6timeNERetired
30,30,pitot6timeRetired
32,32,pitot_1Retired
26,26,pitot_avgRetired
27,27,pitot_maxRetired
28,28,pitot_minRetired
12,12,productid-1Retired
16,16,sin:h2Retired
14,14,sin:hourRetired
1,1,SINUSOIDRetired
2,2,SINUSOIDURetired
15,15,t_minRetired
17,17,t_state1Retired
Edit the text file to include the start time and end time for each unit and add an exit command
to the end. In this example, there is only one unit, and all the batches are merged; therefore
setting a very wide start and end time ensures that all batches are dumped. Here is the file
after editing:
D:\PI\adm>type unitlist.txt
Reactor1,*-1000d,*
@exit
The script and procedure for dumping the batches are:
D:\PI\adm>type pibatchlist.dif
@table pibatch
@mode list
@ostr unitname,bid,prodid,starttime,stoptime
@ostr ...
@istr unitname,searchstart,searchstop
D:\PI\adm>piconfig input pibatchlist.dif input unitlist.txt >
pibatchlist.txt
@exit
D:\PI\adm>type pibatchlist.txt
*> Reactor1,*-1000d,*
Reactor1,XYZ3,Green,2-Mar-05 11:58:20,2-Mar-05 13:09:20
Reactor1,XYZ25,Yellow,2-Mar-05 13:19:20,2-Mar-05 14:30:20
Reactor1,XYZ3,Green,3-Mar-05 12:24:23,12:44:00
* End Repeat...
* (Ls - PIBATCH) PIconfig> PIconfig 1 Data lines
8 Command lines
0 Records in error...
3 Records Listed
Pibatchlist.txt requires editing before input to the destination system. The unit name,
Reactor1 must be changed to the migrated name Reactor1Retired. Also, the piconfig creation
commands can be added to the top of the file. Here is the file after the edits:
@table pibatch
@mode create
@istr unitname,bid,prodid,starttime,stoptime
Reactor1Retired,XYZ3,Green,2-Mar-05 11:58:20,2-Mar-05 13:09:20
Reactor1Retired,XYZ25,Yellow,2-Mar-05 13:19:20,2-Mar-05 14:30:20
Reactor1Retired,XYZ3,Green,3-Mar-05 12:24:23,12:44:00
160
Merge PI Servers
At this point the retired system is no longer required. All of the text files must be copied to
the destination system. The archives to be merged must be copied to the destination system in
binary mode. In this example, the following archives are merged:
Archive: D:\PI\dat\piarch.002
PIarcfilehead [$Workfile: piarfile.cxx $ $Revision: 21 $]:
Version: 4 Path: D:\PI\dat\piarch.002
State: 4 Type: 0 Write Flag: 1 Shift Flag: 1
Record Size: 1024 Count: 2048
Offsets: Primary: 39/512 Overflow: 2025/2048
Start Time: 2-Mar-05 12:51:41
End Time: 3-Mar-05 11:15:03
Backup Time: Never
Archive: D:\PI\dat\piarch.003
PIarcfilehead [$Workfile: piarfile.cxx $ $Revision: 21 $]:
Version: 4 Path: D:\PI\dat\piarch.003
State: 4 Type: 0 Write Flag: 1 Shift Flag: 1
Record Size: 1024 Count: 2048
Offsets: Primary: 39/512 Overflow: 2047/2048
Start Time: 2-Mar-05 12:50:27
End Time: 2-Mar-05 12:51:41
Backup Time: Never
Archive: D:\PI\dat\piarch.001
PIarcfilehead [$Workfile: piarfile.cxx $ $Revision: 21 $]:
Version: 4 Path: D:\PI\dat\piarch.001
State: 4 Type: 0 Write Flag: 1 Shift Flag: 1
Record Size: 1024 Count: 2048
Offsets: Primary: 39/512 Overflow: 1901/2048
Start Time: 25-Feb-05 14:16:40
End Time: 2-Mar-05 12:50:27
Backup Time: Never
162
Merge PI Servers
Archive: E:\PI\dat\piarch.003
PIarcfilehead [$Workfile: piarfile.cxx $ $Revision: 21 $]:
Version: 4 Path: E:\PI\dat\piarch.003
State: 4 Type: 0 Write Flag: 1 Shift Flag: 1
Record Size: 1024 Count: 2048
Offsets: Primary: 98/512 Overflow: 2047/2048
Start Time: 3-Mar-05 16:32:27
End Time: Current Time
Backup Time: Never
Archive: E:\PI\dat\piarch.001
PIarcfilehead [$Workfile: piarfile.cxx $ $Revision: 21 $]:
Version: 4 Path: E:\PI\dat\piarch.001
State: 4 Type: 0 Write Flag: 1 Shift Flag: 1
Record Size: 1024 Count: 2048
Offsets: Primary: 98/512 Overflow: 1948/2048
Start Time: 2-Mar-05 12:21:11
End Time: 3-Mar-05 16:32:27
Backup Time: Never
Archive: E:\PI\dat\piarch.002
PIarcfilehead [$Workfile: piarfile.cxx $ $Revision: 21 $]:
Version: 4 Path: E:\PI\dat\piarch.002
State: 4 Type: 0 Write Flag: 1 Shift Flag: 1
Record Size: 1024 Count: 2048
Offsets: Primary: 1/512 Overflow: 2047/2048
Start Time: Current Time
End Time: Current Time
Backup Time: Never
The converted archive and piarch.001 must be combined. For this example the
conversion is made into a dynamic size. If converting into a fixed size archive, there must be
enough space for all used records in both archives being combined. If in doubt use dynamic
archives, as they can always be moved into a fixed size archive later.
In the following dialogs, the ID conversion file is not required:
$ ../bin/piarchss -if E:\PI\dat\piarch.001 -of
E:\PI\dat\piarchcomb.001
PIarchss offline archive utility
Input file type: PI 3
Archive input file: E:\PI\dat\piarch.001
Beginning first pass. Sorting input archive.
Archive indicated start time: 2-Mar-05 12:21:11
Archive indicated end time: 3-Mar-05 16:32:27
Archive indicated recordcount: 2048
Processing record 1 ...
Primary record load completed.
Records processed: 97
Records with data: 86
Empty records: 11
Records with errors: 0
Records out of time range: 0
Records with duplicate time range: 0
Overflow record load completed.
Records processed: 101
Records with data: 101
Empty records: 0
164
Merge PI Servers
166
Merge PI Servers
Tuning
Most PI Servers require no tuning and work well with the default settings. In some instances,
you may need to make adjustments to the parameters contained in the Timeout Table (these
are called Tuning Parameters).
To edit PI Server configuration and tuning parameters use the PI System Management
Tool s (PI SMT). In PI SMT, use the Tuning Parameters tool (select Operations > Tuning
Parameters).
Changes to tuning parameters do not take effect until you stop and restart the PI Server or the
subsystem associated with the updated parameter.
Also, applications that were already connected to the PI Server will not reflect tuning
parameter edits until you reconnect.
All Subsystems
170
Tuning
Archive Subsystem
Archiv e_AutoArchiv eFile File name extension of automatic N/A/ Before every
Ext Archives. See also shift
.arc
Archive_AutoArchiveFileRoot
and
Archive_AutoArchiveFileForm a
t.
Archiv e_AutoArchiv eFile File name format of automatic 0 – 2/ Before every
Format Archives w hen shift
1
Archive_AutoArchiveFileRoot
parameter is used to create
automatic Archive files. The
formats are:
0:<root>._D_Mon_YYYY_H_M_S.<ext
>
1:<root>._YYYY-MM-DD_HH-MM-
SS.<ext>
2: <root>._UTCSECONDS.<ext>
Archiv e_AutoArchiv eFile Automatic archive file creation on N/A/ Before every
Root shifts. If present, this parameter shift
N/A
defines the path and file name
prefix to be used for new
archives.
For example, C:\PI\arc\auto_
Archiv e_BSTimeout The maximum number of seconds 1 – 86400/ Once a
an archive is allow ed to remain 1800 sec minute
offline w ith the piartool -bs utility.
Archiv e_CacheCleanCycle Frequency at w hich read-only 1 – Flush Startup
cache cleanup operations are Cycle/
performed. Setting this limit too 10 seconds
low may affect the performance of
the Archive Subsystem.
Archiv e_CacheHighPct High cache c leanup threshold, in 100 – 200/ Startup
Limit percentage of the 110 percent
Archive_CacheRecordPool
value. Oldest cache records are
deleted w hen the read-only cache
pool is above this limit, regardless
of
Archive_MaxIdleCleanCycles.
Archiv e_CacheLow PctLimit Low cache cleanup threshold, in 20 – 100/ Startup
percentage of the 80 percent
Archive_CacheRecordPool
value. Oldest cache records stop
being deleted w hen the read-only
cache pool is below this limit.
Archiv e_CacheRecordPool Maximum number of archive 10000 – Startup and
cache records for read access 500000/ end of each
queries. The actual size of the Point count flush cycle
read-only cache pool may low er m ultiplied by
due to low physical memory 4
resources.
172
Tuning
174
Tuning
Backup Subsystem
176
Tuning
Base Subsystem
178
Tuning
Batch Subsystem
Message Subsystem
connectionw ait Amount of time for a new TCP/IP 1000 – 1000000/ Startup
connection to become w ritable. 30000 m sec
180
Tuning
Snapshot Subsystem
182
Tuning
SQL Subsystem
Totalizer Subsystem
184
Tuning
Utilities
By default, the PI Update Manager maintains up to 4,095 pending updates per cons umer.
Similarly, the TotalUpdateQueue parameter sets the maximum events queued in the entire
Update Manager database. The default number of maximum events is 100,000.
If either of these limits is reached, a message is sent to the PI Message Log. Another message
is sent when the level goes back below 99 percent of the limit and queuing is resumed.
186
Troubleshooting
Messages for consumers using less than 0.1 percent of the TotalUpdateQueue limit (100 for
the default) are still queued even when the total limit is reached.
Troubleshooting
Data passes through many steps on the way into and out of the Archive. When
troubleshooting, it is important to identify both data path malfunctions, and data paths that
function correctly.
OSIsoft recommends a three-step approach to troubleshooting a PI System:
1. Isolate the problem to a single computer, either client or server, or to the network. You
may follow the steps in the Troubleshooting Checklist to isolate the problem area. See PI
Messages, to review a list of error messages.
2. Further isolate the problem to a particular client program or PI subsystem. See Verifying
PI Processes (page 190) and PI Server Data Files for details.
3. Determine the exact cause of the problem.
This approach is intended to reveal what is needed to fix the problem, repair the damage, and
prevent a recurrence. If needed, see Repairs to repair data files such as Archives or Point
Database.
If you have worked through the Troubleshooting Checklist and have not yet resolved your
problem, call OSIsoft Technical Support for assistance. The technical support engineer will
ask for key information and may also ask to connect remotely to your system for hands-on
troubleshooting.
Troubleshooting Checklist
OSIsoft recommends that you complete the steps in this checklist to troubleshoot PI Server
problems. If you have not resolved the problem when you finish these steps, contact OSIsoft
Technical Support (page 233).
1. Look for Error Messages. If you know the specific error message, search the Technical
Support site for that error. If you do not yet have a specific error message, look at the
message logs on the Server and on the client node. For Server messages, you can use the
Message Log tool in PI SMT. Filter messages for a severity of Error and greater (Severity
Levels (page 129)).
You can't look at a client node message log remotely. You can run PI SMT directly on
the client node or you can use pige tmsg. For Interface problems, you can examine the
\pipc\dat\pipc.log files directly on the Interface Node. If this is a setup problem,
look at the setup logs in the 32bit pipc\dat directory.
To get a text description for an error number, use:
pidiag -e errornumber
For more information on error messages, see View System Messages (page 128). For
information about pige tmsg, see the PI Server Reference Guide.
2. Determine which computers exhibit the problem:
ο Client computer(s)
ο Server computer(s)
ο Interface computer(s)
To isolate the computers, run the questionable system against a system that is functioning
correctly and review the results.
ο A network problem is likely if all computers exhibit the malfunction.
ο A server problem is indicated if the malfunction occurs on all clients.
ο A hardware or networking problem is likely if the applications that malfunction do
not use PI Server. Run telnet to further isolate the problem. If telnet works, then the
network is not likely the problem.
3. If this is a client problem:
ο Check security. Log onto Windows using an account that has a Mapping to piadmin.
ο Check the Update Manager to make sure that the client is signed up for and receiving
updates.
ο If a trend in PI ProcessBook flatlines, see Flatline in a PI ProcessBook Trend (page
198).
4. If this is a server problem:
ο Verify that all PI processes are running. You can use the PI Services tool in PI SMT
to see the status of all processes running as Services.
Note: PI Systems may take several minutes to start; loading of the Point Database,
Snapshot and Archives takes most of the time. Utilities, such as piartool and
piconfig, are not fully operational until startup has completed.
188
Troubleshooting
10. For troubleshooting Collectives, first use Collective Manager to check the status of all
members. Next use piconfig < pisysdump.dif:
− isavailable should be 1 for all members
− lastsynctime indicates the last successful communication
− role should be 1 for a primary and 2 for a secondary
11. If the problem is with Interfaces, typical tricks include:
ο Try running an Interface with only one point.
ο Run the Interface interactively.
ο Run the Interface without buffering.
ο Determine if the problem is with all points on all interfaces or just a few points on
some interfaces.
ο Verify that a PI Trust exists for that node or specifically for that interface.
ο Check the Firewall database.
ο Check the individual Interface log files, if any; also check the PI Message Log on the
Interface Node.
ο If an API Interface is not able to connect, try to connect with apisnap.
ο Try running as Administrator. If the problem goes away when you run as the System
Administrator, then you have a permission problem.
ο If this is the OPC Interface , check DCOM settings.
Verify PI Processes
When PI Server is running, all its processes should be running. When PI Server is stopped, all
PI Server processes should be stopped. The exception is pishutev, which only runs briefly
at PI Server startup. The PI SMT PI Services tool shows the status of PI Services.
In PI SMT, the PI Services tool
piartool -thread <subsystem> -info
Even if a process is listed as running, it may be in a state where it is not communicating with
PINet Manager. There are several utilities you may use to verify that each PI process is
communicating properly.
To list all processes that are started as Services, enter at the command prompt:
net start
Each PI Server process or interface that is running interactively will have a separate
command window labeled with the process name.
190
Troubleshooting
Archive Subsystem
Run the piartool -al, piartool -as, and pisnap utilities to test piarchss. If piarchss is
not working correctly, you will see:
C:\PI\adm>piartool -al
Getarchivefilelist Failed: [-10733] PINET: RPC Resolver is Off-
Line.
C:\PI\adm>piartool -as
Getarcmemtablestatistics Failed: [-10733] PINET: RPC Resolver is
Off-Line.
C:\PI\adm>pisnap
C:\PI\adm>apisnap localhost:5450
Snapshot value
Value = ERROR ERROR
Status = ERROR
PI Base Subsystem
Run the pisnap and piconfig utilities to test the PI Base Subsystem. If the PI Base Subsystem
is not working correctly, you will see:
C:\PI\adm>apisnap localhost:5450
PI License Manager
The PI License Manager, pilicmgr, provides license services for PI programs including
subsystems, client applications and interfaces. For example, PI Archive Subsystem registers
with the PI License Manager to obtain a valid license. If it fails to get its licens e, it may not
operate properly.
Run the piartool utility to test the PI License Manager. If pilicmgr is not working
correctly, you will see:
C:\PI\adm>piartool -lic usage
Continue after failure to register with License Manager. [-10733]
PINET: RPC Resolver is Off-Line.
PI Snapshot Subsystem
Run the piartool -ss and pisnap utilities to test the Snapshot Subsystem. If the Snapshot
Subsystem is not working correctly, you will see:
C:\PI\adm>piartool -ss
Getsnaptablestatistics Failed: [-10733] PINET: RPC Resolver is
Off-Line.
C:\PI\adm>pisnap
C:\PI\adm>apisnap localhost:5450
Snapshot value
Value = ERROR ERROR
Status = ERROR
PI Update Manager
Run the pilistupd utility to test piupdmgr. If piupdmgr is not working correctly, you will
see:
C:\PI\adm>pilistupd
pilistupd -h for help
[-10727] PINET: RPC is Non-Existent
Producer Consumer Qual. Flags Pending
--------- --------- ------ ------ --------
status: [-12150] not registered in updmgr
192
Troubleshooting
Check Connections
For information about connections, look at the Network Manager statistics. You can see these
in the PI SMT Network Manager Statistics tool (select Operation > Network Manager
Statistics). The pinetmgr process manages the Remote Procedure Calls (RPCs) that PI
Server subsystems and processes use to communicate with each other.
For example, if the Snapshot Subsystem (pisnapss) sends an event to the Archive
Subsystem (piarchss) for storage, the communication flows from pisnapss to
pinetmgr to piarchss. If the Archive Subsystem writes a message to the System
Message Log, the communication flows from piarchss to pinetmgr to pimsgss.
The Network Manager Statistics tool shows a lot of information. Some things to check for:
• BytesSent and BytesRecv can be helpful in identifying applications that are requesting or
sending unusual amounts of data. If the value for an application or interface is large
compared to other applications or interfaces of that type, then that might point to the
problem connection. (BytesSent and BytesRecv from PINetMgr will always be the
highest.)
• What client processes are connected from which nodes.
194
Troubleshooting
See PI Producers and Associated Subsystems (page 195) for a list of producers and
associated subsystems. Look for:
• send failures
• retrying
• is the producer responsive?
If all the consumers and producers are communicating correctly, but no events are coming
through, check the producer of the data (for example, Snapshot, Archive, or MDB).
3. Use the dialog box to specify these recommended settings as shown in the Dr. Watson
for Windows dialog :
ο Log File Path: Use the default location.
ο Crash Dump: Use the default name. This file may be overwritten; after a process
crash, copy this file to a safe location.
ο Number of Instructions: 25
ο Number of errors to save: 25
ο Crash dump type: Full
4. Ensure that the checkboxes next to these Options are selected in the Dr. Watson for
Windows dialog box:
ο Dump symbol table
196
Troubleshooting
Specific Proble ms
198
Troubleshooting
Abusive Usage
If the PI Server uses most of the CPU needed to pinpoint a problem, it may be due to
improper sizing; that is, the configuration may be set too large for available hardware
compone nts, such as CPU, memory or disk.
The introduction of threading in release 3.4 solves many past performance issues; however,
very large Archive queries can still affect performance. The total number and size of queries
can be monitored with piartool -as.
If the amount of read access and number of events retrieved seem excessive, use the activity
grid (page 199).
Also, the PINetMgrStats table in piconfig can help identify network connections with the
highest traffic.
Activity Grid
The Archive Subsystem provides a tool to monitor the rate of 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.
Note: 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 following gets the number of events retrieved by point, from the time the activity grid
was started:
d:\pi\adm>piartool -aag point event
Name - Count - ID
SINUSOID 35 - 1
CDT158 100 - 3
CDM158 110 - 4
The following gets the number of event-retrieval calls, arranged by Connection ID:
d:\pi\adm>piartool -aag cnxn event access
Name Count ID
pidemo 3320 2
200
Troubleshooting
Note: After the piudsrdr service has been started, it remains in the list of running
processes, even if all mapped points are subsequently deleted.
202
Troubleshooting
3. You can manually clear the log by clicking Clear Log to make room for more log events.
Note: You should adjust the settings according to your site's policy regarding logs and
your disk capacity.
• If a change is made to the identity setting, restart the Redirector by restarting Base,
Snapshot, and Archive.
• If the identity of the Redirector is set to a specific user, you should make sure that all out-
of-process COM Connectors can be started and accessed by this user.
To find more information for troubleshooting Redirector and COM Connectors, go to the
OSIsoft Technical Support Web site (http://techsupport.osisoft.com/) and select Products >
COM Con nectors > PI COM Connectors.
204
Troubleshooting
Once you have confirmed from this dialog box that OSI PI-UDS Redirector is ins talled,
continue with the troubleshooting tips below until the problem is solved.
When you are able to clear the problem, you must restart the Redirector. This is done by
shutting down the Base, Snapshot, and Archive Subsystems and restarting them. There is no
method to restart the Redirector alone. The Redirector is not started if there are no mapped
points configured on the system.
COM Connectors
If a COM Connector is successfully loaded by the Redirector, a message like this is written to
the Windows Event Log:
Successfully registered PI Universal Data Server COM Connector
pipi.pipiconnector.
If the COM Connector cannot be loaded, a message to this effect is logged. Troubleshooting
steps depend on how the COM Connector is implemented. For details, see the manual for the
individual COM Connector.
COM Connectors are of two different types: in-process or out-of-process. The manual for the
specific COM Connector you are using will tell you the Connector type.
Note: In-process COM objects are not visible to the dcomcnfg utility. One way of seeing
the DLLs loaded by the Redirector is to use the ListDLLs utility available from
Microsoft (http://www.microsoft.com/technet/sysinternals/default.mspx ).
Repairs
This archive registry information is stored in a binary file called piarstat.dat. If this file
is corrupted, you can use the pidiag utility to rebuild it:
206
Repairs
Archive files have a header and a record structure. The records include data and auxiliary
information to index the records and links the records together for fast data access.
All data is susceptible to corruption if a system failure such as a power outage occurs. When
Archive file corruption occurs and the file becomes unreadable, it is important to recover the
file to the most complete state possible.
The Offline Archive Utility, piarchss, can be used to recover the data and rebuild the Archive
header and its associated metadata.
Note: Every archive has a parallel annotation file, with an extension .ann. In PI
3.3.361.43, the annotation file is identified incorrectly after renaming its associated
archive file. Since renaming is necessary in this case, unregister the renamed file
after initial registration, and re-register it.
208
Repairs
Offline archive processing with time transformation differs little from standard offline
archive processing. All arguments, such as input file and output file, must be specified.
Additional arguments specify time transformation behavior. The additional arguments are:
-tfix time_conversion_file [-tfixend time -oeendtime time]
The argument -tfix followed by full file specification is required. The arguments -
tfixend and -oeendtime are optional.
The first option, -tfixend, followed by a timestamp specifies the time to perform no
transformations. All events with timestamps greater than or equal to this time will not be
transformed.
This option is used when only a portion of the archive has incorrect event timestamps. For
example, if a PI System was run for a period with incorrect system clock setting, then the
clock was set correctly and run for some period before applying a time transformation fix.
The second option, -oeendtime, followed by a timestamp specifies a timestamp to set as the
archive end time when conversion is complete. The archive end time is set to the passed value
if all events are older than this time; otherwise, the end time is set to the time of the oldest
archive event.
The offset is the number of seconds to add to the event timestamps. Sub-second precision of
the time shift is not supported. The offset is applied to all events with timestamps greater than
or equal to specified timestamp but less than next timestamp in the conversion file.
Here are some examples:
The following example uses UTC seconds time format. The timestamp 0, is January 1, 1970,
and 2000000000 is well into the 21st century. The offset is a positive 3600--one hour.
Therefore this data file will simply move all events ahead by one hour.
# Example 1, Moves entire archive ahead by 1 hour
0,3600
2000000000,3600
Example 2 is similar to Example 1, but uses local time stamps to specify a suitably large time
range to cover all events. The offset is -3600. This data file will move all events back by one
hour.
# Example 2, Also moves entire archive back by 1 hour
01-Jan-70 00:00:00,-3600
01-Jan-30 00:00:00,-3600
Example 3 applies a missed DST conversion for the Northern Hemisphere summer of 2003.
The first timestamp is set at 01-Jan-03 to include all events up to the DST transition; no offset
is applied up to, but not including 06-Apr -03 02:00:00. From 06-Apr -03 02:00:00 up to, but
not including, 26-Oct-03 02:00:00 one hour is added to all events. No offset is applied from
26-Oct-03 02:00:00 to current time.
# Example 3, Applies a missed dst conversion to an
# archive that covers summer of 2003
01-Jan-03 00:00:00,0
06-Apr-03 02:00:00,3600
26-Oct-03 02:00:00,0
31-Dec-03 23:59:59,0
There are two types of possible damage to the Snapshot from which PI Server can recover:
• Snapshot times in the future. Accidentally moving the PI Server system time into the
future can cause this; at a minimum all points collected loc ally will be in the future.
Snapshot events are replaced when a newer value is received; therefore these events
remain in the Snapshot until actual time catches up. Events earlier than Snapshot time
bypass compression. Events that bypass compression can put a large load on your PI
Server.
• Damaged or corrupted Snapshot file (piarcmem.dat). Corruption may be caused by
disk or power failures.
210
Repairs
2. Re-start the PI Snapshot Subsystem from a command prompt and pass the -f argument.
This must be done interactively; not as a Windows service:
pisnapss -f
On startup, the PI Snapshot Subsystem looks for all Snapshots more than 20 minutes in
the future. These future Snapshots are overwritten with a NULL value. The Snapshot
Subsystem reports the number of future events detected to the message log. If no future
Snapshots were detected, no fix messages are written to the message log. New incoming
data immediately overwrites the NULL Snapshot, even if the incoming value is out of
order.
The Snapshot Subsystem continues to run normally after the fix.
3. Ctrl+C the interactive pisnapss process and restart it as a service.
Note: Snapshots fixed by this procedure remain set to NULL until a new snapshot event
arrives. A NULL Snapshot value is replaced by any new event that is received for
a point, even if the event is an out-of-order event.
Note: If the piarcmem.dat file is damaged, OSIsoft recommends that you contact
OSIsoft Technical Support for assistance with this procedure.
To rebuild piarcmem.dat :
1. Shut down the PI Base Subsystem, PI Archive Subsystem and the PI Snapshot
Subsystem.
2. At a command prompt, change to PI\bin and enter:
pibasess -snapfix -file
filename - ds provides the full filename of an optional input file to use in place of
piarcmem.dat
-ds state specifies a system digital state that w ill be inserted in the new file
- maxtime sets the latest time stamp allow ed in the snapshot; pisnapss -f
truncates at *+20 minutes
time indicates a time limit beyond w hich the pr ior digital state of events
w ill be replaced w ith SnapFix, or the digital state you specify w ith
the state parameter
a. Enter a filename only if you have a file that you want your new piarcmem.dat to
be built from. If you want to rebuild the Snapshot file based on the most current
values in the Snapshot, do not enter a filename. If a piarcmem.dat exists, the PI
Base Subsystem will rename the piarcmem.dat file that contains the current
Snapshot values to DD_MON_YY_piarcmem.dat; then, it will build a new
piarcmem.dat from the renamed piarcmem.dat. If there is no
piarcmem.dat, a new file is created.
b. If you enter a state, you must use an existing digital state.
The PI Base Subsystem will write a message to the screen indicating that Snapshot
recovery mode has been specified and that recovery is in progress. If multiple points
containing multiple recnos are found, these points are listed and the snapshot recovery
process is stopped until the duplicate points are removed.
Note: If duplicate recnos exist in piarcmem.dat, you must intervene before the
Snapshot rebuild can proceed. You will need to determine which points to
remove from the Snapshot file.
4. If duplicate points are found, use the ptpurge parameter to remove duplicate points:
pibasess -snapfix -ptpurge pointtopurge
or,
pibasess -snapfix -ptpurge filelist
where pointtopurge is a single point, for example mypoint. If you want to use a file that
contains the names of multiple points, use filelist. For example,
pointstodelete.dat.
When recovery is complete, the PI Base Subsystem will write a final message to the
screen and exit.
212
Repairs
5. Restart the PI Base, PI Archive, and PI Snapshot subsystems. Current Snapshot values
are preserved in the rebuilt piarcmem.dat file. Points that have no previous data will
use the SnapFix digital state, or the digital state you specify with the state parameter,
until the state is replaced by new snapshot values. Any snapshot record that does not have
a matching point is removed.
Note: This Snapshot recovery command can be run with the entire PI Server shut down.
Note: The significant digit command, @sigd 8, ensures that rounding errors do not
cause values to be missed.
Repair Databases
If the PI Base Subsystem does not start due to a corrupted database, the log shows a message
indicating this. If there is no such message, start the PI Base Subsystem in interactive mode
and observe the errors in the window. Database corruption is a relatively rare event. It is
usually due to hardware failure or improper shutdown. To repair all databases:
pibasess -copydb path
For example:
pibasess -copydb \pi\recovereddb
Following this command, the target path contains recovered copies of all the configuration
databases. Corrupted records are eliminated and related messages displayed.
Be sure to make a backup copy of the \pi\dat\ directory before you copy the recovered
database files back into this directory.
After that, pibasess should load all databases and work normally. The resulting files are
slight ly smaller than the originals as they are compacted in the process.
Most of the PI System internal databases are stored in files that have a common internal
structure. Data is stored in records and the records are indexed. We call this structure file
based. This section discusses the tools for diagnostics and repair of such database files.
214
Repairs
The -header option suppresses the listing of the index and shows only the header. The -dv
option displays the file’s version only.
OSIsoft technical support can determine from this information if any errors occur in the
structure of the file:
D:\PI\adm>pidiag -fb d:\pi\dat\pidigst.dat
PIfilebaseheader[$Workfile: pifile.cxx $ $Revision: 125
$]::
File Name: D:\PI\dat\pidigst.dat
Major Version: 4
Minor Version: 0
Byte Alignment: 1
Directory Location: 1024
Directory Size: 1024
Record Count: 18
Last Recno: 0
Maximum Recno: 128
User Block Size: 512
Data Location: 2048
Data Size: 23325
Auto Compact %: 0
Last Modified: 10-Sep-09 09:45:11
Backup Time: 25-Aug-09 14:26:11
PIsecureobject[$Workfile: pisecobj.cxx $ $Revision: 46
$]::
ACL ID: 1 [ 1:A(r,w)|5:A(r)|2:A(r) ]
% unused: 0
The PI Server handles automatically all changes to system time. Thus we recommend that
you never manually change the system time. On Windows, always use the automatic DST
option.
However, occasionally such changes are required, and unfortunately, from time to time this
change leads to human errors. For example instead of moving the clock to 2 AM it is moved
to 2 PM. Time synchronization software, designed to keep computer clocks accurate without
error-prone human intervention, have also been implicated in moving system clocks
erroneously. As a result, the events are recorded in the future. Usually this is discovered after
many of these events were already stored in the Archive. To recover from such situation:
1. Stop the PI System.
2. Correct the system time and the time on all connected nodes.
Note: If you are using the PI Buffer Subsystem to buffer data from PI Interfaces, see
If you use the PI Buffer Subsystem (page 217).
3. Isolate the PI Server from interface nodes. The best technique is to disconnect the server
from the network. While fixing the PI Server, it is best to allow the data to buffer until the
system is verified up and running normally.
4. Rename the Event Queue file, pimapevq.dat for later processing. The Event Queue
may contain many future events. Rename the following files located in the dat
directory:
ο pilastsnap.dat
ο pilasttot_T.dat
ο pilastalarm.dat
5. Create an empty archive file using PI SMT or the piarcreate utility.
6. Run pidiag -ar and register only the new empty archive.
There are two options for fixing the Snapshot:
1. If the erroneous future data can be discarded, start the Snapshot Subsystem with -f flag
as described in Recover from Future Times in the Snapshot (page 210).
2. Otherwise, keep the current file, and after the system startup, delete or edit individual
values using piconfig, as explained above.
3. Start the PI Server in base mode. This starts only the minimum required subsystems:
PINet Manager, PI Message Subsystem, PI License Manager, PI Update Manager, PI
Snapshot Subsystem, PI Archive Subsystem and PI Base Subsystem:
pisrvstart -base
216
Repairs
4. Register all the old Archive files except for the previous primary, which contains future
data.
5. Examine the unregistered Archive file header to confirm the time boundaries of the
various Archives involved before using offline Archive processing to merge Archives:
a. to look at the header of an unregistered Archive:
pidiag -ahd
b. to look at registered Archives
piartool -al
6. Create a new primary archive using piartool -ac.
a. Specify a start time before any events that might be coming in. Specify the end-time
as *. This instructs the Archive Subsystem to register the new archive as primary
Archive. The start time specified must account for all buffered data. If you are
unsure, set the start time well before the time the problem was first encountered.
b. If necessary, you can use offline archive processing later to merge this data with
existing archives.
7. Verify that the PI System is running correctly. Reconnect the server to the network.
8. Reprocess the old Primary Archive using the offline tool to either filter out the future
data, or correct its time by the required difference.
9. Reprocess the Event Queue into an archive file and correct timestamps as required.
10. Optionally combine these two archives: the old primary and the result of the Event
Queue.
11. Register the corrected archive file.
The utilities piconfig, pige tmsg, pilistupd and piartool may use excessive CPU. You can fix
this problem by increasing the time-out values for these utilities. This prevents the utilities
from using when listening to messages.
Note: PI Server installation sets all timeout values to well-tested initial values. Changes
to these values should be done under the advice of OSIsoft Technical Support.
Very short timeout values may cause specific utilities to spin faster and thus use
more CPU. Before making changes based on CPU consumption, isolate the CPU
to the offending processes. Use available tools to analyze each process. For
example, if pisnapss is in a high CPU state, run piartool -ss and look at
Snapshot read and write rates because excessive rates may be the true source of
CPU load.
218
Appendix A
PI SQL Subsystem
The PI SQL Subsystem (pisqlss) prepares and executes SQL statements directed at the PI
Server. The primary users of this subsystem are the PI ODBC Driver and the PI SDK. This
driver conforms to the ODBC API standards and makes PI data appear to be organized into
data tables. PI ODBC 1.1.2 or later is required to connect to PI Server.
OSIsoft's implementation of SQL gives applications access to the PI Point Database,
Snapshot, and Archive. For supporting information, such as details of OSIsoft's
implementation of SQL, see the PI ODBC Driver Manual.
SQL processing capability is also implemented in the PI System for OpenVMS. Differences
between the two are discussed in this chapter.
Architecture
This section outlines the operation of the PI SQL Subsystem and its interaction with the PI
API.
This discussion is provided as background material. You do not need to understand the details
of the subsystem's operation in order to use it.
Statement Handles
Most interactions between PI clients and the PI Server do not require the Server to maintain
any context, that is, any record of the client's operation. Any request for point information or
Archive data can be serviced using only the information provided by the client in the request
itself.
The processing of SQL statements is different. When an SQL statement is processed, the
Server must maintain a record of the statement's status in order to be able to perform
subsequent operations.
This is done by having the PI SQL Subsystem allocate a statement handle when a client
initiates the processing of an SQL statement. The client retains the handle's identifier and
provides it to the server with every request.
The details of handle allocation and de-allocation are managed internally by a PI API based
client application, such as the PI ODBC Driver.
If connection between the client and Server is lost, the PI SQL Subsystem retains any
statement handles allocated by the client. These handles become orphaned and cannot be
accessed again. The handles are de-allocated when the PI SQL Subsystem shuts down.
During shutdown, pisqlss will report the total number of handles allocated during its run, and
the number of orphaned handles that were aborted.
Concurrency
The PI SQL Subsystem handles SQL processing for all client connections to the PI Server.
Operations such as parsing an SQL statement and fetching results are relatively inexpensive.
Execution, however, can potentially take time and system resources as data are obtained from
other subsystems.
Configuration
No advance configuration is necessary to start pisqlss. It is started and stopped exactly the
same way as other subsystems. On Windows, pisqlss can be run as a service.
Some tuning of pisqlss performance is possible. Settings can be changed using an
initialization file, pisqlss command-line parameters, and through settings on a client product,
such as the PI ODBC Driver.
Note: The use of an initialization file may change in a later release to an alternate
method. At that time, any site-specific settings found in the initialization file are
migrated.
See your client product documentation for instructions on changing SQL processing settings
from the client application.
Since it is possible to set parameters using more than one technique, some of the settings may
be in conflict. The actual value of the settings employed follows this priority scheme:
• Initialization file settings
• pisqlss command-line arguments
• Client product settings
Settings made lower in the list override settings higher up. For example, if the SQL query
timeout is set to 45 seconds in the initialization file and to 60 seconds on the pisqlss
command-line, the value used is 60 seconds.
The initialization file is called pisql.ini and can be found in the PI\dat\ directory of
your PI Server. The file contains defaults for all settings. You may change the settings by
editing the file.
220
Configuration
The initialization file settings are read when a new statement is allocated. Any change to this
file is reflected in the next new statement.
This section outlines the pisqlss settings that can be altered using command-line arguments.
The mechanism for specifying command-line arguments differs between supported platforms.
This section outlines the techniques.
See Troubleshooting (page 223) for details of the information generated in the
sqltrace.log file by the LOG and TRACE options.
222
Troubleshooting
This example shows a system manager about to restart the PI SQL Subsystem while setting
the default timestep to 7200 seconds and turning on TRACE mode.
Note: This works one time only. If you close the Services, then reopen and reselect your
service, you will not see your command-line arguments from the last run. This
method cannot be used to provide command-line parameters to services started
automatically when your Windows system boots.
Troubleshooting
Unexpected errors may be generated when using an ODBC application to communicate with
the PI Server.
This section outlines techniques to help you validate the operation of the PI SQL Subsystem
and to log its processing steps.
A trace file can be generated by starting the PI SQL Subsystem with the LOG or TRACE
options. For details on how to do this, see Configuration (page 220).
The options LOG and TRACE are similar. Both generate information in the
sqltrace.log file in the PI\log\ directory. The LOG option provides more detail.
The options can be used together. Output from the two is interspersed.
Invoking the TRACE option shows a summary of SQL statement preparation and execution
only.
224
Troubleshooting
Output from the LOG option is more detailed. It reflects directly the argument list of the
Remote Procedure Calls (RPCs) implemented by the PI SQL Subsystem. Most of the
information generated should be forwarded to OSIsoft in the event of a query processing
problem.
In general, the first argument of each RPC is the handle ID. The only exception is the
newstatement function, which is the routine that generates the handle ID. In this case, the
returned handle ID is the second argument.
It is possible that an ODBC client application sends an incomplete query, or a query that
returns too many results, to PI Server. When a query is timed out, it may or may not hold on
to the server resource, mainly the virtual memory. If the timeout occurs during the query
execution, the statement handle and its resource are freed. If the timeout occurs during the
fetch, the statement handle is not freed. To clear the statement handle and its resource, shut
down and restart the PI SQL Subsystem.
To do this, send a stop command to the PI SQL Subsystem using one of the following
methods:
• From the Control Panel > Administrative Tools, run Services. Select the PI SQL
Subsystem from the list and click Stop.
• From a command-line prompt, enter:
net stop pisqlss
• From a command-line prompt, enter:
\pi\bin\pisqlss -stop
A message is written to the message log indicating that the PI SQL Subsystem has been
stopped. Another message indicates the number of handles allocated and the number of
handles aborted during the shutdown.
To restart the PI SQL Subsystem and resume normal operation, use one of the following
methods:
• From the Control Panel > Administrative Tools, run Services. Select the PI SQL
Subsystem from the list and click Start.
• From a command-line prompt, enter:
net start pisqlss
• From a command-line prompt, enter:
\pi\bin\pisqlss -start
A message is written to the message log indicating that the PI SQL Subsystem has been
continued.
Shutting down and restarting the subsystem can be done at any time and is equally effective.
This is the only option available when running the PI SQL Subsystem on Windows
interactively.
Performance Counters
In PI Server for Windows, several aspects of PI SQL Subsystem processing can be monitored
continuously using the Performance Monitor application.
If the PI SQL Subsystem consistently returns an error when processing SQL statements, or
appears to generate incorrect results, you should stop the PI SQL Subsystem and then restart
with the TRACE and LOG options enabled. Send the resulting sqltrace.log to OSIsoft
Technical Support.
226
Appendix B
The PI Server can write data into a foreign data system if it is supported by the COM
Connector for the foreign data system.
Point Configuration
In order to interact with a point on a foreign system, a corresponding point, called a mapped
point or COM Connector point, must be created in the PI Point Database. A mapped point in
the Point Database is one that links to data in a foreign system.
To build a mapped point, select a point class that includes the following point attributes, as
well as the normal attributes of a point class:
COM Connector Point Attributes
Attribute Description
ctr_progid COM program ID, as stored in the Window s registry. This name is used to
invoke the COM Connector object w hen needed.
ctr_lm ap Longw ord mapping parameter. ctr_lm ap and ctr_strm ap are passed to the
COM Connector so that it can locate the appropr iate foreign system point.
ctr_strm ap String mapping parameter. ctr_lm ap and ctr_strm ap are passed to the COM
Connector so that it can locate the appropriate foreign system point.
PI Server includes the classicctr point class, which contains these point attributes as well as
the base and classic attribute sets. To create this point class, run the script
PI\adm\classicctr.dif using the piconfig utility.
Construct points according to the specifications of the point class. For details, see PI Point
Classes and Attributes (page 23). Points are created and maintained using the PI
TagConfigurator, a Microsoft Excel spreadsheet-based tool, or piconfig, a script-based tool.
Whenever the point information indicates that the requested point is a mapped point, the
Redirector obtains data values from the corresponding foreign system point.
228
Retrieval of Archive Data
Archive Files
Even though Archive files are not used if data is retrieved using COM Connectors, the files
must exist and must be sized as if all points on the PI Server were PI Archive points. Each
COM Connector point consumes a primary record in the archive file even though it will never
be used for data storage or retrieval. Normal maintenance and backup procedures apply to the
Archive files.
Snapshot Updates
The COM Connection mechanism includes support for exception reporting. The PI Server
Snapshot Subsystem calls a sign-up method in the COM Connector if a client signs up for
exceptions on a mapped point. The Snapshot Subsystem obtains exception values from the
COM Connector by way of the Redirector.
If the foreign system does not support exception handling, it may be coded to return a
standard COM error code indicating that the method is not implemented.
230
Compression
Compression
PI Server does not apply the PI Archive's data compression algorithm to mapped foreign
points. If the COM Connector supports putting new data values into the foreign system, then
that system is responsible for their storage. The foreign system may or may not support
compression.
Point Security
Data retrieved from foreign data system is subject to the same security as data values
retrieved from storage within the PI Archive. Every PI point, whether mapped or not, carries
a security descriptor that defines the access that PI users may have to data. For details about
how to set point security, see the Configuring PI Server Security.
Support may be provided in languages other than English in certain centers (listed above)
based on availability of attendants. If you select a local language option, we will make best
efforts to connect you with an available Technical Support Engineer (TSE) with that language
skill. If no local language TSE is available to assist you, you will be routed to the first
available attendant.
If all available TSEs are busy assisting other customers when you call, you will be prompted
to remain on the line to wait for the next available TSE or else leave a voicemail message. If
you choose to leave a message, you will not lose your place in the queue. Your voicemail
will be treated as a regular phone call and will be directed to the first TSE who becomes
available.
If you are calling about an ongoing case, be sure to reference your case number when you call
so we can connect you to the engineer currently assigned to your case. If that engineer is not
available, another engineer will attempt to assist you.
Search Support
From the OSIsoft Technical Support Web site, click Search Support.
Quickly and easily search the OSIsoft Technical Support Web site's Support Solutions,
Documentation, and Support Bulletins using the advanced MS SharePoint search engine.
234
Remote Access
Remote Access
From the OSIsoft Technical Support Web site, click Contact Us > Remote Support
Options.
OSIsoft Support Engineers may remotely access your server in order to provide hands-on
troubleshooting and assistance. See the Remote Access page for details on the various
methods you can use.
On-site service
From the OSIsoft Technical Support Web site, click Contact Us > On-site Field Service
Visit.
OSIsoft provides on-site service for a fee. Visit our On-site Field Service Visit page for more
information.
Knowledge Center
From the OSIsoft Technical Support Web site, click Knowledge Center.
The Knowledge Center provides a searchable library of documentation and technical data, as
well as a special collection of resources for system managers. For these options, click
Knowledge Center on the Technical Support Web site.
• The Search feature allows you to search Support Solutions, Bulletins, Support Pages,
Known Issues, Enhancements, and Documentation (including user manuals, release
notes, and white papers).
• System Manager Resources include tools and instructions that help you manage: Archive
sizing, backup scripts, daily health checks, daylight savings time configuration, PI Server
security, PI System sizing and configuration, PI trusts for Interface Nodes, and more.
Upgrades
From the OSIsoft Technical Support Web site, click Contact Us > Obtaining Upgrades.
You are eligible to download or order any available version of a product for which you have
an active Service Reliance Program (SRP), formerly known as Tech Support Agreement
(TSA). To verify or change your SRP status, contact your Sales Representative or Technical
Support (http://techsupport.osisoft.com/) for assistance.
238
O Recovering • 208
offline archive utility • 69, 85
R
offline, message subsystem • 131
offline, viewing messages • 131 record
overflow primary recordrecord • 71 archive • 71
Overlapping dates • 115 records
listing details • 90
P Recovery tool • 207
Redirector
PI API
confirming installation • 204
about • 122
dump script • 201
Buffering • 122
starting • 204
PI Base Subsystem
regsvr32 • 206
Troubleshooting • 191
removing archives • 80
PI Processes
Repairs
Running independently • 193
Archive Registry • 207
PI Server
Excessive CPU Usage by Utilities • 217
performance monitoring • 133
Module Database • 214
restore from backup • 114
Point Database • 214
Starting • 17
Snapshot • 210
Stopping • 17
System Time • 216
tuning • 169
Tuning the Server • 169
PI System
resolver error message • 132
merging two systems • 144
Restore
piarchss • 69, 85, 191
Archive • 115
piarcreate • 69
PI Server from backup • 114
piartool • 69
Subsystem Databases • 116
-aw • 90
Reverse Name Lookup
moving archives • 80
Troubleshooting • 197
Pibasess • 191
rpc resolver error message • 132
PIBatch
considerations when merging systems • 145
S
pidiag
-e errorcode • 131 Security
-fb • 214 Troubleshooting • 191
-fbc <path> • 215 Shift
-fbf <path> • 215 Archives • 82
Recovery utility • 207 shift, archive • 69
-t time <U> • 13 Shutdown.dat • 22
-tz • 9 Site-specific files • 18
Pilistupd utility Snapshot • 21
Troubleshooting • 192 repairing • 210
Pishutev • 21, 190 Subsystem
Pisnapss • 192 recovering • 211
PITimeout Table • 186, 187 Troubleshooting • 192
Piudsrdr.exe • 201 Start
Piupdmgr • 192 PI • 17
Point Database • 82 Redirector • 204
Repairing • 214 Stdout • 18
primary archive • 69, 72
Stop W
PI • 17
Windows
String to Integer Format • 13
Stopping Processes • 193
Subsystem
Restore from Backup • 116
Update Manager • 192
subsystem health check failed • 132
System
Clock
resetting • 216
T
Tag
Mask, for shutdown • 22
Threading • 199
Time
future times in Snapshot
removing • 213
Time Zone • 9, 12
utilities • 13
time limits on modifying data • 79
Time Transformation Processing
conversion file • 210
TotalUpdateQueue • 186, 187
Troubleshooting
Checklist • 188
PI Update Manager • 192
Strategy • 187
Tuning
Utilities timeout value • 217
Tuning the PI System • 169
U
Update Manager
MaxUpdateQueue • 186
Pending Update Limit • 186
TotalUpdateQueue • 186, 187
Troubleshooting • 192
Utility
File-base • 214
pidiag recovery • 207
time • 13
V
Verifying PI Processes • 190
Visual Basic, API • 122
240