Saturday, March 25, 2017

DB2 COPY PENDING

COPY PENDING 


A state in which, an Image Copy on a table needs to be taken. In this status, the table is available only for SELECT queries(read ONLY). You cannot update the table. 

It happens in the following situations. 

1. When you load the table with LOAD TABLE LOG NO and failed to include NOCOPYPEND
2. when image copies job fails while copying the data to Tape or DASD. 

To remove the COPY PENDING status

1. you take an image copy and the Tablespace status changes from copy pending to RW

If you dont want to take image copy, you can do the below

2. use the below REPAIR command to reset the tablespace status
REPAIR SET TABLESPACE XXXXX.XXXXX NOCOPYPEND 

3. You can execute following db2 command to bring the status of tablespace to RW. This command releases most restrictions for the named objects
-START DATABASE(dbname) SPACE(tablespace-name) ACESS(FORCE) .

Following jobs remove copy pending and recovery pending status from a table space and removes copy pending, recovery pending status and rebuild pending status from an index space

//STEPO1 EXEC PGM=DSNUTILB,REGIONM, 
// PARM='DB2X,MIGRDAN, '
//STEPLIB DD DSN=XXX.XXXXX.SDSNLOAD,DISP=SHR
//SYSIN DD *    
REPAIR SET TABLESPACE XXXXX.XXXXX NOCOPYPEND 
REPAIR SET TABLESPACE XXXXX.XXXXX NORCVRPEND
REPAIR SET INDEX XXXXX.XXXXX NOCOPYPEND
REPAIR SET INDEX XXXXX.XXXXX NORCVRPEND
REPAIR SET INDEX XXXXX.XXXXX NORBDPEND
/*
//SYSPRINT DD SYSOUT=* 
//UTPRINT DD SYSOUT=*

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.