CDBDB
Summary
This command updates reference file relations in a database using SQL provided
by CDBS. The SQL should contain insert/delete statements that correspond
to each entry in a release catalog. New reference files result in
database insertions, while obsolete reference files result in database
deletions.
Description
If the CDB_DISK_CHECK resource option is TRUE, this command first verifies
that the reference files listed in a release catalog are found on disk,
either in the incoming directory or in the reference file directories.
Next the database name (CDB_DB_NAME) is added to the CDBS-provided
SQL and the SQL is executed. The SQL output is parsed for an indication
that it succeeded (the string "OPUS_MODS_OK" occurs in the output if the
entire SQL transaction was committed to the database).
Usage
cdbdb release_name path_name
[-localfiles] [-checkonly]
The flags (preceded by a dash '-') are optional and can be specified in
any order by any number of unique characters (e.g. -localfiles, -loc, -l
are treated equally). The positional parameters 'release_name' and 'path_name'
are required and MUST occur in the order listed.
Input
Output
The database changes described in the CDBS-provided SQL are applied
to the database defined by the CDB_DB_NAME resource value and the DSQUERY environment
variable.
Constraint
The SQL is only verified
by searching for a string that indicates the database transaction was committed.
No verification is performed to ensure that the database changes made have
anything to do with the reference files listed in a particular release
catalog. That confirmation is performed by the CDBVER command.
Resource File
Required Command-Line Arguments
release_catalog_mask (required)
A newly released catalog file name. Wild card names are permitted.
Will be searched for in CDB_CATALOG_IN_DIR unless the -localfiles flag
is set on the command line, in which case the current directory is used.
path_file_name (required)
An OPUS path file providing resource values. The full path name is
required (OPUS_DEFINITIONS_DIR is not automatically prepended).
Optional Command-Line Arguments
-c[heck_only]
Optional flag specifying that only catalog verification is performed.
This consists of locating the files listed in the catalog on disk and verifying
that sufficient free disk space exists to perform the installation. No
disk changes are made in this mode.
-l[ocalfiles]
Optional flag specifying that CDBDB will look in the current working
directory for the release catalogs. If no catalogs are found, no processing
will be performed.
Examples
$ cdbdb opus_101_z.cat OPUS_DEFINITIONS_DIR:blue.path
Verifies that the files listed in the catalog opus_101_z.cat
exist on disk in either the incoming (CDB_RETRIEVAL_IN_DIR) or reference
file directories. Once verified the SQL file opus_101_z.sql is
used to load the reference file relations in the database.