DBLOAD


DBLOAD

     Loads data from backup volumes (DBUNLOAD tape) into the database.

SYNTAX

     [:FILE DBLOAD[=filename] [;DEV=device] ]
:RUN DBLOAD.PUB.SYS
WHICH DATABASE? database_name [/maint_word]
WARNING: The LANGUAGE of the database is DIFFERENT from
the language found on the DBLOAD MEDIA. Continue DBLOAD operation? (Y/N):

DATA SET m: x ENTRIES
.
.
.
END OF VOLUME n, y READ ERRORS RECOVERED
DBLOAD OPERATION COMPLETED


PARAMETERS

filename        is the name (up to 8 characters) that replaces  DBLOAD in the
 mount request at the operator's console.

device is the device class name of the device from which the data
entries are to be loaded. Tape is the only supported device class.

database_name is the name of a TurboIMAGE/XL database root file created
in the current session or job's account and logon group.

maint_word is the maintenance word defined by the database creator.
 This word must be supplied by anyone other than the database creator.

The file equation is optional and specifies the device class name for the device
from which the data entries are to be loaded. The default is device class TAPE.

Message Variables

m   is the number of the last data set loaded from the backup volume.

x is the number of entries loaded into the specified data set.
 x is zero if the data set is an automatic master.
 Note: This number may not represent the total number of records
 in the data set if entries existed prior to DBLOAD execution.

n is the volume number.

y is the number of read errors from which DBLOAD recovered.


OPERATION

The volume(s) must have been produced by the DBUNLOAD program, and the
database name on the volume must be exactly the same as the database name,
or root file name, in the current session or in the group and account of the job.

DBLOAD issues an error message if the database name or maintenance word specified
is different from the DBUNLOAD file. In addition, DBLOAD checks that the group
and account specified is the same as that in the DBUNLOAD file. To reload the
identical data into the database, the DBUTIL ERASE command must be used prior
to DBLOAD unless the database has been purged and re-created. Executing the
>>ERASE command reinitializes the data sets to an empty state while keeping
the root file and data sets as catalogued MPE/iX files on the disk.

DBLOAD reads each entry from the backup volume and puts it into the respective
data set from which it was read by DBUNLOAD. If a data set in the receiving
database is an automatic master, no entries are directly put into it by DBLOAD,
even though there are entries on the volume associated with the data set's number.
Automatic master entries are created as needed in the normal fashion when entries
are put into the detail data sets related to the automatic master.

DBLOAD calls the DBPUT procedure to put the entries read from the backup volume
into the appropriate data sets. In every case, the DBPUT dset parameter is a
data set number and the list parameter is an at-sign followed by a semicolon (@;).
Prior to calling DBPUT, DBLOAD moves each entry from the backup volume into a buffer.

The length of the entry is determined by the definition of entries in the target
data set. When DBLOAD is calling DBPUT, this length is less than, equal to, or
greater than the length of an entry on the backup volume. If the data set entry
is larger than the backup entry, the data is left-justified and is padded out to
the maximum entry length with binary zeros. If the data entry is smaller than the
backup entry, the backup volume record is truncated on the right and the truncated
data is lost.

The location of master set entries is based on their key item value which is hashed
to an internal location. The detail data set entries are put into consecutive data
set records with the appropriate new chain pointer information.

DBLOAD requires exclusive access to the database. If the database is already open
to any other process, DBLOAD terminates and prints the message:

DATABASE IN USE

The file equation is optional and specifies the device class name for the device
from which the data entries are to be loaded. The default is device class TAPE.

In session mode, DBLOAD prompts for the database name and maintenance word.
In job mode, the database name and maintenance word, if any, must be in the
record immediately following the RUN command.

The language ID of the database is stored along with data when DBUNLOAD has
been used to copy the database to tape. If the database native language
(on disk) is not consistent with the system level native language (on tape),
the following message will appear (refer to appendix A for more information):

WARNING: The LANGUAGE of the database is DIFFERENT from
the language found on the DBLOAD MEDIA.
Continue DBLOAD operation? (Y/N):

NOTE

When using DBLOAD, the database language must match the language ID
stored in the backup media. If they do not match, DBLOAD will give
you a warning messages in a session, and if you reply Y, the DBLOAD
will continue. However, in a job, DBLOAD does not load the database.

After each data set is copied, DBLOAD prints a message on the list file
device which includes the data set number and the number of entries copied.

When the end of a volume is encountered, DBLOAD prints a message
(where z is the logical device number of the unit, XXXX is the database name,
and n is the volume number). DBLOAD also instructs the operator to mount a
new tape with the following message on the system console:

MOUNT DBLOAD VOLUME XXXXn ON LOGICAL DEVICE z

If the operator mounts the wrong volume, DBLOAD informs the operator
with the following message (where z is the logical device number):

WRONG VOLUME MOUNTED ON LOGICAL DEVICE z

DBLOAD then terminates and you must begin loading the database again.
This requires executing the DBUTIL >>ERASE command again if any entries
have already been loaded.

After the data entries have been successfully loaded,
DBLOAD prints a completion message.

Console Messages

After you supply the database name and DBLOAD opens the input file,
a message is displayed on the system console. A tape must be mounted
on the appropriate unit and identified through an operator reply.
Refer to the Volume Management Reference Manual for instructions
about console interaction.

Using ControlY

When executing DBLOAD in session mode, ControlY can be pressed to
request the approximate number of entries in the current data set
that have already been copied. DBLOAD prints the following message
on $STDLIST:

<CONTROL Y> DATA SET m:x ENTRIES HAVE BEEN PROCESSED

Example:

   :RUN DBLOAD.PUB.SYS

WHICH DATABASE? ORDERS/SELL
DATA SET 1: AUTOMATIC MASTER
DATA SET 2: 19 ENTRIES
DATA SET 3: 25 ENTRIES
DATA SET 4: 12 ENTRIES
DATA SET 5: 32 ENTRIES
DATA SET 6: 258 ENTRIES
END OF VOLUME 1, 0 READ ERRORS RECOVERED
DATABASE LOADED

END OF PROGRAM

Initiate execution of DBLOAD. Supply the database name and maintenance word.
DBLOAD indicates the number of entries copied. Data set 1 is an automatic master
so 0 entries are copied; the entries are created as related detail entries are
copied to the database.

One volume was copied with no read errors.

NOTE

For optimum performance, DBLOAD uses deferred output when it adds entries
to a database. With deferred output, data and structural information cannot
be written back to disk each time DBPUT returns to the DBLOAD program.
As a result, the database is not considered to be logically or structurally
complete on disk until the DBLOAD is complete. During DBLOAD the database
being loaded is considered inconsistent ("bad") and only at the completion
of a DBLOAD run is the database considered consistent ("good") again.

During a load if an MPE/iX or hardware failure occurs, the database is
definitely not structurally intact, and it returns its "bad" flag.
After the system is brought back up, TurboIMAGE/XL does not allow the
database to be opened for normal access. If you get a "bad database" error
in such a situation, erase the database with DBUTIL and then perform the
load again.

Alternatively, the database can be purged with DBUTIL and then restored
from a backup copy.


EXAMPLE(S)

     See above

ADDITIONAL INFORMATION

Commands:  DBUNLOAD, DBUTIL