Creating a consistent set of copies at a point in time


You suspect a table space or index has been damaged by an application or a media failure.

If you have a point of consistency but no copy close to the point of the damage, you can use this procedure to create a copy while the investigation of the damage is still underway. If the spaces must be recovered, you will have a single copy created for each space that allows recovery without requiring log or incremental copies.

To create a consistent set of copies at a point in time

  1. Find or create a point of consistency.The most common way to achieve a point of consistency is to issue a QUIESCE command on a set of table spaces in a single statement as shown in the following figure.

    //QUIESCE1 EXEC DSNUPROC,SYSTEM=DBAJ,UID='AFRRM31',
    // UTPROC='',REGION=4M,
    // LIB='SYS2.DB2.PROD.DSNLOAD'
    //DSNUPROC.SYSPRINT DD SYSOUT=*
    //DSNUPROC.SYSDISC  DD DUMMY
    //DSNUPROC.UTPRINT  DD SYSOUT=*
    //DSNUPROC.SYSERR   DD UNIT=WORK,SPACE=(CYL,(2,2))
    //DSNUPROC.SYSMAP   DD UNIT=WORK,SPACE=(CYL,(2,2))
    //DSNUPROC.SYSIN DD *
    QUIESCE TABLESPACE AFRFIN.AFRACCT
            TABLESPACE AFRFIN.AFRTRAN
            TABLESPACE AFRFIN.AFRSUMM
            TABLESPACE AFRFIN.AFRHIST

    Output from the QUIESCE follows in the following figure.

    DSNU050I   DSNUGUTC - QUIESCE TABLESPACE AFRFIN.AFRACCT TABLESPACE
    AFRFIN.AFRTRAN TABLESPACE AFRFIN.AFRSUMM TABLESPACE AFRFIN.AFRHIST
    DSNU477I > DSNUQUIA - QUIESCE SUCCESSFUL FOR TABLESPACE AFRFIN.AFRACCT
    DSNU477I > DSNUQUIA - QUIESCE SUCCESSFUL FOR TABLESPACE AFRFIN.AFRTRAN
    DSNU477I > DSNUQUIA - QUIESCE SUCCESSFUL FOR TABLESPACE AFRFIN.AFRSUMM
    DSNU477I > DSNUQUIA - QUIESCE SUCCESSFUL FOR TABLESPACE AFRFIN.AFRHIST
    DSNU474I > DSNUQUIA - QUIESCE AT RBA 0004D176C05C
    DSNU475I   DSNUQUIB - QUIESCE UTILITY COMPLETE, ELAPSED TIME= 00:00:00
    DSNU010I   DSNUGBAC - UTILITY EXECUTION COMPLETE, HIGHEST RETURN CODE=0

    Other ways to obtain a point of consistency include using:

    • The point of a SHRLEVEL REFERENCE incremental copy
    • The point of an ARCHIVE LOG MODE(QUIESCE)

      You might use the keyword TOLOGPOINT LASTARCHQ.

    • A Db2 shutdown with spaces in a consistent state

      You might use the keyword TOLOGPOINT LASTSHUTDOWN.

    • The start of the first member of a data sharing group to be started, assuming the spaces were in a consistent state and all members were down
    • BMC AMI Recovery Manager for Db2 to locate quiet points based on log ranges
    • BMC AMI Log Master to locate quiet points in the log
  2. Recover with OUTCOPY ONLY using TORBA (or TOLOGPOINT).The point of consistency, which in this case is the quiesce point indicated by TORBA LASTQUIESCE, is now used to create new copies from the old copies and logs without reading the space itself.

    The example the following figure uses:

    • The dynamic allocation of output data sets with wildcards for defining the data set name
    • The automatic generation of GDGs using the AFRGDG DD statement
    • The recovery of all indexes associated with each table space that is being recovered
    //RECOVER EXEC PGM=AFRMAIN,REGION=0M,
    // PARM='DBAJ,AFRAQDN,NEW,MSGLEVEL(1)'
    //STEPLIB  DD DISP=SHR,DSN=product.libraries
    //         DD DISP=SHR,DSN=DB2.DSNEXIT
    //         DD DISP=SHR,DSN=DB2.DSNLOAD
    //AFRGDG   DD DSN=AFR.PROD.GDGDEF(GDGDEF01),DISP=SHR
    //SYSIN    DD *
      OPTIONS OUTCOPY ASCODED INDEXLOG YES

      OUTPUT COPY DSNAME AFR.IC.&DB.&SP(+1) UNIT CART CATLG YES STACK YES

      RECOVER TABLESPACE AFRIN.AFRACCT
                   OUTCOPY ONLY   REGISTER ALL   OUTCOPYDDN COPY
              INDEX ALL TABLESPACE AFRIN.AFRACCT
                   OUTCOPY ONLY   REGISTER ALL   OUTCOPYDDN COPY
              TABLESPACE AFRIN.AFRTRAN
                   OUTCOPY ONLY   REGISTER ALL   OUTCOPYDDN COPY
              INDEX ALL TABLESPACE AFRIN.AFRTRAN
                   OUTCOPY ONLY   REGISTER ALL   OUTCOPYDDN COPY
              TABLESPACE AFRIN.AFRSUMM
                   OUTCOPY ONLY   REGISTER ALL   OUTCOPYDDN COPY
              INDEX ALL TABLESPACE AFRIN.AFRSUMM
                   OUTCOPY ONLY   REGISTER ALL   OUTCOPYDDN COPY
              TABLESPACE AFRIN.AFRHIST
                   OUTCOPY ONLY   REGISTER ALL   OUTCOPYDDN COPY
              INDEX ALL TABLESPACE AFRIN.AFRHIST
                   OUTCOPY ONLY   REGISTER ALL   OUTCOPYDDN COPY
       TORBA LASTQUIESCE

 

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

BMC AMI Recover for Db2 13.1