TL-RESTORE

Restores all updates, or a selected list of updates, onto a database from a specified clean log.

Note

TL-RESTORE should normally only be used to selectively restore from a clean log. To restore a complete clean log, using tlmenu is recommended.

Command Class

Cataloged DATA/BASIC program.

Syntax

TL-RESTORE first_clog {(options)}

Syntax Elements

first_clog The name of the first clean log to be restored.

Options

A Causes the restore process to sequence through clean logs in chronological order until no more logs exist. All clean logs in the chain must be present on the database.

AE Causes the restore process to sequence though all existing logs in chronological order, then wait at the EOF mark of the last log until the next log is available. If a log is missing or invalid it is prompted for.

Note

The A and AE options require clean logs to be chained together during logging run time.

C Displays a count of sets of 500 updates applied to the database and information about the images applied.

Hn} Specifies the maximum number of images recorded in the history file (normally TL-LIST). The default is 2000. If n is set to 0, the history function is inhibited.

L Prompts you for alternative file names for the error log and history file, as follows:

ERROR LOG:
HISTORY FILE:

If you enter a name, the file is created if it does not already exist. Rejected images and history information for the restore are then entered into the named files.

At each prompt, if you press return, TL-RESTORE uses a file with the default name (TL-REJECTor TL-LIST as appropriate), creating it if necessary. Pressing return at both prompts is therefore equivalent to executing TL-RESTORE without the L option, when TL-REJECT and TL-LIST are created automatically without prompts.

R Prevents the error log (TL-REJECT) and history file (TL-LIST) from being cleared by a TL-RESTORE. Rejected images and history information for the current restore are then appended to the files.

If this option is not specified, TL-RESTORE clears these files before using them for the current restore.

S Generates an asterisk for each update restored.

Restrictions

Use is restricted to SYSMAN.

TL-RESTORE does not allow you to specify image selection criteria. To initiate selective recovery you must carry out a SELECT operation first; then use TL-RESTORE on the select list.

Log Files

When TL-RESTORE is first executed it creates two files:

TL-REJECT Logs After images that fail to be restored on the database by TL-RESTORE.

TL-LIST Contains history information about the last 2000 images successfully restored and the last 20 images successfully restored per port (see below).

Subsequently TL-RESTORE clears these files before they are used, unless the R option is used, in which case the data is appended to the files. This can be useful during a multi-file restore, to retain previous history information.

History File

TL-LIST contains two items for each log restored, log and log.PORTS, each containing a list of images which have been successfully applied to the database during a TL-RESTORE. For example, for log CLOG1, TL-LIST will contains the following two items:

The name of the history file can be changed with the L option.

You can use the ENGLISH command NEW-GET-LIST to retrieve a list of items from TL-LIST for display. See Selective Recovery for a list of attributes that you can use in selection criteria.

Chaining Clean Logs

Switching logs creates a pointer from the current clean log to the new clean log to which logging is switched. Hence this creates a chain of clean logs which can be restored by TL-RESTORE without manual intervention using the A and E options.

TL-RESTORE with the A option commences by restoring the first clean log on the database then continues with the next clean log in the chain. Assuming the chain is continuous, the restore process restores all clean logs in order right through to the clean log before the current active one.

TL-RESTORE with the AE option sequences through a chain of clean logs in the same way as the A option, however, if the next clean log is not available, TL-RESTORE prompts for the next log and waits, as follows:

Log CLOG2 empty.    Please load new log file.
Hit A to Abort or C to continue.

The chain of clean logs will be interrupted by stopping and starting logging, in which case the restore will terminate at the clean log active when logging was stopped.

Selective Recovery

To carry out a selective recovery you must first execute the SELECT command to compile a select list of the After images and transaction boundary images to be recovered from the clean log, then execute TL-RESTORE. TL-RESTORE will then only restore the images in the select list. For example:

SELECT clean-log-file WITH ACCOUNT account-name AND WITH FILENAME = filename

Log file information can be retrieved under 16 attribute names. They are:

ACCOUNT The Reality account id being used when the image was logged.

CLOGSEQ The sequence number of the image in the clean log.

DATE The date when the image was first logged, stored in internal format.

FILENAME The Reality file for which the image was logged.

INFO Information field from TRANSTART/TRANSEND/TRANSABORT image.

ITEM The item id of the associated item, except transaction boundaries.

ITEMINFO Combines the ITEM and INFO attribute definitions.

OPERATION The type of operation for which the image was logged.

PORT The number of the port being used when the image was logged.

RESULT This is a failure code which will appear in an error log image. It indicates the reason for the failure to restore the update. Clean log items where recovery has not been attempted or where recovery has been successful contain 0.

You can use the perror host command to interpret the code and find out the reason for the failure.

RLOGSEQ The transaction id which is the sequence number of the transaction COMMIT image. All images in the committed transaction have the same RLOGSEQ id as the COMMIT image. Independent updates each have different ids.

SERVICE The Reality service which generated the image. This may be either Reality File Services (RFS) which generates update images or Reality Transaction Services (RXS) which generates transaction boundary images.

TIME The time when the image was first logged, stored in internal format.

TYPE The type of log image. This may be one of Start, Switch, After or Commit. The Commit image is logged at 'Transaction end'.

USER The Reality user-id being used when the image was logged.

Caution

You must not sort items in a clean log as this will cause incorrect sequencing of images during a TL-RESTORE.