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:

Warning

Important

You must have enabled the Drop Recovery and Log Image Copies options on the Confirm DROP panel to perform this procedure. For more information, see Dropping-an-object.

To recover the structure and authorizations

  1.  From the Command line of the Primary Menu panel or a list panel, type DROPR TS to display a list of dropped table spaces.

    Warning

    Important

    To display a list of all dropped objects, enter DROPR ALL.

  2. 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
  3. (Optional) Produce the SQL that is required to create the table space and its dependents.
    1. Type 2SQL in the Cmd column beside the table space to be recovered.
    2. 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).
    3. Go to Step 1.
  4. 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.

  5. To mark additional objects for exclusion from recovery, enter X in the Cmd column beside each object.

    Success

    Tip

    You can mark all indexes for exclusion by entering X on the Command line.

  6. Type D or S in the Cmd column beside statements for which you want to display a detailed log entry.
  7. 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
  8. 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 the successful completion of the statement. The object structures and authorizations have now been recovered.

To recover the data

  1. In the Recovery Statements panel, type STOP in the Cmd column of the REC DATA text line.

    Warning

    Important

    You must STOP the table space because the DSN1COPY utility requires exclusive use of the data set.

  2. Press Enter.
  3. In the DB2 Commands panel, press Enter to execute the command.Catalog Manager sends the command to Db2.
  4. Press END.
  5. 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.
  6. Type RECOVER in the Cmd column of the REC DATA text line. Press Enter.

    Warning

    Important

    If several incremental image copies exist, or if the table space had several partitions, several REC DATA text lines might be displayed in the Recovery Statements panel. To recover data, you need to type RECOVER for only one REC DATA line.
    Catalog Manager recovers only to the last image copy. If you also want to recover changes from the log, you must know the to logrba. REC LRBA provides the to logrba. Recovery from the log is only possible if the OBIDs did not change between dropping and recreating the objects.

    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.

  7. In the JCL Dataset field, verify that the specified JCL data set name is allocated and that this is the correct data set.
  8. 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.
  9. In the Build Job field, type Y to build the JCL. Press Enter.
  10. 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.
  11. In the Submit field, type Y to submit the JCL. Press Enter.The batch job must be completed before you can proceed.
  12. When the batch job is completed, press END to display the Recovery Statements panel.
  13. To restart the table space, type START in the Cmd column of the REC DATA text line. Press Enter.
  14. In the DB2 Commands panel, press Enter.Catalog Manager sends the command to Db2.
  15. Press END.
  16. 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.
  17. In the Recovery Statements panel complete the following steps to recover indexes:

    Success

    Tip

    To recover more than one index in the same table space, create a table space (TS) list, and enter RECOVER IX ALL in the Cmd column beside the table space name.

    1. Remove the X notations from any indexes that you marked for exclusion.
    2. In the Execute recovery statements now field, type Y.
    3. Press Enter.

The table space and data recovery are complete.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC AMI Catalog Manager for Db2 13.1