Selectable field definition

This section describes the Selectable field definition syntax used in the WHERE clause of the LOGSCAN statement.

The Selectable field definition is one part of the Search condition definition syntax used to select log records during a log scan. Other parts of the syntax enable you to compare one item or 'field' within a log record against a constant value. The Selectable field definition enables you to specify which field Log Master compares against the constant value.

The following figure shows the Selectable field definition syntax.


You can use synonyms to specify the selectable field of a filter predicate. For more information about synonyms, see Synonyms.

OptionDescription
UNIT OF RECOVERYSelect log records based on a unit of recovery. A unit of recovery is a recoverable sequence of operations within Db2, identified by a 12-character hexadecimal unit of recovery identifier (URID). For extended RBAs/LRSNs, this is a 20-character hexadecimal value. The identifier represents the log address of the first log record in the unit of recovery.
  • In a non-data-sharing environment, specify a relative byte address (RBA) value.
  • In a data sharing environment, specify a log record sequence number (LRSN) value.

BMC Software strongly recommends that you specify LRSN values in a data sharing environment. If you need to use RBA values (for example, when you have RBA values from DSN1LOGP output), you can specify an RBA value as long as your filter operator is equal (=), not equal (<>), IN, or NOT IN. For all other operators, specify an LRSN value.

If you use unit of recovery-related criteria (for example, URID, authorization ID, plan name, or correlation ID) to select log records for an output DDL file, be aware of whether your selected objects were created explicitly or implicitly.

CORRELATION IDSelects log records based on a correlation ID. A correlation ID is a unique string identifier for a specific Db2 thread.
PLAN NAMESelects log records based on a plan name. A plan name is a character string representing an application plan, the control structure used by Db2 to process SQL statements.
AUTH IDSelects log records based on an authorization ID. An authorization ID is a character string used to connect to Db2 (it frequently represents an individual, a work group, or a function).
CONNECTION IDSelects log records based on a connection ID. A connection ID is a string identifier associated with a specific address space connection.

CONNECTION TYPE

Selects log records based on a connection type. A connection type is a string constant representing the manner in which a unit of recovery thread is attached to Db2. The following paragraphs contain a partial list:
  • BATCH
  • DIST (for DDF: Distributed Data Facility)
  • DB2CALL

  • MASS (for IMS)
  • RRSAF (Recoverable Resource Manager Services Attachment Facility)
  • SASS (for CICS)
  • SYSTEM (for Real Time Statistics)
  • TSO
  • UTILITY
DATABASE NAMESelects log records in a specific database.
TABLESPACE NAMESelects log records in a specific table space.
TABLE NAMESelects log records in specific table.
DBIDSelects log records based on a database ID. A database ID is the internal identifier that Db2 assigns to a database. Enter the DBID as a decimal number (for example, 505) or a hexadecimal number (for example, x'01F9').
PSIDSelects log records based on a page set ID. A page set ID is the internal page set identifier that Db2 assigns to a given table space. Enter the PSID and the accompanying DBID as decimal numbers (for example 505.028 ) or as hexadecimal numbers (for example, x'01F9'.x'001C' ).
OBIDSelects log records based on a table's object ID. An object ID is the internal identifier that Db2 assigns to an object. Enter the table's OBID and the accompanying DBID as decimal numbers (for example, 505.007 ) or as hexadecimal numbers (for example, x'01F9'.x'0007' ).
MEMBER NAMESelects log records based on the name of a given member of a data sharing group. Select this field only in a data sharing environment.
MEMBER ID
Selects log records based on the member ID of a given member of a data sharing group. Select this field only in a data sharing environment. Enter the member ID as a decimal number (for example, 14) or a hexadecimal number (for example, x'0D').

Filtering on a member ID or a member name determines what log records Log Master selects; a filter does not influence whether Log Master reads log files from other members in a data sharing group. To influence which member’s log files Log Master reads, use the USELGRNG keyword of the OPTION statement (USELGRNG).

SUBSYSTEM NAME

Selects log records based on the subsystem identifier (SSID) of a given Db2 subsystem. Select this field only in a data sharing environment. (Log Master also accepts the synonym SSID, see Synonyms).

LUW NETWORK IDSelects log records based on the logical unit of work (LUW) network ID. An LUW identifies a thread within a network and is used to correlate local and remote activity for a single distributed transaction. The LUW network ID is an eight byte character field.
LUW NAMESelects log records based on the logical unit of work (LUW) name. The LUW name is an eight byte character field.
LUW UNIQUE VALUE

Selects log records based on the logical unit of work (LUW) unique value. The LUW six byte numeric field that can contain an LRSN value.

ALIAS

Selects log records based on an alias that represents a specific table. For information about this keyword and the input source for your log scan, see Selectable field definition#SYNONYM.

SYNONYM

Selects log records based on a synonym that represents a specific table.

  • If your input source is a logical log file, an option to include synonym and alias information must have been specified when the logical log file was created. For more information, see INCLUDE SYNONYMS.

  • If your input source is the bootstrap data set (INPUT BSDS) or specific Db2 log files (INPUT DB2LOG), specifying this keyword can slow performance. For information on reducing the performance impact, see INCLUDE SYNONYMS.

OBJECT SET

Selects log records based on the table space names in a BMC AMI Recovery Manager for Db2 object set.

COMMAND

Selects log records based on a Db2 command, such as START TRACE.

STATUS

STATUS definition syntax diagram

Log Master detects and processes the following statuses:

StatusDescription
AREO*The table space, index, or partition identified should be reorganized for optimal performance.
AREORThe object is in REORG-pending advisory status, indicating that you should reorganize the object to apply pending definition changes. The object is not restricted; it is accessible by both readers and writers. The object is not modified until you run the REORG job that materializes the definition changes.
ACHKPAn error occurred in the LOB column of the base table space. The base table space has the auxiliary CHECK-pending restrictive status.
AUXWEither the base table space or XML table space is in the auxiliary warning advisory status, indicating an error in the LOB column, or the LOB table space is in the auxiliary warning advisory status, indicating an invalid LOB. This status can also indicate an error in a base table space with an XML column or in an XML table space.
CHKPThe object (a table space, a partition within a table space, or an index) is in the CHECK-pending status.
COPYPThe object (a table space or a partition within a table space) is in the COPY-pending status. An image copy is required for this object.
ICOPYThe object is in the informational COPY-pending advisory status.
PSRBDThe entire non-partitioning index space is in a page set REBUILD-pending status.
RBDPThe physical or logical index partition is in the REBUILD-pending status.
RBDP*The logical partition of a non-partitioning index is in the REBUILD-pending status, and the entire index is inaccessible to SQL applications. However, only the logical partition needs to be rebuilt.
RECPThe object (a table space, table space partition, index space, index partition, or logical index partition) is in the RECOVER-pending status.
REORPThe data partition is in the REORG-pending status.
ROThe database, table space, table space partition, index space, or index space partition is started for read-only activity.
STOPThe database, table space, table space partition, index space, or index space partition is stopped.
STOPATCOMMITThe object is in STOP status to prevent access by new requesters. Currently running applications have continued access only until their next commit. The object is put into STOP status when all jobs release their claims on it and all utilities release their drain locks on it.
STOPPA stop is pending for the database, table space, table space partition, index space, or index space partition.
TURNOFFUTRO A utility has turned the UTRO state off.  The UTRO state indicates that a utility that allows RO access is running on the table space, table space partition, index space, or index spaces partition.
TURNONUTROA utility has turned the UTRO state on.
TURNOFFUTRWA utility has turned the UTRW state off. The UTRW state indicates that a utility that allows RW access is running on the table space, table space partition, index space, or index spaces partition.
TURNONUTRWA utility has turned the UTRW state on.
TURNOFFUTUT A utility has turned the utility running the UTUT state off.  The UTUT state indicates that a utility that allows only UT access is running on the table space, table space partition, index space, or index space partition.
TURNONUTUTA utility has turned the utility running the UTUT state on.
UTThe database, table space, table space partition, index space, or index space partition is started for utility processing only.
UTROA utility is processing on the table space, table space partition, index space, or index space partition that allows only RO access. If the utility was canceled before the object was drained, the object can allow SQL access because the object was not altered by the utility.
UTUTA utility is processing on the table space, table space partition, index space, or index space partition that allows only UT access. If the utility was canceled before the object was drained, the object can allow SQL access because the object was not altered by the utility.
WEPRThis status displays page-range information related to a write error.

UTILITY

UTILITY definition syntax diagram

Log Master detects and processes the following utilities:

UtilitiesDescription
CATMAINT Updates the catalog. The utility generally runs during migration to a new release of the IBM Db2 subsystem.
CHECKChecks table spaces for violations of referential and table check constraints. Also, the CHECK utility checks for consistency between a base table space and the corresponding LOB or XML table spaces. CHECK INDEX tests whether indexes are consistent with the data that they index.
COPYCreates copies of certain objects.
COPYTOCOPY Makes image copies from an image copy that the COPY utility takes. The COPYTOCOPY utility can also make image copies from inline copies that the REORG or LOAD utilities make.
DIAGNOSEGenerates information useful in diagnosing problems.
LOADLoads one or more tables of a table space. The LOAD utility loads records into the tables and builds or extends any indexes that are defined on them.
MERGECOPYMerges copies or inline copies that other utilities produce. The COPY and COPYTOCOPY utilities produce image copies, and the LOAD and REORG utilities produce inline copies. The utility can merge several incremental copies of a table space to make one incremental copy. It can also merge incremental copies with a full image copy to make a new full image copy.
MODIFY

With the RECOVERY option, deletes certain records from the Db2 catalog, directory, and DBD. This utility also recycles Db2 version numbers for reuse.

Warning

For information about the MODIFY utility, the risks involved, and the potential damage it can inflict on your data if not used properly, see the relevant IBM Db2 product information.

QUIESCE

The MODIFY online utility, with the STATISTICS option, deletes unwanted statistics history records from the corresponding catalog tables. You can remove statistics history records before a specific date, or you can remove records of a specific age. You can delete records for an entire table space, index space, or index.
REBUILDReconstructs indexes or index partitions from the table that they reference.
RECOVERRecovers data to the current state or to a previous point in time by restoring a copy and then applying log records. The online RECOVER utility can also recover data to a previous point in time by backing out committed work.
RECOVER INDEXReorganizes an index space to improve access performance and reclaim fragmented space. You can specify the degree of access to your data during reorganization, and you can collect inline statistics by using the STATISTICS keyword.
REORGReorganizes a table space to improve access performance and to reclaim fragmented space. In addition, the utility can reorganize a single partition or range of partitions of a partitioned table space.
REPAIR

Repairs data. The data can be your own data or data that you would not normally access, such as space map pages and index entries.

Warning

For information about the REPAIR utility, the risks involved, and the potential damage it can inflict on your data if not used properly, see the relevant IBM Db2 product information.

REPORT

Provides information about table spaces, tables, and indexes. You can use REPORT to find the names of related table spaces, such as referentially related table spaces and LOB table spaces. You can also use REPORT to find the necessary information for recovery.
RUNSTATSGathers summary information about the characteristics of data in table spaces, indexes, and partitions. Db2 records these statistics in the Db2 catalog and uses them to select access paths to data during the bind process.

TERM

Terminates the execution of a utility job step and releases all the resources associated with the step.
UNLOADUnloads data from one or more source objects to one or more BSAM sequential data sets in external formats. The source can be Db2 table spaces or Db2 image copy data sets.
SYSPLANSelects log records based on a specific sysplan record.
SYSPACKAGE

Selects log records based on a specific package collection ID and name.\

SYSPACKAGE LOCATION

Selects log records based on a specific package location.

SYSPACKAGE COLLECTION

Selects log records based on a specific package collection ID.

SYSPACKAGE NAME

Selects log records based on a specific package name.

SYSPACKAGE VERSION

Selects log records based on a specific package version.

owner.tableName.columnName

Selects log records based on the value of a specific column in a specific table. Log Master can compare the value of a column against a constant value or a set of constant values.

To fully qualify a specific column in a specific table, enter the user ID of the owner of the table. If you do not specify a value, Log Master uses the user ID of the batch job that runs Log Master.

Log Master can also select records based on whether the value in a specific table column has changed or is null. For more information, see the material provided in owner.tableName.columnName CHANGED | NULL.

Do not confuse this type of filter predicate with the Column include/exclude definition that selects table columns in certain types of output. The differences are as follows:

  • A filter predicate based on a column value affects log records in the output (based on the column’s value). If a filter excludes records based on a column’s value, the output still contains the specified column, only certain log records are missing.

  • A Column include/exclude definition affects the entire column in the output (regardless of the value in the column). If a column is excluded, the output does not contain the specified column at all. For more information, see LOGSCAN column include/exclude definition.

BEFORE | AFTER

Selects update log records based on the value of a specific column in your specified table either before or after an update occurs. This keyword directs Log Master to examine either the before row image or the after row image contained in update log records.

ValueDescription
BEFORESelect update log records based on the content of a column’s before image.
AFTERAFTER keyword Select update log records based on the content of a column’s after image.

If you do not specify a value, Log Master selects log records when the content of either the column’s before image or the column’s after image satisfies the conditions of your WHERE clause or filter.

This keyword does not change how Log Master selects insert or delete log records; Log Master selects them based solely on the column’s value. For example, in a WHERE clause or filter you request Log Master to select log records if the column QUANTITY contains a value greater than 500, using the BEFORE keyword. Log Master selects

  • all insert log records where QUANTITY is greater than 500

  • all delete log records where QUANTITY is greater than 500

  • update log records where QUANTITY is greater than 500 before the update was applied

To select update records before a change was applied along with delete log records, use the following WHERE clause syntax:

   WHERE 
     (USERNAME.SOMETABLE.QUANTITY BEFORE = 500
      AND UPDATE TYPE IN(DELETE,UPDATE) )

To select update records after a change was applied along with insert log records, use the following WHERE clause syntax:

   WHERE 
     (USERNAME.SOMETABLE.QUANTITY AFTER = 500 
      AND UPDATE TYPE IN(INSERT,UPDATE) )

Was this page helpful? Yes No Submitting... Thank you

Comments