Recovering an object and its data
The following procedure describes how to recover a table space structure that was dropped by
Catalog Manager
, ALTER, or
Change Manager
and how to recover the data in the table space:
To recover the structure and authorizations
From the Command line of the Primary Menu panel or a list panel, type DROPR TS to display a list of dropped table spaces.
Press Enter.The Drop Recovery List panel is displayed. This list is a subset of the Drop Recovery Log.
DEFF-R --------------------- Drop Recovery List ---------- Row 1 to 16 of 45
Command ===> Scroll ===> CSR
02
CMD will show commands for this list. Type command and press ENTER
Enter S to select the object to be recovered.
TABLESPACE
Cmd Date Time AuthId Product Type Name
----v----1----v----2----v----3----v----4----v----5----v----6----v----7----v---
2011-02-01 14.43 RDAPXB2 ACT010 TS DBXNAUT.SBXNCOL
2011-01-19 16.25 RDAPXB2 ACT010 TS PLBDBA1.PLBALT02
2011-01-19 14.09 RDAPXB2 ACT010 TS PLBDBA1.PLBALTER
2011-01-17 14.16 RDAPXB2 ACT010 TS PXBQXPB.HASHPXB1
2011-01-10 16.33 SKH2 AEX010 TS MXCDBG5.MXSS01G5
2011-01-10 16.13 SKH2 AEX010 TS MXCDBG5.MXSS01G5
2011-01-10 16.01 SKH2 AEX010 TS MXCDBG5.MXSS01G5
2011-01-10 15.39 SKH2 AEX010 TS MXCDBG5.MXSS01G5
2011-01-10 15.27 SKH2 AEX010 TS MXCDBG5.MXSS01G5
2011-01-10 15.25 SKH2 AEX010 TS MXCDBG5.MXSS01G5
2011-01-08 12.58 RDAMSL AEX010 TS MXCDBG5.MXSS01G5
2011-01-08 11.25 RDAMSL AEX010 TS MXCDBG5.MXSS01G5
2011-01-07 18.21 RDAMSL AEX010 TS MXCDBG5.MXSS01G5
2011-01-07 17.44 RDAMSL AEX010 TS MXCDBG5.MXSS01G5
2011-01-07 16.58 SKH AEX010 TS MXCDBG5.MXSS01G5
2011-01-07 16.44 SKH AEX010 TS MXCDBG5.MXSS01G5- (optional) Produce the SQL that is required to create the table space and its dependents.
- Type 2SQL in the Cmd column beside the table space to be recovered.
- Press Enter.The Confirm SQL panel is displayed, from which you can edit the SQL or save it in the SQL_Table or a PDS. The 2SQL command works similarly to the HDDL command (see Generating-DDL-to-create-objects).
- Go to Step 1.
When the Primary Menu panel or list panel is displayed, type S in the Cmd column beside the table space to be recovered, and then press Enter.The Recovery Statements panel is displayed, which shows which objects will be recovered with the table space.
DEFF-R --------------------- Recovery Statements ----------- Row 1 to 4 of 4
Command ===> Scroll ===> CSR
Enter D or S to describe or ED to edit a single recovery log row.
Execute recovery statements now N (Y/N)
TABLESPACE=DBXNAUT.SBXNCOL
Enter X on statement line to exclude it from recovery.
Cmd Seq Type Name Text
----v----1----v----2----v----3----v----4----v----5----v----6----v----7----v---
1 TS DBXNAUT.SBXNCOL CREATE TABLESPACE SBXNCOL IN DB
2 TB RDABXN.TBXNCOL CREATE TABLE RDABXN.TBXNCOL ( C
3 TB RDABXN.TBXNCOL ALTER TABLE RDABXN.TBXNCOL ACTI
4 RDABXN.MBXN_MASK CREATE MASK RDABXN.MBXN_MASK ON
******************************* Bottom of data ********************************Catalog Manager automatically excludes the statements that are shown in the following table. These statements are displayed on the Recovery Statements panel, but are marked with X for exclusion from processing.
Exclusion
Reason
REC DATA
You must recover objects before recovering data.
REC LRBA
This is a comment which points to the log rba.
SYNONYM
Exclusion enables you to change the SQLID for synonyms.
To mark additional objects for exclusion from recovery, enter X in the Cmd column beside each object.
- Type D or S in the Cmd column beside statements for which you want to display a detailed log entry.
The following figure shows a Describe Audit Log Entry panel. Press END to display the Recovery Statements Panel.
DEFF-R ------------------ Describe Audit Log Entry ------- Row 1 to 18 of 23
Command ===> Scroll ===> CSR
04
-------------------------------------------------------------------------------
FROM ACT101.RECOVERY_LOG
------------------------------------------------------------------------------
Logts. . . . . . : 2011-02-01-14.43.53.716869
Authid . . . . . : RDAPXB2
Session_seq. . . : 1
Sequence . . . . : 1
Drop_seq . . . . : 1
DBID . . . . . . : 350
OBID . . . . . . : 1
PSID . . . . . . : 2
Object_type. . . : TABLESPACE
Object_qual. . . : DBXNAUT
Object_name. . . : SBXNCOL
Dep_obj_typ. . . : TABLESPACE
Dep_obj_qal. . . : DBXNAUT
Dep_obj_nam. . . : SBXNCOL
Product. . . . . : ACT010
Action . . . . . : CREATE TABLESPACE SBXNCOL IN DBXNAUT USING STOGROUP- In the Execute recovery statements now field, type Y to recover the object structures and authorizations. Press Enter.The Recovery Statements panel is refreshed to show the results of the recovery operation. An OK message in the Cmd column indicates successful completion of the statement. The object structures and authorizations have now been recovered.
To recover the data
In the Recovery Statements panel, type STOP in the Cmd column of the REC DATA text line.
- Press Enter.
- In the DB2 Commands panel, press Enter to execute the command.Catalog Manager sends the command to Db2.
- Press END.
- In the Drop Recovery List , type S in the Cmd column beside the table space to be recovered, and then press Enter.The Recovery Statements panel is displayed.
Type RECOVER in the Cmd column of the REC DATA text line. Press Enter.
Catalog Manager invokes the DSN1COPY utility to recover the data that was stored in the dependent tables. The DSN1COPY Droprecovery Utility panel is displayed. The Utility Options section of the panel shows each option that you can set when using DSN1COPY. Press HELP for a description of these options.
- In the JCL Dataset field, verify that the specified JCL data set name is allocated and that this is the correct data set.
- In the Set JCL Options field, type Y to set your options for generating JCL.The JCL Generation Options panel is displayed. Press END to return to the DSN1COPY Droprecovery Utility panel.
- In the Build Job field, type Y to build the JCL. Press Enter.
- In the Edit Dataset field, type Y to edit the data set. Press Enter.The JCL data set is displayed in the ISPF edit panel. After editing, press END to display the DSN1COPY Droprecovery Utility panel.
- In the Submit field, type Y to submit the JCL. Press Enter.The batch job must be completed before you can proceed.
- When the batch job is completed, press END to display the Recovery Statements panel.
- To restart the table space, type START in the Cmd column of the REC DATA text line. Press Enter.
- In the DB2 Commands panel, press Enter.Catalog Manager sends the command to Db2.
- Press END.
- In the Drop Recovery List , type S in the Cmd column beside the table space to be recovered, and then press Enter.The is displayed.
In the Recovery Statements panel complete the following steps to recover indexes:
- Remove the X notations from any indexes that you marked for exclusion.
- In the Execute recovery statements now field, type Y.
- Press Enter.
The table space and data recovery are complete.
Related topic