Space announcement

   

This space provides the same content as before, but the organization of the home page has changed. The content is now organized based on logical branches instead of legacy book titles. We hope that the new structure will help you quickly find the content that you need.

Example 4: Recovering to a specified copy

With the TOCOPY option, you can specify the name of the last image copy to be used by BMC AMI Recover when restoring the table space.

If the copy that you specify is an incremental image copy, the prior full copy and any intervening incremental image copies are merged.

Example 4A: Using TOCOPY with a named copy

The example shown in the following figure illustrates a table space recovery using only a full image copy and an index rebuild that includes all of the indexes on the table space.

JCL using TOCOPY with a named copy

//AFREX04A JOB (PAFR),'EXAMPLE 4A',                                     

//         class="Q",NOTIFY=&SYSUID, 
//         MSGCLASS=X 
//* 
//RECOVER EXEC PGM=AFRMAIN,REGION=0M, 
//            PARM='DGE,EXAMPLE04A,NEW/RESTART,MSGLEVEL(2)' 
//STEPLIB  DD DISP=SHR,DSN=product.libraries
//         DD DISP=SHR,DSN=DB2.DSNEXIT
//         DD DISP=SHR,DSN=DB2.DSNLOAD
//SYSIN     DD * 
RECOVER TABLESPACE BMCDBSMP.BMCTS014 
  TOCOPY RDASTC.BMCDBSMP.BMCTS014.IC(0) 
REBUILD INDEX(ALL) TABLESPACE BMCDBSMP.BMCTS014 NOWORKDDN 
/* 
//

Example 4B: Using TOCOPY LASTCOPY

The example shown in the following figure uses the keyword LASTCOPY for the value of the TOCOPY data set name instead of providing the name of the copy.

Using TOCOPY LASTCOPY can be useful in a number of routine situations. In the example, a routine backup of three table spaces is performed (using BMC AMI Copy) followed by a batch application that updates those table spaces with transactions that have accumulated since the prior backup. This process is followed by a conditional recovery.

If the batch application:

  • Ends abnormally, the spaces are restored to the state existing at the time the current copy was made using TOCOPY LASTCOPY instead of naming the copy

  • Runs successfully, no recovery is performed.

Using TOCOPY LASTCOPY in this way avoids having to modify the JCL for routine operations.

//AFREX04B JOB (PAFR),'EXAMPLE 4B', 
//         class="Q",NOTIFY=&SYSUID, 
//         MSGCLASS=X 
//* 
//* ------------------------------------------------------------------- 
//* THIS STEP TAKES FULL IMAGE COPIES OF THREE TABLE SPACES 
//* ------------------------------------------------------------------- 
//* 
//BMCCOPY EXEC PGM=ACPMAIN,REGION=0M, 
//             PARM='DGE,COPY4B,NEW/RESET,MSGLEVEL(1)' 
//STEPLIB  DD DISP=SHR,DSN=product.libraries
//          DD DISP=SHR,DSN=DB2.DSNEXIT
//          DD DISP=SHR,DSN=DB2.DSNLOAD
//CP00001   DD DSN=RDASTC.BMCDBSMP.BMCTS001.IC(+1),DISP=(,CATLG), 
//             DCB=(SYS1.MODEL),UNIT=SYSDA,SPACE=(CYL,(25,5)) 
//CP00002   DD DSN=RDASTC.BMCDBSMP.BMCTS002.IC(+1),DISP=(,CATLG), 
//             DCB=(SYS1.MODEL),UNIT=SYSDA,SPACE=(CYL,(25,5)) 
//CP00003   DD DSN=RDASTC.BMCDBSMP.BMCTS003.IC(+1),DISP=(,CATLG), 
//             DCB=(SYS1.MODEL),UNIT=SYSDA,SPACE=(CYL,(25,5)) 
//SYSIN     DD * 
 COPY TABLESPACE BMCDBSMP.BMCTS001 
   FULL YES COPYDDN (CP00001) RESETMOD YES 
   SHRLEVEL REFERENCE 
 COPY TABLESPACE BMCDBSMP.BMCTS002 
   FULL YES COPYDDN (CP00002) RESETMOD YES 
   SHRLEVEL REFERENCE 
 COPY TABLESPACE BMCDBSMP.BMCTS003 
   FULL YES COPYDDN (CP00003) RESETMOD YES 
   SHRLEVEL REFERENCE 
/* 
//SYSPRINT  DD SYSOUT=* 
//* 
//* -------------------------------------------------------------------
//* THIS STEP UPDATES THE TABLE SPACES COPIES IN THE PREVIOUS STEP 
//* -------------------------------------------------------------------
//* 
//*UPDATER EXEC PGM=...................................................
//*................................................................... 
//*... (BATCH APPLICATION THAT UPDATES THE COPIED TABLE SPACES) ...... 
//*... (SIMULATED WITH FOLLOWING SQL) ................... ...... 
//*................................................................... 
//* UPDATE BMCTB001, BMCTB002, BMCTB003 
//*================================================================== 
//UPDATE01 EXEC PGM=IKJEFT01,DYNAMNBR=20 
//STEPLIB  DD DSN=SYS2.DB2.DSNLOAD,DISP=SHR 
//SYSTSPRT DD SYSOUT=* 
//SYSPRINT DD SYSOUT=* 
//SYSTSIN  DD * 
 DSN SYSTEM(DGE) 
 RUN PROGRAM(BMCTEP2) 
END 
/* 
//SYSIN    DD * 
 UPDATE RDASTC.BMCTB001 SET COL2 = 'UPDATE1'; 
 UPDATE RDASTC.BMCTB001 SET COL2 = 'UPDATE2'; 
//*================================================================== 
//UPDATE02 EXEC PGM=IKJEFT01,DYNAMNBR=20 
//STEPLIB  DD DSN=SYS2.DB2.DSNLOAD,DISP=SHR 
//SYSTSPRT DD SYSOUT=* 
//SYSPRINT DD SYSOUT=* 
//SYSTSIN  DD * 
 DSN SYSTEM(DGE) 
 RUN PROGRAM(BMCTEP2) 
 END 
/* 
//SYSIN    DD * 
 UPDATE RDASTC.BMCTB002 SET COL2 = 'UPDATE1'; 
 UPDATE RDASTC.BMCTB002 SET COL2 = 'UPDATE2'; 
//* UPDATE BMCTB003 
//*================================================================== 
//UPDATE03 EXEC PGM=IKJEFT01,DYNAMNBR=20 
//STEPLIB  DD DSN=SYS2.DB2.DSNLOAD,DISP=SHR 
//SYSTSPRT DD SYSOUT=* 
//SYSPRINT DD SYSOUT=* 
//SYSTSIN  DD * 
 DSN SYSTEM(DGE) 
RUN PROGRAM(BMCTEP2) 
 END 
/* 
//SYSIN    DD * 
 UPDATE RDASTC.BMCTB003 SET COL2 = 'UPDATE1'; 
 UPDATE RDASTC.BMCTB003 SET COL2 = 'UPDATE2'; 
//* QUIESCE TABLESPACE BMCDBSMP.BMCTS014 
//************************************************** 
//QUIESC14 EXEC DSNUPROC,SYSTEM=DGE,UID='QUIESC14', 
// UTPROC='',REGION=4M, 
// LIB='SYS2.DB2.DSNLOAD' 
//DSNUPROC.SYSIN  DD * 
 QUIESCE TABLESPACE BMCDBSMP.BMCTS001 
         TABLESPACE BMCDBSMP.BMCTS002 
         TABLESPACE BMCDBSMP.BMCTS003 
/* 
//* 
//* -------------------------------------------------------------------
//* THIS STEP RECOVERS THE TABLE SPACES TO THE LAST COPY WHICH WAS 
//* CREATED AT THE BEGINNING OF THE JOB, IF, THE UPDATE STEP ABENDS. 
//* -------------------------------------------------------------------
//* 
//RECOVER EXEC PGM=AFRMAIN,REGION=0M,COND=ONLY, 
//             PARM='DGE,RECOVER4B,NEW/RESTART,MSGLEVEL(2)' 
//STEPLIB  DD DISP=SHR,DSN=product.libraries
//          DD DISP=SHR,DSN=DB2.DSNEXIT
//          DD DISP=SHR,DSN=DB2.DSNLOAD
//SYSIN     DD * 
 RECOVER TABLESPACE BMCDBSMP.BMCTS001 TOCOPY LASTCOPY 
 RECOVER TABLESPACE BMCDBSMP.BMCTS002 TOCOPY LASTCOPY 
 RECOVER TABLESPACE BMCDBSMP.BMCTS003 TOCOPY LASTCOPY 
 REBUILD INDEX(ALL) TABLESPACE BMCDBSMP.BMCTS001 NOWORKDDN 
 REBUILD INDEX(ALL) TABLESPACE BMCDBSMP.BMCTS002 NOWORKDDN 
 REBUILD INDEX(ALL) TABLESPACE BMCDBSMP.BMCTS003 NOWORKDDN 
/* 
//

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

Comments