DB2 skip tablespace restore


OS – AIX 5.3

DB – DB2 9.1,9.5,10.1 LUW

In earlier posts (post1, post2) full db2 restoration in to a different server was discussed. This post is kind of add-on showing the restoration process skipping set of table spaces. For this restoration generated script will be used instead of manually issuing redirect commands.

Step 1 → Generate the script skipping tablespaces
 db2 "restore database skipdb rebuild with all tablespaces in image except tablespace(VL_USR_8K,VL_IDX_USR_8K,VL_USR_MSTR_4K,USR_MSTR_IDX_4K,TS_INOUT_IDX,TS_INOUT_SEP12,TS_INOUT_OCT12,TS_INOUT_JAN13,TS_INOUT_FEB13,TS_INOUT_MAR13,TS_INOUT_APR13,TS_INOUT_MAY11,TS_INOUT_JUN11) from /DB2restore dbpath on '/DB2restore' into skipdb logtarget '/DB2restore/mtrptlog' redirect generate script skip_gen.clp"   
Step 2 → Change the redirect paths in generated script.

The script generated (skip_gen.clp) includes datafile paths of the original db. If restoring to different setup change the paths accordingly.

Step 3 → Perform the rollforward.
1:  bash-2.04$ db2 "rollforward database SKIPDBR to end of logs and complete overflow log path ('/DB2restore/mtrptlog')"  
2:  SQL1271W Database "SKIPDBR" is recovered but one or more table spaces are   
3:  off-line on node(s) "0"  
DB is now open but the skipped table spaces will be kept offline.

Comments

Popular posts from this blog

ORA-16433: The database or pluggable database must be opened in read/write

Oracle Multitenant - Create new service for PDB using DBMS_SERVICE

Wait for unread message on broadcast channel - Blocking Sessions