The following figures show the syntax of the LOGSCAN command.
LOGSCAN syntax diagram
LOGSCAN syntax—Table space specification
LOGSCAN syntax—Single index specification
LOGSCAN syntax—Multiple index specification
LOGSCAN syntax—TORBA or TOLOGPOINT specification
LOGSCAN command dependencies and prohibitions
The dependencies and prohibitions for using the LOGSCAN command are as follows:
A LOGSCAN command cannot be included in the same SYSIN with any of the following statements:
If you specify FROMRBA or FROMLOGPOINT, you must specify LOGAPPLY ONLY as well.
If you specify BACKOUT, you cannot specify LOGONLY or LOGAPPLY ONLY.
The LOGSCAN command does not consider change accumulation files.
Additionally, consider the following items when you scan indexes:
If you have used the BMC PACLOG for Db2 utility to exclude the index log records, the LOGSCAN command cannot be used for such indexes.
If you specify LOGSCAN INDEX (ALL) or LOGSCAN INDEXSPACE (ALL), LOGSCAN INDEX and LOGSCAN INDEXSPACE do not support the FROMRBA/FROMLOGPOINT options. You can use separate index specifications with LOGSCAN INDEX and LOGSCAN INDEXSPACE to use those options.
If a table space is scanned to a prior point in time, the default TORBA or TOLOGPOINT value for recovery of any indexes on that table space is the log point specified for the table space. If you specify different log points for the table space and its index with TORBA or TOLOGPOINT, BMC AMI Recover ends with an error.
BMC AMI Recover does not prevent a scan a specific point in time for an index that does not include a scan for the table space or other indexes on the table space.
Indexes must always have a copy or other backup if LOGSCAN INDEX or LOGSCAN INDEXSPACE is used without BACKOUT. If an index is created on a table that contains data, Db2 does not log the index updates. Similarly, index rebuilds or updates that result from LOG YES utilities are not logged. If the index is created on a table, an image copy or other backup must be made before the index can be scanned.
In addition to the LOG NO SYSCOPY events that make a table space unrecoverable, any LOAD LOG YES or REORG LOG YES event between the image copy and the TORBA or TOLOGPOINT value makes an index unrecoverable. REBUILD INDEX and REORG INDEX can also render an index unrecoverable, and BMC AMI Recover cannot detect these events if non-BMC utilities are used.
You cannot use LOGSCAN INDEX or LOGSCAN INDEXSPACE through a point-in-time recovery event created by using BACKOUT.
LOGSCAN option descriptions
LOGSCAN provides information about the number and size of log records required for recovery. You can use this information to size the log sort. A report is printed describing the log records for each object named in the LOGSCAN.
The following topics describe the options available with LOGSCAN. Not all of the options described are valid in a single LOGSCAN TABLESPACE, LOGSCAN INDEX, or LOGSCAN INDEXSPACE command. The recovery strategy that best meets your needs determines which options you should include in a single command statement.
- Table space specification for LOGSCAN
- Single index specification for LOGSCAN
- Multiple index specification for LOGSCAN
- CLONE for LOGSCAN
- OBJECTSET specification for LOGSCAN
- TORBA or TOLOGPOINT specification for LOGSCAN
- LOGAPPLY ONLY for LOGSCAN
- LOGONLY for LOGSCAN
The LOGSCAN TABLESPACE, LOGSCAN INDEX, and LOGSCAN INDEXSPACE commands specify one or more table spaces or indexes, or table space or index data sets, for scanning. A single table space, index, or data set can be scanned to a specific log point or to the current state (by using all of the log records that apply). Multiple table spaces, indexes, or data sets can also be scanned to a specific log point or to the current state. You can have as many LOGSCAN TABLESPACE, LOGSCAN INDEX, or LOGSCAN INDEXSPACE commands in a job step as necessary; however, BMC AMI Recover examines all command statements in the job step before processing starts so that all log processing can be combined and activities can be optimally scheduled.