Documente Academic
Documente Profesional
Documente Cultură
Contacting Rockwell
Copyright Notice
2013 Rockwell Automation, Inc. All rights reserved. Printed in the USA.
This document and any accompanying Rockwell Software products are copyrighted by Rockwell Automation,
Inc. Any reproduction and/or distribution without prior written consent from Rockwell Automation, Inc. is
strictly prohibited. Please refer to the license agreement for details.
Trademark Notices
FactoryTalk, FactoryTalk Historian Machine Edition (ME), FactoryTalk Historian Site Edition (SE), FactoryTalk
Live Data, FactoryTalk Services Platform, FactoryTalk VantagePoint, FactoryTalk View, FactoryTalk ViewStudio,
Rockwell, Rockwell Automation, Rockwell Software, RSView, RSView Machine Edition, RSView ME Station,
RSView Studio, and RSLinx Enterprise are trademarks of Rockwell Automation, Inc.
Any Rockwell Automation logo, software or hardware not mentioned herein is also a trademark, registered or
otherwise, of Rockwell Automation, Inc.
For a complete list of products and their respective trademarks, go to
http://www.rockwellautomation.com/rockwellautomation/legal-notices/overview.page?%23tab4#/tab4.
Other Trademarks
ActiveX, Microsoft, Microsoft Access, SQL Server, Visual Basic, Visual C++, Visual SourceSafe, Windows,
Windows ME, Windows NT, Windows 2000, Windows Server-, Windows XP, Windows 7, and Vista are either
registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.
Adobe, Acrobat, and Reader are either registered trademarks or trademarks of Adobe Systems Incorporated in
the United States and/or other countries.
ControlNet is a registered trademark of ControlNet International.
DeviceNet is a trademark of the Open DeviceNet Vendor Association, Inc. (ODVA)
OLE for Process Control (OPC) is a registered trademark of the OPC Foundation.
Oracle, SQL*Net, and SQL*Plus are registered trademarks of Oracle Corporation.
All other trademarks are the property of their respective holders and are hereby acknowledged.
Warranty
This product is warranted in accordance with the product license. The products performance may be affected
by system configuration, the application being performed, operator control, maintenance, and other related
factors. Rockwell Automation is not responsible for these intervening factors. The instructions in this
document do not cover all the details or variations in the equipment, procedure, or process described, nor do
they provide directions for meeting every possible contingency during installation, operation, or
maintenance. This products implementation may vary among users.
This document is current as of the time of release of the product; however, the accompanying software may
have changed since the release. Rockwell Automation, Inc. reserves the right to change any information
contained in this document or the software at any time without prior notice. It is your responsibility to obtain
the most current information available from Rockwell when installing or using this product.
Table of Contents
The Historian Audit Database ....................................................................................................... 1
Principles of Operation ....................................................................................................... 1
Maintenance Procedures for the Historian Audit Database ............................................... 1
Edit Historian Server Tuning Parameters ................................................................ 2
Use Historian AuditViewer to Manage Historian Audit Records .............................. 2
Enable Auditing ........................................................................................................ 4
Disable Auditing ....................................................................................................... 4
Specify Tuning Parameters for Audit File Shift ........................................................ 5
AuditMaxKBytes Tuning Parameter............................................................ 5
AuditMaxRecords Tuning Parameter.......................................................... 5
Create New Audit Database Files............................................................................ 5
Closing Audit Database Files for Maintenance........................................... 6
Close Audit Database Files
6
Re-open Audit Database Files
6
Replace Audit Database Files .................................................................... 7
Audit Database File Contents ............................................................................................ 7
Audit Record Definition ............................................................................................ 7
Change Record Definition ........................................................................................ 8
Example Audit Records ...................................................................................................... 8
Historian Points ........................................................................................................ 8
Create ......................................................................................................... 8
Delete .......................................................................................................... 9
Edit .............................................................................................................. 9
Historian Archive .................................................................................................... 10
Remove Archive Event ............................................................................. 10
Edit ............................................................................................................ 11
Module Database and Batch Database ................................................................. 11
Modules .................................................................................................... 12
Module Hierarchy ...................................................................................... 12
Historian Properties .................................................................................. 12
Historian Batches ...................................................................................... 13
Historian Unit Batches .............................................................................. 13
Audit Records Suppressed when End Time is Not Set ............................13
Reference ......................................................................................................................... 13
EnableAudit Tuning Parameter .............................................................................. 13
Audit Database File Open Failure.......................................................................... 15
Historian Snapshot Subsystem Considerations ....................................................15
Data Buffering and the Audit Database ....................................................15
Historian Snapshot Audit Database Exceptions .......................................16
The -xa Option for the pidiag Utility ....................................................................... 16
Export Procedure ...................................................................................... 16
Optional Arguments .................................................................................. 16
Auditing the FactoryTalk Historian SE Server
iii
Table of Contents
Time Range
Unique Audit Record ID
Audit Database Mask
Schema
16
17
17
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.
The Historian Audit Database consists of three distinct files. Each file represents a Historian
Subsystem:
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).
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:
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
Caution: If the Historian Server is installed on Microsoft Cluster Services (MSCS), do
not use Historian AuditViewer to enable auditing. Historian AuditViewer
automatically restarts the Base, Archive, and Snapshot Subsystems when it
enables auditing, which might trigger failover to the other cluster node. On
clustered systems, use SMT to change the EnableAudit tuning parameter to 0,
and then restart the subsystems manually using the cluster administration tool for
your operating system: Microsoft Cluster Administrator for Windows 2000 and
2003, or Failover Cluster Administrator for Windows 2008.
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:
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).
AuditMaxKBytes
AuditMaxRecords
Tuning Parameter
Default
Snapshot
pisnapss_AuditBackupTimeout
5 minutes
Archive
piarchss_AuditBackupTimeout
60 minutes
Base
pibasess_AuditBackupTimeout
60 minutes
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 reopened, 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.
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.
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
Database
Action
Field
Description
AuditRecordID
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.
Description
Property
Before
After
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.
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
Historian
database
DB
RecordID
DB
RecordName
PI Username
Action
2009-09-27
16:37:3107:00
PIPoints
14
NewPoint
OSI\jsmith
Add
Changes
Property
Before
After
PointClass
null
classic
Compdev
null
2.0
Compmax
null
28800
Delete
The following table shows the audit record that results when a user called OSI\jsmith deletes
a point called NewPoint:
Date
FactoryTalk
Historian
database
DB
RecordID
DB
RecordName
PI Username
Action
2009-09-27
16:39:0607:00
PIPoints
14
NewPoint
OSI\jsmith
Remove
Changes
Property
Before
After
PointClass
classic
null
Compdev
2.0
null
Compmax
28800
null
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
Historian
database
DB
RecordID
DB
RecordName
PI UserName
Action
13:00:00
11-Oct-01
PIPoints
Ba:temp.1
OSI\jsmith
Edit
Changes
Property
Before
After
Compmin
10
Compdev
2.0
1.25
Compmax
5000
6000
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.
Remove Archive Event
When an event is removed from the Archive, passing the value is optional. If it is passed, it is
displayed in the Snapshot audit record.
The user is identified through the Snapshot audit record but is shown as 0 in the Archive audit
record.
The following show examples of audit records generated by the Historian Snapshot
Subsystem and Historian Archive Subsystem when an event is deleted from the Archive:
Removal: Historian Snapshot Subsystem
Date
FactoryTalk
Historian
database
DB
RecordID
TimeStamp
PI UserName
Action
2009-09-25
11:59:2807:00
PIArchive
2009-09-25
11:41:25-07:00
OSI\jsmith
Remove
Attempt
Changes
Property
Before
After
Value
Null or value
(128.2149)
Null
FactoryTalk
Historian
database
DB
RecordID
TimeStamp
PI UserName
Action
2009-09-25
11:59:2807:00
PIArchive
2009-09-25
11:41:25-07:00
Remove
Changes
10
Property
Before
After
Value
128.2149
Null
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:
Edit: Historian Snapshot Subsystem
Date
FactoryTalk
Historian
database
DB
RecordID
TimeStamp
PI UserName
Action
2009-09-25
11:58:5607:00
PIArchive
2009-09-25
11:23:2507:00
OSI\jsmith
Edit
Attempt
Changes
Property
Before
After
Value
Null
159
FactoryTalk
Historian
database
DB
RecordID
TimeStamp
PI UserName
Action
2009-09-25
11:58:5607:00
PIArchive
2009-09-25
11:58:56-07:00
Edit
Changes
Property
Before
After
Value
150
159
Flags
Null
Flags has changed from empty to S. S is the Substituted flag that Historian Server sets when
an event is edited.
11
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-499eb6e3-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.
Historian Unit Batches
PIUnitBatches only have one unique issue, which is showing changes to the PISubbatches
collection. This is handled similarly to PIProperties. Unlike PIProperties, however, subbatches are uniquely identified, so a rename is not the same as a deletion followed by an
addition.
Audit Records Suppressed when End Time is Not Set
Audit records are only generated for batches if the End Time is set. This prevents the
creation and modification of PIBatches, PIUnitBatches, and PITransferRecords through
automated processes such as Batch Event File Monitor (EVTintf) and the Historian Batch
Generator (PIBaGen). Automatic generation of audit records for each modification
indefinitely would quickly overwhelm the Audit Database.
Deletions of batches are an exception. All deletions create an audit record when auditing is
enabled.
Reference
EnableAudit Tuning Parameter
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
Point
Subsystem
Historian Base
Digital State
Value
Hexadecimal
Decimal
0x1
0x2
13
0x4
0x10
16
User
0x20
32
Group
0x40
64
Trust
0x80
128
Modules
0x100
256
Headings and
HeadingSets
0x200
512
Server
0x4000
16384
Collective
0x8000
32768
Identity
0x10000
65536
Identity Mapping
0x20000
131072
Database Security
0x40000000
1073741824
0x400
1024
Campaign
0x800
2048
Batches
0x1000
4096
Unit Batches
0x2000
8192
Transfer Records
Historian Archive
Snapshot
Historian Snapshot
0x10000000
268435456
Archive
0x30000000
536870912
0xFFFFFFFF
-1
All Databases
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.
Note: The pisubsystemAudit~UTCSeconds.dat files in the PI\log directory
contain valid audit records that are not included in the primary defined Audit
Database file. There is no merge function available. To maintain a complete audit
trail, you need to store and back up these alternate files.
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).
15
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\""
17
18
Appendix A
Tracked Actions
Notes
ArchiveEditLogging
BatchDbEditLogging
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.
19
Field
Description
Message source
Edit date
Edit date
Edit type
Delete or Replace
Point ID
Point ID
Connection ID
Connection ID
User
Event time
Edit time
New value
Old value
20
Field
Description
Source
Edit Time
Always included
Edit type
Edit or Delete
Batch ID
Unique ID
Always included
Start time
End time
Product
Recipe
ProcedureName
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
Outside United States or
Canada
1.440.646.3434
Use the Worldwide Locator at http://www.rockwellautomation.com/support/americas/phone_en.html, or contact your
local Rockwell Automation representative.
Contact your distributor. You must provide a Customer Support case number (call the phone number above to obtain
one) to your distributor to complete the return process.
Please contact your local Rockwell Automation representative for the return procedure.
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.