DROPRECOVERY statement
The following figure shows the DROPRECOVERY statement syntax.
During a drop recovery job step, Log Master obtains information from the Db2 log and (depending on the type of recovery requested) creates the following forms of output:
Data definition language (DDL) statements
Either:
BMC AMI Recover SYSIN syntax
DSN1COPY syntax (and other associated files)
SQL statements
Db2 Command
The Log Master online interface also creates JCL to run the different types of output in the correct order to accomplish the recovery. The generated JCL contains multiple job steps. If necessary, you can edit the JCL to adapt it to your environment.
The DROPRECOVERY statement determines what actions Log Master takes to obtain the log information, what types of output it produces, and what syntax Log Mastergenerates for BMC AMI Recover or DSN1COPY.
Important
You can also obtain log information from input logical log files. For more information, see INPUT statement.
Logical log files include all catalog activity (that is, WHERE DBNAME = DSNDB06) during the time the object was dropped. For a DSN1COPY recovery, the logical log file also includes all transactions from the point of the image copy to the point just before the drop occurred.
Be aware of the following points as you specify an automated drop recovery:
To get meaningful results, you must select a minimum of
One type of object to recover (using the DATABASE NAME, TABLESPACE NAME, or TABLE NAME keywords)
One form of output that processes recovery information (using the RECOVER DATASET keyword or the REPORT keyword)
Log Master supports the use of BMC AMI Recover to recover table spaces and tables. Log Master supports the use of DSN1COPY only to recover a single dropped table space.
The Db2 Recover utilities that Log Master works with do not support the recovery of 'versioned' dropped objects. A Db2 object is versioned during the period after its structure is changed by a DDL statement (for example, an ALTER COLUMN SET DATA TYPE statement) and before a Db2 Reorg utility is run to reconcile the multiple versions.
Drop recovery recovers dependent objects based on the URID of their referenced object. For example, a table and its table space are dependent objects. If a table is dropped in one URID and its table space is then dropped in a different URID, you must specify both in drop recovery. At execution, Log Master determines that recovery of the table space is required and recovery of the table is unnecessary.
Important
When you recover a segmented table space with tables that have been dropped in separate units of recovery, Log Master sets the TOLOGPOINT option to the URID of the first dropped table. Consequently, Log Master automatically recovers objects updated only to the URID of the first dropped table. That is, drop recovery does not recover any update or rows inserted in other tables after the first drop. To recover those, you should perform manual recovery.
To perform a drop recovery, Log Master must perform row completion processing on Db2 catalog log records. Because of the large number of log records related to the catalog, this processing can cause your job to run longer and require more resources than a job that does not read the Db2 catalog. If you frequently operate on objects stored in the catalog, you can improve performance by creating more frequent image copies of the catalog or by defining tables in the Db2 catalog with Data Capture Changes (DCC).
Log Master provides automated drop recovery for LOB and XML table space or table objects. When you specify a LOB or XML base table or table space in the DROPRECOVERY statement, Log Master extends drop recovery discovery to include all of its LOB and XML auxiliary table spaces and tables.
Log Master supports the use of copies registered in BMCXCOPY to recover table spaces, with the exception of cabinet copies.
Option | Description | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
DATABASE NAME databaseName | Directs Log Master to obtain information about and generate output to recover a complete database that has been dropped from the Db2 catalog. The databaseName defines the name of the database as it was known to Db2 before it was dropped. | ||||||||||||||||||||||||||||||||
TABLESPACE NAME DSNDB04 | databaseName.tableSpaceName | Directs Log Master to obtain information about and generate output to recover the dropped table space defined by a given database name and table space name.
| ||||||||||||||||||||||||||||||||
Recover parameters | Specifies the values of keywords in BMC AMI Recover syntax. The specific keywords in the Recover parameters relate to the output image copies that BMC AMI Recover can create as it recovers a table space. For more information about these parameters, see Recover parameters. Depending on the utility programs available in your environment, you might be able to recover a single dropped table space by using DSN1COPY instead of BMC AMI Recover. For more information, see DSN1COPY DATASET Output definition. | ||||||||||||||||||||||||||||||||
TABLE NAME userID.tableName | Directs Log Master to obtain information about and generate output to recover a specific table defined by tableName. Use this keyword when a table has been dropped, but the original database and table space still exist in the Db2 catalog.
To recover a dropped table, Log Master generates data sets containing DDL, SQL and BMC AMI Recover syntax. If you use the Log Master online interface, Log Master also generates JCL that uses the generated data sets to:
Important When a table space contains a single table, you can improve drop recovery performance by recovering the dropped table directly into the original table space. For more information, see INDEP YES | NO in the Temporary objects definition topic. | ||||||||||||||||||||||||||||||||
Temporary objects definition | Defines whether Log Master creates temporary copies of the table defined by tableName (and the table space that tableName was originally part of) during drop recovery. These keywords also define the physical and logical location where BMC AMI Recover can store the temporary copies. When defined, Log Master uses this information in the BMC AMI Recover INDEP OUTSPACE syntax. For more information, see Temporary objects definition. | ||||||||||||||||||||||||||||||||
OUTPUT ddName DATASET | Specifies the output data set characteristics that the BMC AMI Recover product uses to build image copies during the recovery. You can repeat this option within the same DROPRECOVERY statement. You can use the symbolic variables &DSNAME, &TSNAME, &DSNUM, &DATE, &TIME, &JOBNAME, &SSID, &SYSUID and &GATN. To create an output image copy for each table space partition, you must use &DSNUM. Important You cannot use existing data sets for BMC AMI Recover outcopy outputs. | ||||||||||||||||||||||||||||||||
RECREATE DATASET Output definition | Specifies the characteristics of the output data set that contains generated data definition language (DDL) statements. When executed, the DDL statements recreate the structures of the dropped objects (using UNDO DDL) and re-establish their relationships (including granting authorizations, re-creating VIEWs, and so forth). They also create structures for the temporary objects used to recover a dropped table. Output choices for this data set are similar to other data sets. For more information, see LOGSCAN output definition.
| ||||||||||||||||||||||||||||||||
RECOVER DATASET Output definition | Specifies the characteristics of the output data set that contains generated SYSIN syntax for BMC AMI Recover. When BMC AMI Recover executes the syntax, it recovers the dropped objects. Depending on the type of recovery you request, BMC AMI Recover recovers the objects either to their original database location or to a temporary location. The output choices for this data set are the same as those for other product data sets. For more information, see LOGSCAN output definition. Log Master supports the automatic drop recovery of a clone table. To accomplish this, Log Master generates BMC AMI Recover syntax in the following files:
Important Image copies of clone tables are required to recover clone tables.
Data set type and description of RECOVER2 data set name
Examples for RECOVER and RECOVER2 output file names
You might be able to recover a single dropped table space by using DSN1COPY instead of BMC AMI Recover. For more information, see DSN1COPY DATASET Output definition. You cannot generate BMC AMI Recover syntax and DSN1COPY syntax in the same drop recovery action. | ||||||||||||||||||||||||||||||||
DSN1COPY DATASET Output definition | Specifies the characteristics of a partitioned data set (PDS) that contains generated SYSIN syntax for the IBM utility DSN1COPY and other associated files. Log Master supports the use of DSN1COPY only to recover a single dropped table space. The JCL that Log Master generates for a drop recovery action with DSN1COPY contains additional job steps to perform tasks that are otherwise handled by BMC AMI Recover. You cannot generate BMC AMI Recover syntax and DSN1COPY syntax in the same drop recovery action. Log Master generates the following members in this PDS: For the output choices available for this PDS, see LOGSCAN output definition. | ||||||||||||||||||||||||||||||||
REPAIR DATASET Output definition | Specifies the characteristics of the output data set that contains generated Db2 commands. When the commands are executed, they repair versions or catalog table spaces that were versioned when the Db2 objects were dropped. The output choices for this data set are the same as those for other product data sets. For more information, see LOGSCAN output definition. | ||||||||||||||||||||||||||||||||
CHECK DATASET Output definition | Db2 might place a table space into check pending status after the recovery job step in drop recovery processing. This option specifies the characteristics of the output data set that contains generated Db2 commands that remove the check pending status. When the commands are executed, they perform
The output choices for this data set are the same as those for other product data sets. For more information, see LOGSCAN output definition. | ||||||||||||||||||||||||||||||||
MIGRATE DATASET Output definition | Specifies the characteristics of the output data set that contains generated SQL statements. Use this keyword only if you have used the TABLE NAME keyword to recover an individual table. When the SQL statements are executed, they migrate data from a temporary table in a temporary table space into a re-created empty version of the table in the original table space. The output choices for this data set are the same as those for other product data sets. For more information, see LOGSCAN output definition. | ||||||||||||||||||||||||||||||||
RUNSTATS DATASET Output definition | Specifies the characteristics of the output data set that contains generated RUNSTATS commands. When the commands are executed, they execute the RUNSTATS utility before the REBIND step is executed. Depending on the dropped object that you are recovering, Log Masterwrites RUNSTATS commands into the RUNSTATS data set as follows:
| ||||||||||||||||||||||||||||||||
REBIND DATASET Output definition | Specifies the characteristics of the output data set that contains generated Db2 commands. When the commands are executed, they rebind any application plans that were invalidated when the Db2 objects were dropped. The output choices for this data set are the same as those for other product data sets. For more information, see LOGSCAN output definition. | ||||||||||||||||||||||||||||||||
FROM Range definition TO Range definition | Specifies a portion of the Db2 log when the Db2 objects were dropped. Log Master scans this portion of the log (also referred to as a time frame) to obtain information needed for the drop recovery action. FROM indicates the start point and TO indicates the end point of the log scan. Each Range definition defines one point in the Db2 log. For more information, see Range definition. | ||||||||||||||||||||||||||||||||
REPORT definition | Directs Log Master to create an output report. The Drop Recovery report contains information about the specified recovery, including information about the dropped Db2 objects, the object ID translation (OBIDXLAT) information, and the application plans that were invalidated when the Db2 objects were dropped. For more information, see Report definition. |
More information about SCHEMA and TRANSFER OWNERSHIP YES mutual exclusive
( BMC.DB2.SPE2110 )
When the SCHEMA option is specified in DDL, SQL, or DROPRECOVERY syntax, Log Master generates a SET SCHEMA statement (the default SCHEMA) at the beginning of the output dataset and does not generate other SET SCHEMA statements afterwards. With TRANSFER OWNERSHIP YES specified, Log Master builds CREATE TABLE, INDEX, or VIEW with an unqualified name, the default SCHEMA is the qualifier. However, a fully qualified name is still used in other DDL statements, such as ALTER and GRANT. These DDL statements may get an SQL error if the qualifier in the log does not match the default SCHEMA.
More information about TRANSFER OWNERSHIP
If you run a TRANSFER OWNERSHIP statement without the proper authorization to perform the transfer, you will get an SQL error. The error will occur when the user executing the statement is not the owner of the object or does not have SECADM authority.
To prevent the SQL error, Log Master generates a SET CURRENT SQLID statement with the OWNER value from the log before the TRANSFER OWNERSHIP statement for TABLE, INDEX, and VIEW objects. However, the error can still occur when any one of the following conditions exists:
- The old owner is a ROLE or the owner name is longer than 8 bytes in length and cannot be used in a SET CURRENT SQLID statement.
The use ID executing the DDL is not the owner of the DATABASE, TABLESPACE, or STOGROUP.
- The CREATOR and OWNER of the TABLE, INDEX, or VIEW are different.
Use one of the following resolutions for the error:
- Run the generated DDL using the user ID that initially ran the statements being migrated.
- Generate DDL with TRANSFER OWNERSHIP YES if the CREATOR and OWNER of an object are different.
- Manually add or modify the SET CURRENT SQLID statement to the object owner before the TRANSFER OWNERSHIP statement.
- Run the generated DDL with a user ID that has SECADM authority.
Comments
Log in or register to comment.