Auditing FT Historian SE Server PDF
Auditing FT Historian SE Server PDF
Auditing FT Historian SE Server PDF
Time Range 16
Unique Audit Record ID 17
Audit Database Mask 17
Schema 17
iv
Chapter 1
Principles of Operation
The Historian Audit Database contains records of changes made to Historian Server data. The
following changes are recorded:
• Editing and deleting time-series data, such as values in the Historian Archive.
• Creating, deleting, and editing configuration information on time-series data. Examples
include Historian point configuration data and access permissions for secure objects
within the Historian Server.
The Historian Audit Database consists of three distinct files. Each file represents a Historian
Subsystem:
• Base Subsystem: pibasessAudit.dat
• Archive Subsystem: piarchssAudit.dat
• Snapshot Subsystem: pisnapssAudit.dat
All files for the online Audit Database are stored in the PI\log directory of the Historian
Server.
For more information on the structure of the Audit Database, see Audit Database File
Contents (page 7).
Some Audit Database maintenance procedures require editing of Historian Server tuning
parameters. To edit tuning parameters, follow these steps:
1. Click Start > Programs > Rockwell Software > FactoryTalk Historian SE > System
Management Tools.
2. On the System Management pane on the left, expand the Operation entry, and then
select Tuning Parameters.
3. Select the General tab.
4. Double-click the tuning parameter that you want to change. You see a dialog for the
tuning parameter.
5. Enter your edits onto the dialog.
6. Click Apply.
7. Click OK to close the dialog.
Note: On Historian Server 3.x, you need read/write access to the PITUNING entry in the
Database Security editor (Security > Database Security) to edit tuning
parameters. For earlier versions of the Historian Server, read/write access to the
DBSECURITY entry is required.
2
Maintenance Procedures for the Historian Audit Database
Note: Historian AuditViewer satisfies the Title 21 CFR Part 11 FDA regulatory
requirements for generating accurate and complete copies of Audit Records in
both human-readable and electronic form suitable for inspection, review, and
copy.
Historian AuditViewer allows you to search for and view audit records in the Historian
Audit Database. It is an essential tool for analyzing and validating a FactoryTalk Historian
System for compliance with an implementation of cGMP. It facilitates the generation of
selected reports in Windows file formats, to comply with FDA audit requests.
Because AuditViewer can change auditing status and control the execution of FactoryTalk
Historian System processes, certain restrictions are in place:
• AuditViewer must run on the same computer as the Historian Server.
• The user must be a member of the Windows Administrator User Group.
• For FactoryTalk Historian 3.0 and later, the user must have read access to the PIAUDIT
entry in the Historian DBSecurity table and read/write access to the PITUNING entry.
For earlier versions of the Historian Server, the user must log on to the Historian Server
as the piadmin user.
Note: Earlier versions of Historian AuditViewer are not compatible with Historian
Server 2.x.
Enable Auditing
Historian Server auditing is disabled by default. To enable Historian Server auditing, follow
these steps:
1. Start Historian AuditViewer: Click Start > All Programs > Rockwell Software >
FactoryTalk Historian SE > Historian AuditViewer.
2. If auditing is disabled, you see the following dialog:
Note: When you enable auditing, Historian AuditViewer changes the value of the
EnableAudit tuning parameter from 0 to -1. On Historian Server versions 3.0 and
later, you need read/write access to the PITUNING entry in the Database Security
tool in SMT (Security > Database Security) to edit tuning parameters. For earlier
versions of the Historian Server, you need read/write access to the DBSECURITY
entry.
Disable Auditing
To disable auditing, use SMT to set the EnableAudit tuning parameter (page 2) to its default
value of 0. You must restart the Base, Archive, and Snapshot Subsystems for changes to take
effect.
Note: You can enable or disable auditing for individual Historian Server subsystems or
Historian Server databases by specifying a different value for EnableAudit. For
details, see EnableAudit Tuning Parameter (page 13).
4
Maintenance Procedures for the Historian Audit Database
Over time, Audit Database files can grow large, which can cause performance problems when
the files are re-opened after viewing or other maintenance operations. You can configure the
maximum size of your audit files based on audit file size, number of audit records, or both.
When an audit file reaches the maximum size setting, the Historian Server automatically
closes the audit file, appends the date and time to the name of the file, and opens a new file.
This is called an audit file shift.
Use the following tuning parameters to control audit file shifts:
• AuditMaxKBytes
• AuditMaxRecords
Use SMT to edit (page 2) these parameters.
Note: Audit file shift parameters are not available for Historian Server 2.x. For these
versions of the Historian Server, you must periodically create new audit database
files (page 5).
FactoryTalk Historian 2.x automatically perform an audit file shift (page 5) based on the
values that you set for the tuning parameters AuditMaxKBytes and AuditMaxRecords. If
you are using an earlier version of Historian Server, or choose not to shift audit files
automatically, use the procedures in this section to periodically remove, safely store, and
create new Audit Database files.
Rockwell Automation recommends that you create Audit Database files for all the Archive,
Base, and Snapshot Subsystems simultaneously, so that you can maintain complete audit
records for a specific time period.
While an Audit Database file is closed, the associated subsystem accepts new, edited, and
deletion requests and caches them for the Audit Database. When the database file is re-
opened, the cache is processed and audit records are written to the Audit Database. Caching
activity is written to the Message Log.
Several FactoryTalk Historian System features are unavailable when the Audit Database files
are closed. For example, you cannot create or edit points. To copy, delete, export, or move an
Audit Database file, you must close the file, perform the required activity, and then promptly
re-open the file. The schedule for removing and creating new Audit Database files depends
on the frequency and number of audit records that are created. For example, AutoPointSynch
(APS) modifies a property of a module to indicate the latest scan, which results in two audit
records. If APS scans every five minutes, then hundreds of audit records are generated every
day.
Note: On Historian Server 2 and later, it is not necessary to close audit files for backup.
6
Audit Database File Contents
3. Delete the original Audit Database files from the PI\log directory. For example:
del ..\log\pibasessAudit.dat
del ..\log\piarchssAudit.dat
del ..\log\pisnapssAudit.dat
4. Re-open Audit Database files (page 6). The Historian Server automatically creates new
audit files in the PI\log directory.
Field Description
PIUser User who made the change. Exception: In audit records from the PI Archive
subsystem, ID=0.
For FactoryTalk Historian 3.0 and later with Windows authentication, the name
of the Windows user who made the change.
PITime Time and date of the change
Database Database affected by the change.
Action Change action: Add, Remove, or Edit
Field Description
AuditRecordID Unique ID assigned to the audit record
Name Affected Record Name
ID Affected Record ID
Changes Table of specific changes. On Add and Remove, the change indicates each
attribute setting. On Edit, the change shows the before and after value of
changed attributes.
Field Description
Property Property that was edited
Before Value before edit
After Value after edit
On Adds, the current property setting is shown in the After field. The Before field is empty.
On Removes, each property is shown in the Before field. The After field is empty.
Note: The examples in this section assume that the Historian Server has been
configured to use FactoryTalk Historian 3.0 security settings, in which user
accounts in Windows are mapped to PI Identities. For these servers the Windows
user name displays in the PI Username field. For more information, see
Configuring FT Historian SE Server Security.
Historian Points
Create
The following table shows the audit record that results when a user called OSI\jsmith creates
a point called NewPoint:
Date FactoryTalk DB DB PI Username Action
Historian RecordID RecordName
database
2009-09-27 PIPoints 14 NewPoint OSI\jsmith Add
16:37:31-
07:00
8
Example Audit Records
Changes
Delete
The following table shows the audit record that results when a user called OSI\jsmith deletes
a point called NewPoint:
Date FactoryTalk DB DB PI Username Action
Historian RecordID RecordName
database
2009-09-27 PIPoints 14 NewPoint OSI\jsmith Remove
16:39:06-
07:00
Changes
Edit
The following table shows the audit record that results when a PI user called OSI\jsmith
modifies the compression specifications of the point with an ID of 9.
Date FactoryTalk DB DB PI UserName Action
Historian RecordID RecordName
database
13:00:00 PIPoints 9 Ba:temp.1 OSI\jsmith Edit
11-Oct-01
Changes
Historian Archive
Attempts to modify the Historian Archive are posted by the Snapshot Subsystem. The
Snapshot Subsystem performs some validation. On successful validation, it creates an audit
record indicating it is a removal attempt or an edit attempt.
The attempt is then forwarded to the Archive Subsystem for completion. If the modification
is successful, the Archive Subsystem creates a corresponding audit record.
Changes
Changes
10
Example Audit Records
Edit
For an Edit call, the Before value is not displayed in the Historian Snapshot Subsystem audit
record. The corresponding archive record does pass and displays the old value. The user
name is displayed only in the Snapshot record. User ID is shown as 0 in the Archive audit
record.
The following are the audit records generated by the Historian Snapshot Subsystem and the
Historian Archive Subsystem when an event is edited in the Archive:
Changes
Changes
Flags has changed from empty to S. S is the Substituted flag that Historian Server sets when
an event is edited.
The Module Database and Batch Database objects pose a more difficult auditing issue. For
the most part, audit records are similar to the examples for the other databases.
Modules
A module is an array of module values. Modules support change over time. Each module
value represents the module that was in effect for a given time period. Therefore, a module
audit record is actually a module value change record.
A module value is uniquely identified by the module unique ID and the module effective
date. This is different from most audit records that require only the record ID for unique
identification. For example, the Point Database needs only the Point ID to identify the record.
The following is an example of a module record identification. It consists of the unique ID,
effective date, and name:
UniqueID="e9f0a8cb-bb08-44b5-8b50-899a8813d09e, 31-Dec-69
16:00:01" Name="Child Module 01"
Module Hierarchy
Modules are hierarchical. A module may have parent modules and child modules. Although,
inserting a module into a parent module is effectively an edit of both parent and child module,
the Audit Database only shows this modification as a change to the parent.
Child modules are inserted into a specific value of the parent. This is an explicit edit of a
module value. The parent references of a child are not assigned to a specific value. All
module values that represent this child implicitly acquire the link to the parent. Since it is
implied a child module was edited and to avoid clutter and confusion in the Audit Database,
only the change to the parent is shown. The inserting of a child into a module is shown as a
change to the module's Children attribute.
The following represents the change to that attribute when adding a child. Notice the after
value has the additional unique ID of the child that was inserted.
PIModuleAttribute Name="Children"
Before=12e0e168-4ec6-499e-b6e3-271489893442
After=6895acf1-d177-4efd-a5fa-eeaf9c115bd9, 12e0e168-4ec6-499e-
b6e3-271489893442
Historian Properties
Historian Properties are hierarchical. Properties can have properties, which can have
properties, and so on. Since properties do not have unique identifiers, a rename is
indistinguishable from a deletion followed by an addition.
Adding a Historian Property is shown as an edit to the module by showing the parent
property to which the property was added. All modules have an implicit root property called
\\PIProperties.
The following are details of adding a root property with a value of 106.
PIProperty Name="Prop-106" ParentUNC_Name="\\PIProperties"
Value=106
12
Reference
Value=99
These examples focus only on the attribute that changed. The audit record contains
information that completely identifies the modified module. Also, renaming a property is
shown as a deletion followed by an addition in a single audit record.
Historian Batches
Historian Batch audit records are similar to Module audit records. PIProperties are handled
identically as Module properties. Inserting a PIUnitBatch is similar to inserting a child
module: the PIUnitBatches property shows the list of Unique IDs that represent the
PIUnitBatches. The reference to the PIUnitBatch gains to the PIBatch is also shown as an
edit to the PIUnitBatch.
Reference
You can enable auditing on individual database tables. Auditing is controlled through the
EnableAudit tuning parameter. The value is a bitmask where each bit controls auditing to a
specific database. A bit value of 1 enables auditing for the corresponding database. The
following table lists the Historian Server databases and the controlling bitmask value in
hexadecimal and decimal format.
Database Table Subsystem Value
Hexadecimal Decimal
Point Historian Base 0x1 1
Digital State 0x2 2
For example, to enable auditing for the Point Database (which has a bitmask value of 1) and
Digital State Table (which has a bitmask value of 2) set the EnableAudit parameter to 3 (= 1
+ 2.) Similarly, set the EnableAudit parameter to 131 (= 1 + 2 + 128) to enable Point, Digital
State, and Trust Table auditing.
Enter numeric values into the Timeout Table as decimal numbers. Hexadecimal (base 16)
notation is more convenient for creating or examining the bitmask value entered into the
EnableAudit parameter. It is easier to use hexadecimal notation to create the desired bitmask
and convert to decimal for entry into the Timeout Table. Conversely, it is easier to read a
decimal entry from the Timeout Table and convert to hexadecimal to interpret the value as a
bitmask.
To change the value of EnableAudit, use SMT as described in Edit Historian Server Tuning
Parameters (page 2).
Alternatively, use the piconfig utility. For example, enter the following commands in the
PI\adm directory to enable auditing on all databases:
piconfig
(Ls - ) Piconfig> @table pi_gen,pitimeout
* (Ls - PI_GEN) Piconfig> @mode create,t
* (Cr - PI_GEN) Piconfig> @istr name,value
14
Reference
Changes to EnableAudit do not take effect until you restart the affected subsystem.
If an Audit Database file cannot be re-opened or created, the associated Historian Server
subsystem creates an alternate Audit Database file named
pisubsystemAudit~UTCSeconds.dat, where pisubsystem is the name of the
associated subsystem and UTCSeconds is the current time expressed in UTC seconds. For
example: pisnapssAudit~1003043789.dat.
The subsystem once again attempts to open or create pisubsystemAudit.dat. If this
fails again, a new file, using the same format above, is created and used for auditing.
To avoid creating alternate Audit Database files during Audit Database maintenance:
1. Close the audit files (page 6).
2. Immediately copy or move the audit files to a different directory.
3. Re-open the audit files (page 6).
The pidiag utility is a collection of tools for diagnostics, information, and simple repairs. You
can use the -xa option of pidiag to export Audit Database records to XML format text. The
exported XML text allows you to view and analyze records with applications such as
Microsoft Access, Microsoft Excel, or a Web browser.
For more information on pidiag, see the FT Historian Server SE Reference Guide.
Export Procedure
To export audit records from an Audit Database file to XML:
1. Close (page 6) the Audit Database file.
2. Copy the Audit File from the PI\log directory to another directory.
3. Re-open (page 6) the Audit Database file.
4. Use pidiag to export the Audit Database file.
The following is the minimum syntax, which exports all records in the specified file:
pidiag -xa AuditFilePath
For example:
pidiag -xa ..\temp\pibasessAudit.dat > ..\temp\BaseAudit.xml
Optional Arguments
Use the following arguments to control output.
Time Range
To constrain output to audit records during a time range, specify the start time and end time.
Use the -st and -et arguments to specify the time range in Historian Time Format. For details
on Historian Time Format, see the FT Historian Server SE Reference Guide.
The first audit record on or before the start time through the last record on or after the end
time is displayed. For example:
pidiag -xa ..\temp\pibasessAudit.dat -st "21-Feb-99 13:00:00" -et
"*"
This displays the first audit record on or before 1:00 PM, February 21, 1999, through the
current time.
16
Reference
Schema
The exported XML includes a reference to URLs for XSD (XML Schema Definition) files.
The XSD files are a formal declaration of the schema. The schema describes and constrains
the content of the Audit Database output.
Rockwell Automation specifies the URL of a default Historian Audit Database schema that is
W3C-compliant. The default Rockwell Automation schema reference included in the
exported XML is:
<PIAudit xmlns="xml.rockwellautomation.com-schemas-piaudit"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="xml.rockwellautomation.com-schemas-piaudit
http://xml.rockwellautomation.com/Schemas/PIAudit">
In certain cases it may be advantageous to specify a different reference for a schema. For
example, an application running on a computer behind a firewall may not have access to XSD
files on the Internet.
The schema may be specified on the command line by the -xh export header option. The
schema specified replaces everything inside the PIAudit tag in the default PIAudit schema
reference. Specifying this argument has no other effect.
For example, use the following command to refer to the schema located at
http://xml.yourcompany.com/Schemas/PIAudit:
pidiag -xa ..\temp\pibasessAudit.dat -xh
"xmlns=\"xml.rockwellautomation.com-schemas-piaudit\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
xsi:schemaLocation=\"xml.rockwellautomation.com-schemas-piaudit
http://xml.yourcompany.com/Schemas/PIAudit\""
18
Appendix A
Note: To view the message logs on Historian Server versions 3.0 and later, you need
read permissions to the PIMSGSS entry in the Database Security tool in SMT
(Security > Database Security).
ArchiveEditLogging Deletions and edits to For changes to take effect, restart the
Historian Archive and Archive and Snapshot Subsystems
Historian Snapshot events
BatchDbEditLogging Changes and deletions in For changes to take effect, restart the
PIBatch and PIUnitBatch Archive Subsystem
These tuning parameters are not available in SMT by default; to enable logging, you must
add the parameters to the General tab in the Tuning Parameters tool (Operation > Tuning
Parameters).
To enable logging, add these entries to the list of tuning parameters. Set the value to 1 to
enable and 0 to disable.
Field Description
Message source The message source is Archive Edit
Edit date Edit date
Edit type Delete or Replace
Point ID Point ID
Connection ID Connection ID
User Only in message from the Historian Snapshot
Subsystem
Event time Edit time
New value Only in message from the Historian Snapshot
Subsystem
Old value Only in message from Historian Archive.
20
Technical Support and Resources
Rockwell provides dedicated technical support internationally, 24 hours a day, 7 days a week.
You can read complete information about technical support options, and access all of the
following resources at the Rockwell Automation Support Web site:
http://www.rockwellautomation.com/support/
Knowledgebase
The KnowledgeBase provides a searchable library of documentation and technical data, as
well as a special collection of resources for system managers.
http://www.rockwellautomation.com/knowledgebase/
Installation Assistance
If you experience a problem within the first 24 hours of installation, review the information that is contained in
this manual. You can contact Customer Support for initial help in getting your product up and running.
United States or Canada 1.440.646.3434
Outside United States or Use the Worldwide Locator at http://www.rockwellautomation.com/support/americas/phone_en.html, or contact your
Canada local Rockwell Automation representative.
Documentation Feedback
Your comments will help us serve your documentation needs better. If you have any suggestions on how to
improve this document, complete this form, publication RA-DU002, available at
http://www.rockwellautomation.com/literature/.
Copyright © 2013 Rockwell Automation, Inc. All rights reserved. Printed in the U.S.A.