KB Article # 3122OSI8
___________________________________________________________________
How Automatic Archive Creation works
Product: PI Server, PI Archive
Version(s): 3.4 and later
Platform: N/A
Issue
How do you set up automatic archive creation?
Solution
In PI Server 3.4 and later, you can set the Archive_AutoArchiveFileRoot parameter so that the PI Server generates new archives automatically when shifting.
Benefits
When enabled, the PI System Manager does not have to create all empty archives ahead of time. PI will create them for you.
Drawbacks
If you are not monitoring the disk space on your PI Server, you could potentially encounter a situation where your hard disk full and PI either overwrites old archives or data backs up in the event queue and is not archived.
Tuning Parameters
The following tuning parameters govern the behavior of the automatic archive creation feature:
Archive_AutoArchiveFileRoot - Auto Archive Creation
This parameter enables automatic archive creation. If present, this parameter defines the path and file name prefix to be used for new archives. For example, a setting of "C:\PI\arc\auto_" defines that newly created archives should be placed in the "C:\PI\arc folder and have a file name prefix of "auto_". The tuning parameters Archive_AutoArchiveFileFormat and Archive_AutoArchiveFileExt govern how the remainder of the archive’s name is formed.
Archive_AutoArchiveFileFormat
Note: The Archive_AutoArchiveFileFormat and the Archive_AutoArchiveFileExt parameters are only applicable for PI server version 3.4.375.67 and above.
This parameter governs the generated portion of the filename to be given to the archive file to be created. Possible values for this parameter and the corresponding filename are:
0 - _D_Mon_YYYY_H_M_S<.ext>
1 - < prefix >_YYYY-MM-DD_HH-MM-SS<.ext>
2 - < prefix >_UTCSECONDS<.ext>
Where < prefix > is the file name prefix specified in the Archive_AutoArchiveFileRoot parameter and <.ext> is the file extension specified in the Archive_AutoArchiveFileExt parameter.Archive_AutoArchiveFileExt
This parameter specifies the file extension to be added to the name of the archive file to be created. The default value of this parameter is ".arc".
Archive_OverwriteDataOnAutoShiftFailure
This parameter determines how the PI Archive subsystem behaves if it encounters an error (i.e. insufficient disk space or disk error) while attempting to create a new archive.
When Archive_OverwriteDataOnAutoShiftFailure is enabled (set to "1") and an error is detected while attempting to create a new archive file (i.e. insufficient disk space or disk error), it will shift into the oldest filled archive on the hard drive and begin overwriting older data.
When Archive_OverwriteDataOnAutoShiftFailure is disabled (set to "0"), and an error is detected while attempting to create a new archive file (i.e. insufficient disk space or disk error), archiving is disabled and data will queue in the Event Queue file. You can later detach the event queue file and reprocess it into an archive, but this is time consuming and can be disruptive.
Note: The default value of Archive_OverwriteDataOnAutoShiftFailure is enabled by default in PI Server 3.4.380. In PI Server 3.4.380SP1 and later, it is disabled by default.
You can find more information about automatic archive file creation in the PI Server System Management Guide.
Set up Automatic Archive Creation
Follow the six steps below to ensure that the automatic archive creation is properly configured. You can use either the Tuning Parameters in PI System Management Tools (PI SMT) or piconfig for all steps. Below are instructions for both.
I. Add the Archive_AutoArchiveFileRoot parameter to the PI Tuning Parameters and set the Value field.
Using PI System Management Tools
Open the Operation> Tuning Parameters branch and click the Archive tab.
Select an existing timeout parameter, right-click and choose "New."
Add the timeout parameter "Archive_AutoArchiveFileRoot" and set the Value to a path and file name prefix for the new archives, such as “"c:\pi\arc\piauto_".
The path you enter in the Value field must exist in order to work properly.
Using piconfig
Type "piconfig" at a command prompt in the pi\adm directory and press Enter.
Enter the following lines pressing Enter after each. Substitute "c:\pi\arc\piauto_"
with the path and file name prefix of your choice:
@table pi_gen, pitimeout
@mode edit, t
@istr name, value
Archive_AutoArchiveFileRoot, c:\pi\dat\piauto_
@ends
II. If running PI Server 3.4.380 or later, set the Archive_OverwriteDataOnAutoShiftFailure parameter.
Using PI System Management Tools
Open the Operation> Tuning Parameters branch and click the Archive tab.
Select an existing timeout parameter, right-click and choose "New."
Add the timeout parameter "Archive_OverwriteDataOnAutoShiftFailure" and set the Value to 1 to enable or 0 to disable, depending on your preference.
Using piconfig
Type "piconfig" at a command prompt in the pi\adm directory and press Enter.
Enter the following lines pressing Enter after each. Substitute the value following the “Archive_OverwriteDataOnAutoShiftFailure," with a value of 1 to enable or 0 to disable, depending on your preference.
@table pi_gen, pitimeout
@mode edit, t
@istr name, value
Archive_OverwriteDataOnAutoShiftFailure, 1
@ends
III. Add the Archive_AutoArchiveFileFormat parameter to the PI Tuning Parameters and set the Value field.
Using PI System Management Tools
Open the Operation> Tuning Parameters branch and click the Archive tab.
Select an existing timeout parameter, right-click and choose "New."
Add the timeout parameter "Archive_AutoArchiveFileFormat " and set the Value to 0, 1 or 2 to determine the format of the filename (see list above) for new archives.
Using piconfig
Type "piconfig" at a command prompt in the pi\adm directory and press Enter. Enter the following lines pressing Enter after each. Substitute the value following the “Archive_AutoArchiveFileFormat," with a value of 0, 1 or 2 (see list above), depending on your preference.
@table pi_gen, pitimeout
@mode edit, t
@istr name, value
Archive_AutoArchiveFileFormat, 0
@ends
IV. Add the Archive_AutoArchiveFileExt parameter to the PI Tuning Parameters and set the Value field.
Using PI PI System Management Tools
Open the Operation> Tuning Parameters branch and click the Archive tab. Select an existing timeout parameter, right-click and choose "New." Add the timeout parameter “Archive_AutoArchiveFileExt” and set the Value to the extension to use for the filename for new archives.
Using piconfig
Type "piconfig" at a command prompt in the pi\adm directory and press Enter. Enter the following lines pressing Enter after each. Substitute ".arc" with the file extension of your choice:
@table pi_gen, pitimeout
@mode edit, t
@istr name, value
Archive_AutoArchiveFileExt,.arc
@ends
V. Make sure your primary archive is a fixed-size primary archive.
The auto archive creation will not work with a dynamic primary archive. The size of automatically created archives will always be taken from the size of that initial primary archive.
To do this, open Operation> Archive Manager in PI SMT 3 and look at the "Type" for the primary archive. (You can also run "piartool -al" at a pi\adm prompt.) Archive[0] should be set to "Type: 0" which is fixed.
VI. If running PI Server prior to 3.4.380, make sure you have one valid, shiftable, empty target archive available, even though it will not be used if automatic archives can be created.
This archive can be dynamic or fixed, unlike the primary archive. The purpose for this archive is to ensure you always have an archive to shift to if for some reason the auto archive creation fails.To test if the parameter is properly set, you can force an archive shift using the "piartool -fs" from a command prompt in the pi\adm directory. A new archive should be generated in the directory that you specified.
How to deactivate the Auto Archive Creation:
Using PI System Management Tools:
To turn off the Archive_AutoArchiveFileRoot timeout parameter, set the value to blank (nothing) in the PI SMT Tuning Paramters table.
Using piconfig
You can also delete the parameter using piconfig.
Type "piconfig" at a command prompt in the pi\adm directory.
Next, list the content of the timeout table:
@table pi_gen,pitimeout
@mode list
@ostr *
@ends
You should see Archive_AutoArchiveFileRoot parameter.
To delete it, change to Delete mode:
@mode delete
@istr name
Archive_AutoArchiveFileRoot
@ends
Lastly, verify that this parameter is removed by listing the contents again:
@mode list
@ostr *
@ends
Notes
Caution: When relying solely on the automatic archive creation, you expose yourself to more points of failure. It might be easier to keep track of available disk space, then to keep track of what archives are mounted and what they contain and whether or not they can be allowed to be overwritten. But the downside to using the above is that one could run out of free disk space if one is not watchful.
We recommend using MCN to monitor disk space on the PI Server and using PI Notifications to warn when there is low free space on the PI Server. Both MCN and PI Notifications are included with PI Server 2010.
Article ID: 3122OSI8 Created: 2/14/2005 Created by: DPERROW
Article Type: Troubleshooting Last Updated: 1/10/2011 Modified by: cwong
____________________________________________________________________
Copyright OSIsoft, Inc., 2008 All rights reserved.
Users may print extracts of content from this website for personal use only.
Republication or redistribution of OSIsoft content is expressly prohibited
without OSIsoft's prior written consent.
No comments:
Post a Comment