You can use the File Maintenance Facility to extract data
from an archive file, based upon expiration criteria. Data that meets
the expiration criteria is deleted from the original file and written
to a new file. This newly created archive file replaces the original
source file. A backup of the original file can be created as part
of this process.
Expiration criteria can be specified in the command file
in a named Access Definition or using parameters.
Command file
syntax for the Expire process follows:
[ //comment ]
[ OPTIMDIR optimdirectory]
AF { arcservername | (local)} arcfilename
EXPIREAF filename [ EXPIREAFX filename]
[ AF_BACKUP filename]
AD adname | {[ SQL dbalias.cid.tblname sql ]
[ VAR variablename value] [ PNS pnsfile] }
REGISTER {(optimdirectory [GROUP groupidentifier][DESC description])| NO }
[COLLECTIONS collection1,...,collectionn]
RUN ARCHIVEEXPIREDATA
- //
- At the beginning of a line, indicates that the text
following the slashes is a comment. Enter comment text on one line,
anywhere in the command file.
- OPTIMDIR
- Name of the Optim directory for the archive files to be created
by this process. The default is the Optim directory in which the AF
resides.
- AF
- Name of the archive file that is the source for this
process. This parameter is required. Specify:
- arcservername
- Name of the server for the source archive file.
- (local)
- Specify (local) if the source archive file is not associated with
a server.
- arcfilename
- Name of the source archive file. The archive file must be registered
in the Optim Directory specified in the OPTIMDIR parameter.
- EXPIREAF
- Name of the archive file to be created, based on the expiration
criteria. This parameter is required. The name you specify for EXPIREAF
must be a name that does not exist on the server.
- EXPIREAFX
- Name of the archive index file to be created. This parameter is
optional. If the Access Definition being used defines indexes, an
index file is created.
- AF_BACKUP
- Name of a backup file for the original source archive file. This
parameter is optional. Supply a unique file name for AF_BACKUP to
create a backup copy of the original Archive File.
- AD
- Access Definition to use in this process to create the EXPIREAF.
This parameter is optional. Specify:
- adname
- Name of an existing Access Definition. The expiration criteria
in this Access Definition is used to create the EXPIREAF.
Note: - You must specify one of the following parameters for this process:
AD, SQL, VAR, PNS.
- If you specify the AD parameter, do not include SQL, VAR, or PNS.
- SQL
- SQL that results in a valid WHERE clause to be executed
against the Access Definition start table. This SQL is used instead
of any SQL that exists in the Access Definition that was used to create
the source AF. Specify:
- dbalias.cid.tblname
- DB alias, creator ID and table name that is the target of the
WHERE clause.
- VAR
- Provide one or more values for substitution variables
used in the SQL WHICH clause. The variables must exist in the Access
Definition.
- PNS
- Name of a point-and-shoot file. Provide the name
of a file local to the Optim server, that contains one or more start
table key values. You can use this parameter as the only criteria
for the expire process or in addition to SQL and VAR.
- REGISTER
- Option for registering the AF. This parameter is required. Specify:
- optimdir
- Name of the directory in which to register the AF.
- GROUP
- 1 to eight-character name of the group for the AF.
- DESC
- Description to associate with the AF registry entry.
- NO
- Do not register the AF in a directory.
- COLLECTIONS
- Add the EXPIREAF to one or more collections. This parameter is
valid only when EXPIREAF is registered.