Cat/Dir REORG JCLs Part 1 - DB2PCAT

Michael Ebert

Cat/Dir REORG JCLs Part 1 - DB2PCAT
Dr. Michael Ebert
DB2 Database Administrator
aMaDEUS Data Processing
Erding / Munich, Germany
Tel. ++49 -8122-433962
Fax ++49-8122-433260


//OBO025D2 JOB (USERJOB,ME),'M. EBERT X3962',CLASS=Y,MSGCLASS=X,
// MSGLEVEL=(1,1),REGION=6M,NOTIFY=&SYSUID,TYPRUN=HOLD
/*JOBPARM SYSAFF=AMAB
//JOBLIB DD DISP=SHR,DSN=SYS1.DB2.PRD1.SDSNLOAD
//*
//**********************************************************************
//* Job to REORG the DB2 Catalog & Directory *
//* *
//* All TSs except SPT01 are on MSY003 (P)/MS4440 (T)/DB2M01 (M) *
//* All IXs except DSNSPT01/02 are on MSY005 / MS4441 / DB2M02 *
//* For SPT01 and its indexes DSNSPT01/02, the order is reversed. *
//* DSNKSX01 (on SYSPKAGE) is also on MSY003 / MS4440 / DB2M01 *
//* in order to have both Volumes with approx. equal amounts of data. *
//* *
//* RESTART Instructions: *
//* *
//* Change the relative Generation number for the final imagecopy *
//* steps from (+2) to (+1) (RGNs are updated at the end of the Job, *
//* NOT the Jobstep, so we have to use +2 if we do it in one Job). *
//* *
//**********************************************************************
//*
//*------- Allocate Unload File ----------------------------------------
//ALLOC EXEC PGM=IEFBR14,COND=(4,LT)
//SYSREC DD UNIT=SYSDA,DSN=DB2P.UNLD.SYSREC,
// DISP=(MOD,CATLG,DELETE),SPACE=(CYL,(1500,200))
//*------- TERM all existing Utilities, start CAT & DIR in UT Mode -----
//STARTUT EXEC PGM=IKJEFT1B,COND=(4,LT),DYNAMNBR=20
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB2P)
-DIS UTIL(*)
-DIS DB(DSNDB01) SPACE(*) USE LIMIT(500)
-DIS DB(DSNDB06) SPACE(*) USE LIMIT(500)
** -TER UTIL(*)
-STA DB(DSNDB06) SPACE(*) ACCESS(UT)
-STA DB(DSNDB01) SPACE(*) ACCESS(UT)
//*
//*=====================
//*
//* P h a s e I : IMAGECOPY/QUIESCE all Catalog/Directory TS
//*
//* For Details see DB2 Developers Guide, p. 855 ff.
//*=====================
//*
//*------- Imagecopy SYSUTILX (must be on its own) ---------------------
//IMGCOPX EXEC PGM=DSNUTILB,COND=(4,LT),PARM='DB2P,DB2P.REORG,'
//SYSUTILX DD UNIT=SYSDA,DSN=DB2P.ICOPY.DSNDB01.SYSUTILX.A000(+1),
// DISP=(MOD,CATLG,CATLG),SPACE=(CYL,(3,1),RLSE)
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
COPY TABLESPACE DSNDB01.SYSUTILX COPYDDN SYSUTILX
//*------- Imagecopy all CAT/DIR TS except SYSUTILX --------------------
//IMGCOPY EXEC PGM=DSNUTILB,COND=(4,LT),PARM='DB2P,DB2P.REORG,'
//DBD01 DD UNIT=SYSDA,DSN=DB2P.ICOPY.DSNDB01.DBD01.A000(+1),
// DISP=(MOD,CATLG,CATLG),SPACE=(CYL,(10,2),RLSE)
//SCT02 DD UNIT=SYSDA,DSN=DB2P.ICOPY.DSNDB01.SCT02.A000(+1),
// DISP=(MOD,CATLG,CATLG),SPACE=(CYL,(50,10),RLSE)
//SPT01 DD UNIT=SYSDA,DSN=DB2P.ICOPY.DSNDB01.SPT01.A000(+1),
// DISP=(MOD,CATLG,CATLG),SPACE=(CYL,(1400,300),RLSE)
//SYSLGRNX DD UNIT=SYSDA,DSN=DB2P.ICOPY.DSNDB01.SYSLGRNX.A000(+1),
// DISP=(MOD,CATLG,CATLG),SPACE=(CYL,(50,10),RLSE)
//SYSCOPY DD UNIT=SYSDA,DSN=DB2P.ICOPY.DSNDB06.SYSCOPY.A000(+1),
// DISP=(MOD,CATLG,CATLG),SPACE=(CYL,(50,10),RLSE)
//SYSDBASE DD UNIT=SYSDA,DSN=DB2P.ICOPY.DSNDB06.SYSDBASE.A000(+1),
// DISP=(MOD,CATLG,CATLG),SPACE=(CYL,(150,30),RLSE)
//SYSDBAUT DD UNIT=SYSDA,DSN=DB2P.ICOPY.DSNDB06.SYSDBAUT.A000(+1),
// DISP=(MOD,CATLG,CATLG),SPACE=(CYL,(1,1),RLSE)
//SYSDDF DD UNIT=SYSDA,DSN=DB2P.ICOPY.DSNDB06.SYSDDF.A000(+1),
// DISP=(MOD,CATLG,CATLG),SPACE=(CYL,(1,1),RLSE)
//SYSGPAUT DD UNIT=SYSDA,DSN=DB2P.ICOPY.DSNDB06.SYSGPAUT.A000(+1),
// DISP=(MOD,CATLG,CATLG),SPACE=(CYL,(1,1),RLSE)
//SYSGROUP DD UNIT=SYSDA,DSN=DB2P.ICOPY.DSNDB06.SYSGROUP.A000(+1),
// DISP=(MOD,CATLG,CATLG),SPACE=(CYL,(1,1),RLSE)
//SYSPKAGE DD UNIT=SYSDA,DSN=DB2P.ICOPY.DSNDB06.SYSPKAGE.A000(+1),
// DISP=(MOD,CATLG,CATLG),SPACE=(CYL,(750,150),RLSE)
//SYSPLAN DD UNIT=SYSDA,DSN=DB2P.ICOPY.DSNDB06.SYSPLAN.A000(+1),
// DISP=(MOD,CATLG,CATLG),SPACE=(CYL,(15,3),RLSE)
//SYSSTATS DD UNIT=SYSDA,DSN=DB2P.ICOPY.DSNDB06.SYSSTATS.A000(+1),
// DISP=(MOD,CATLG,CATLG),SPACE=(CYL,(15,3),RLSE)
//SYSSTR DD UNIT=SYSDA,DSN=DB2P.ICOPY.DSNDB06.SYSSTR.A000(+1),
// DISP=(MOD,CATLG,CATLG),SPACE=(CYL,(1,1),RLSE)
//SYSUSER DD UNIT=SYSDA,DSN=DB2P.ICOPY.DSNDB06.SYSUSER.A000(+1),
// DISP=(MOD,CATLG,CATLG),SPACE=(CYL,(2,1),RLSE)
//SYSVIEWS DD UNIT=SYSDA,DSN=DB2P.ICOPY.DSNDB06.SYSVIEWS.A000(+1),
// DISP=(MOD,CATLG,CATLG),SPACE=(CYL,(50,10),RLSE)
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
COPY TABLESPACE DSNDB01.DBD01 COPYDDN DBD01
COPY TABLESPACE DSNDB01.SCT02 COPYDDN SCT02
COPY TABLESPACE DSNDB01.SPT01 COPYDDN SPT01
COPY TABLESPACE DSNDB06.SYSDBASE COPYDDN SYSDBASE
COPY TABLESPACE DSNDB06.SYSDBAUT COPYDDN SYSDBAUT
COPY TABLESPACE DSNDB06.SYSDDF COPYDDN SYSDDF
COPY TABLESPACE DSNDB06.SYSGPAUT COPYDDN SYSGPAUT
COPY TABLESPACE DSNDB06.SYSGROUP COPYDDN SYSGROUP
COPY TABLESPACE DSNDB06.SYSPKAGE COPYDDN SYSPKAGE
COPY TABLESPACE DSNDB06.SYSPLAN COPYDDN SYSPLAN
COPY TABLESPACE DSNDB06.SYSSTATS COPYDDN SYSSTATS
COPY TABLESPACE DSNDB06.SYSSTR COPYDDN SYSSTR
COPY TABLESPACE DSNDB06.SYSUSER COPYDDN SYSUSER
COPY TABLESPACE DSNDB06.SYSVIEWS COPYDDN SYSVIEWS
COPY TABLESPACE DSNDB01.SYSLGRNX COPYDDN SYSLGRNX
COPY TABLESPACE DSNDB06.SYSCOPY COPYDDN SYSCOPY
//*--------QUIESCE SYSUTILX (must be on its own) -----------------------
//QUIESCX EXEC PGM=DSNUTILB,COND=(4,LT),PARM='DB2P,DB2P.REORG,'
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
QUIESCE TABLESPACE DSNDB01.SYSUTILX WRITE YES
//*------- QUIESCE CAT/DIR Tablespaces except SYSUTILX -----------------
//QUIESCE EXEC PGM=DSNUTILB,COND=(4,LT),PARM='DB2P,DB2P.REORG,'
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
QUIESCE TABLESPACE DSNDB01.DBD01
TABLESPACE DSNDB01.SCT02
TABLESPACE DSNDB01.SPT01
TABLESPACE DSNDB06.SYSCOPY
TABLESPACE DSNDB06.SYSDBASE
TABLESPACE DSNDB06.SYSDBAUT
TABLESPACE DSNDB06.SYSDDF
TABLESPACE DSNDB06.SYSGPAUT
TABLESPACE DSNDB06.SYSGROUP
TABLESPACE DSNDB06.SYSPKAGE
TABLESPACE DSNDB06.SYSPLAN
TABLESPACE DSNDB06.SYSSTATS
TABLESPACE DSNDB06.SYSSTR
TABLESPACE DSNDB06.SYSUSER
TABLESPACE DSNDB06.SYSVIEWS
TABLESPACE DSNDB01.SYSLGRNX WRITE YES
//*
//*=====================
//* SYSUTILX
//*=====================
//*
//*------- STOP Tablespace/Indexes -------------------------------------
//STOPUTIL EXEC PGM=IKJEFT1B,DYNAMNBR=20,COND=(4,LT)
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB2P)
-STO DB(DSNDB01) SPACE(SYSUTILX,DSNLUX01,DSNLUX02)
//*------- DELETE/DEFINE -----------------------------------------------
//VSAMUTIL EXEC PGM=IDCAMS,COND=(4,LT)
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE (DB2P.DSNDBC.DSNDB01.SYSUTILX.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB01.DSNLUX01.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB01.DSNLUX02.I0001.A001)
SET MAXCC=0

DEFINE CL(NAME(DB2P.DSNDBC.DSNDB01.SYSUTILX.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY003) CYL(3 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB01.SYSUTILX.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB01.DSNLUX01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(1 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB01.DSNLUX01.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB01.DSNLUX02.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(1 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB01.DSNLUX02.I0001.A001))
//*------- START Tablespace & Indexes ----------------------------------
//STRTUTIL EXEC PGM=IKJEFT1B,DYNAMNBR=20,COND=(4,LT)
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB2P)
-STA DB(DSNDB01) SPACE(SYSUTILX,DSNLUX01,DSNLUX02) ACCESS(UT)
//*------- RECOVER Tablespace (SYSUTILX cannot be REORG'd) -------------
//RCVRUTIL EXEC PGM=DSNUTILB,COND=(4,LT),PARM='DB2P,DB2P.REORG,'
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
RECOVER TABLESPACE DSNDB01.SYSUTILX
//*------- RECOVER Indexes on SYSUTILX ---------------------------------
//RCVXUTIL EXEC PGM=DSNUTILB,COND=(4,LT),PARM='DB2P,DB2P.REORG,'
//SYSPRINT DD SYSOUT=*
//UTPRINT DD SYSOUT=*
//SYSIN DD *
RECOVER INDEX(ALL) TABLESPACE DSNDB01.SYSUTILX SORTDEVT 3390 SORTNUM 3
//*
//*=====================
//* SYSLGRNX
//*=====================
//*
//*------- STOP Tablespace/Indexes -------------------------------------
//STOPLGRN EXEC PGM=IKJEFT1B,DYNAMNBR=20,COND=(4,LT)
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB2P)
-STO DB(DSNDB01) SPACE(SYSLGRNX,DSNLLX01,DSNLLX02)
//*------- DELETE/DEFINE -----------------------------------------------
//VSAMLGRN EXEC PGM=IDCAMS,COND=(4,LT)
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE (DB2P.DSNDBC.DSNDB01.SYSLGRNX.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB01.DSNLLX01.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB01.DSNLLX02.I0001.A001)
SET MAXCC=0

DEFINE CL(NAME(DB2P.DSNDBC.DSNDB01.SYSLGRNX.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY003) CYL(50 10)) -
DATA(NAME(DB2P.DSNDBD.DSNDB01.SYSLGRNX.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB01.DSNLLX01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(50 10)) -
DATA(NAME(DB2P.DSNDBD.DSNDB01.DSNLLX01.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB01.DSNLLX02.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(50 10)) -
DATA(NAME(DB2P.DSNDBD.DSNDB01.DSNLLX02.I0001.A001))
//*------- START Tablespace & Indexes ----------------------------------
//STRTLGRN EXEC PGM=IKJEFT1B,DYNAMNBR=20,COND=(4,LT)
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB2P)
-STA DB(DSNDB01) SPACE(SYSLGRNX,DSNLLX01,DSNLLX02) ACCESS(UT)
//*------- RECOVER Tablespace (SYSLGRNX cannot be REORG'd) -------------
//RCVRLGRN EXEC PGM=DSNUTILB,COND=(4,LT),PARM='DB2P,DB2P.REORG,'
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
RECOVER TABLESPACE DSNDB01.SYSLGRNX
//*------- RECOVER Indexes ---------------------------------------------
//RCVXLGRN EXEC PGM=DSNUTILB,COND=(4,LT),PARM='DB2P,DB2P.REORG,'
//SYSPRINT DD SYSOUT=*
//UTPRINT DD SYSOUT=*
//SYSIN DD *
RECOVER INDEX(ALL) TABLESPACE DSNDB01.SYSLGRNX SORTDEVT 3390 SORTNUM 3
//*
//*=====================
//* DBD01
//*=====================
//*
//*------- UNLOAD of Tablespace ----------------------------------------
//UNLDDBD1 EXEC PGM=DSNUTILB,COND=(4,LT),PARM='DB2P,DB2P.REORG,'
//SYSREC DD DSN=DB2P.UNLD.SYSREC,DISP=OLD
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
REORG TABLESPACE DSNDB01.DBD01 LOG NO UNLOAD PAUSE
//*------- STOP Tablespace/Indexes -------------------------------------
//STOPDBD1 EXEC PGM=IKJEFT1B,DYNAMNBR=20,COND=(4,LT)
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB2P)
-STO DB(DSNDB01) SPACE(DBD01)
//*------- DELETE/DEFINE -----------------------------------------------
//VSAMDBD1 EXEC PGM=IDCAMS,COND=(4,LT)
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE (DB2P.DSNDBC.DSNDB01.DBD01.I0001.A001)
SET MAXCC=0

DEFINE CL(NAME(DB2P.DSNDBC.DSNDB01.DBD01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY003) CYL(10 2)) -
DATA(NAME(DB2P.DSNDBD.DSNDB01.DBD01.I0001.A001))
//*------- START Tablespace & Indexes ----------------------------------
//STRTDBD1 EXEC PGM=IKJEFT1B,DYNAMNBR=20,COND=(4,LT)
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB2P)
-STA DB(DSNDB01) SPACE(DBD01) ACCESS(UT)
//*------- RELOAD Tablespace -------------------------------------------
//RLODDBD1 EXEC PGM=DSNUTILB,COND=(4,LT),PARM='DB2P,DB2P.REORG,RESTART'
//SYSREC DD DSN=DB2P.UNLD.SYSREC,DISP=OLD
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(100,300))
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
REORG TABLESPACE DSNDB01.DBD01 LOG NO UNLOAD PAUSE
//*
//*=====================
//* SCT02
//*=====================
//*
//*------- UNLOAD of Tablespace ----------------------------------------
//UNLDSCT2 EXEC PGM=DSNUTILB,COND=(4,LT),PARM='DB2P,DB2P.REORG,'
//SYSREC DD DSN=DB2P.UNLD.SYSREC,DISP=OLD
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
REORG TABLESPACE DSNDB01.SCT02 LOG NO UNLOAD PAUSE
//*------- STOP Tablespace/Indexes -------------------------------------
//STOPSCT2 EXEC PGM=IKJEFT1B,DYNAMNBR=20,COND=(4,LT)
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB2P)
-STO DB(DSNDB01) SPACE(SCT02,DSNSCT02)
//*------- DELETE/DEFINE -----------------------------------------------
//VSAMSCT2 EXEC PGM=IDCAMS,COND=(4,LT)
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE (DB2P.DSNDBC.DSNDB01.SCT02.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB01.DSNSCT02.I0001.A001)
SET MAXCC=0

DEFINE CL(NAME(DB2P.DSNDBC.DSNDB01.SCT02.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY003) CYL(50 10)) -
DATA(NAME(DB2P.DSNDBD.DSNDB01.SCT02.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB01.DSNSCT02.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(1 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB01.DSNSCT02.I0001.A001))
//*------- START Tablespace & Indexes ----------------------------------
//STRTSCT2 EXEC PGM=IKJEFT1B,DYNAMNBR=20,COND=(4,LT)
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB2P)
-STA DB(DSNDB01) SPACE(SCT02,DSNSCT02) ACCESS(UT)
//*------- RELOAD Tablespace -------------------------------------------
//RLODSCT2 EXEC PGM=DSNUTILB,COND=(4,LT),PARM='DB2P,DB2P.REORG,RESTART'
//SYSREC DD DSN=DB2P.UNLD.SYSREC,DISP=OLD
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(100,300))
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
REORG TABLESPACE DSNDB01.SCT02 LOG NO UNLOAD PAUSE
//*
//*=====================
//* SPT01
//*=====================
//*
//*------- UNLOAD of Tablespace ----------------------------------------
//UNLDSPT1 EXEC PGM=DSNUTILB,COND=(4,LT),PARM='DB2P,DB2P.REORG2,'
//SYSREC DD DSN=DB2P.UNLD.SYSREC2,DISP=OLD
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
REORG TABLESPACE DSNDB01.SPT01 LOG NO UNLOAD PAUSE
//*------- STOP Tablespace/Indexes -------------------------------------
//STOPSPT1 EXEC PGM=IKJEFT1B,DYNAMNBR=20,COND=(4,LT)
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB2P)
-STO DB(DSNDB01) SPACE(SPT01,DSNSPT01,DSNSPT02)
//*------- DELETE/DEFINE -----------------------------------------------
//VSAMSPT1 EXEC PGM=IDCAMS,COND=(4,LT)
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE (DB2P.DSNDBC.DSNDB01.SPT01.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB01.DSNSPT01.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB01.DSNSPT02.I0001.A001)
SET MAXCC=0

DEFINE CL(NAME(DB2P.DSNDBC.DSNDB01.SPT01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(1500 300)) -
DATA(NAME(DB2P.DSNDBD.DSNDB01.SPT01.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB01.DSNSPT01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY003) CYL(75 15)) -
DATA(NAME(DB2P.DSNDBD.DSNDB01.DSNSPT01.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB01.DSNSPT02.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY003) CYL(125 25)) -
DATA(NAME(DB2P.DSNDBD.DSNDB01.DSNSPT02.I0001.A001))
//*------- START Tablespace & Indexes ----------------------------------
//STRTSPT1 EXEC PGM=IKJEFT1B,DYNAMNBR=20,COND=(4,LT)
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB2P)
-STA DB(DSNDB01) SPACE(SPT01,DSNSPT01,DSNSPT02) ACCESS(UT)
//*------- RELOAD Tablespace -------------------------------------------
//RLODSPT1 EXEC PGM=DSNUTILB,COND=(4,LT),PARM='DB2P,DB2P.REORG2,RESTART'
//SYSREC DD DSN=DB2P.UNLD.SYSREC,DISP=OLD
//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(1000,300))
//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(1000,300))
//SORTWK03 DD UNIT=SYSDA,SPACE=(CYL,(1000,300))
//SORTOUT DD UNIT=SYSDA,SPACE=(CYL,(1000,500))
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1000,500))
//SYSPRINT DD SYSOUT=*
//UTPRINT DD SYSOUT=*
//SYSIN DD *
REORG TABLESPACE DSNDB01.SPT01 LOG NO UNLOAD PAUSE
//*
//*=====================
//* SYSDBASE
//*=====================
//*
//*------- UNLOAD of Tablespace ----------------------------------------
//UNLDDBAS EXEC PGM=DSNUTILB,COND=(4,LT),PARM='DB2P,DB2P.REORG,'
//SYSREC DD DSN=DB2P.UNLD.SYSREC,DISP=OLD
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
REORG TABLESPACE DSNDB06.SYSDBASE LOG NO UNLOAD PAUSE
//*------- STOP Tablespace/Indexes -------------------------------------
//STOPDBAS EXEC PGM=IKJEFT1B,DYNAMNBR=20,COND=(4,LT)
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB2P)
-STO DB(DSNDB06) SPACE(SYSDBASE,DSNATX01,DSNATX02,DSNATX03, -
DSNDCX01,DSNDKX01,DSNDLX01,DSNDPX01,DSNDRX01,DSNDSX01, -
DSNDTX01,DSNDTX02,DSNDXX01,DSNDXX02,DSNDXX03,DSNDYX01)
//*------- DELETE/DEFINE -----------------------------------------------
//VSAMDBAS EXEC PGM=IDCAMS,COND=(4,LT)
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE (DB2P.DSNDBC.DSNDB06.SYSDBASE.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNATX01.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNATX02.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNATX03.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNDCX01.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNDKX01.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNDLX01.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNDPX01.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNDRX01.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNDSX01.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNDTX01.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNDTX02.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNDXX01.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNDXX02.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNDXX03.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNDYX01.I0001.A001)
SET MAXCC=0

DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.SYSDBASE.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY003) CYL(200 40)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.SYSDBASE.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNATX01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(3 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNATX01.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNATX02.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(5 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNATX02.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNATX03.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(3 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNATX03.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNDCX01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(20 4)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNDCX01.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNDKX01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(3 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNDKX01.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNDLX01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(1 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNDLX01.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNDPX01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(1 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNDPX01.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNDRX01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(3 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNDRX01.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNDSX01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(3 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNDSX01.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNDTX01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(3 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNDTX01.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNDTX02.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(3 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNDTX02.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNDXX01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(1 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNDXX01.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNDXX02.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(1 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNDXX02.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNDXX03.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(1 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNDXX03.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNDYX01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(3 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNDYX01.I0001.A001))
//*------- START Tablespace & Indexes ----------------------------------
//STRTDBAS EXEC PGM=IKJEFT1B,DYNAMNBR=20,COND=(4,LT)
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB2P)
-STA DB(DSNDB06) SPACE(SYSDBASE,DSNATX01,DSNATX02,DSNATX03, -
DSNDCX01,DSNDKX01,DSNDLX01,DSNDPX01,DSNDRX01,DSNDSX01, -
DSNDTX01,DSNDTX02,DSNDXX01,DSNDXX02,DSNDXX03,DSNDYX01) -
ACCESS(UT)
//*------- RELOAD Tablespace -------------------------------------------
//RLODDBAS EXEC PGM=DSNUTILB,COND=(4,LT),PARM='DB2P,DB2P.REORG,RESTART'
//SYSREC DD DSN=DB2P.UNLD.SYSREC,DISP=OLD
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(100,300))
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
REORG TABLESPACE DSNDB06.SYSDBASE LOG NO UNLOAD PAUSE
//*
//*=====================
//* SYSDBAUT
//*=====================
//*
//*------- UNLOAD of Tablespace ----------------------------------------
//UNLDDBAU EXEC PGM=DSNUTILB,COND=(4,LT),PARM='DB2P,DB2P.REORG,'
//SYSREC DD DSN=DB2P.UNLD.SYSREC,DISP=OLD
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
REORG TABLESPACE DSNDB06.SYSDBAUT LOG NO UNLOAD PAUSE
//*------- STOP Tablespace/Indexes -------------------------------------
//STOPDBAU EXEC PGM=IKJEFT1B,DYNAMNBR=20,COND=(4,LT)
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB2P)
-STO DB(DSNDB06) SPACE(SYSDBAUT,DSNADH01,DSNADX01,DSNDDH01,DSNDDX02)
//*------- DELETE/DEFINE -----------------------------------------------
//VSAMDBAU EXEC PGM=IDCAMS,COND=(4,LT)
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE (DB2P.DSNDBC.DSNDB06.SYSDBAUT.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNADH01.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNADX01.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNDDH01.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNDDX02.I0001.A001)
SET MAXCC=0

DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.SYSDBAUT.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY003) CYL(1 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.SYSDBAUT.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNADH01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(1 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNADH01.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNADX01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(1 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNADX01.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNDDH01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(1 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNDDH01.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNDDX02.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(1 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNDDX02.I0001.A001))
//*------- START Tablespace & Indexes ----------------------------------
//STRTDBAU EXEC PGM=IKJEFT1B,DYNAMNBR=20,COND=(4,LT)
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB2P)
-STA DB(DSNDB06) -
SPACE(SYSDBAUT,DSNADH01,DSNADX01,DSNDDH01,DSNDDX02) -
ACCESS(UT)
//*------- RELOAD Tablespace -------------------------------------------
//RLODDBAU EXEC PGM=DSNUTILB,COND=(4,LT),PARM='DB2P,DB2P.REORG,RESTART'
//SYSREC DD DSN=DB2P.UNLD.SYSREC,DISP=OLD
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,3))
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
REORG TABLESPACE DSNDB06.SYSDBAUT LOG NO UNLOAD PAUSE
//*
//*=====================
//* SYSDDF
//*=====================
//*
//*------- UNLOAD of Tablespace ----------------------------------------
//UNLDDDF EXEC PGM=DSNUTILB,COND=(4,LT),PARM='DB2P,DB2P.REORG,'
//SYSREC DD DSN=DB2P.UNLD.SYSREC,DISP=OLD
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
REORG TABLESPACE DSNDB06.SYSDDF LOG NO UNLOAD PAUSE
//*------- STOP Tablespace/Indexes -------------------------------------
//STOPDDF EXEC PGM=IKJEFT1B,DYNAMNBR=20,COND=(4,LT)
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB2P)
-STO DB(DSNDB06) SPACE(SYSDDF,DSNFCX01,DSNFDX01,DSNFEX01,DSNFLX01, -
DSNFLX02,DSNFMX01,DSNFNX01,DSNFPX01)
//*------- DELETE/DEFINE -----------------------------------------------
//VSAMDDF EXEC PGM=IDCAMS,COND=(4,LT)
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE (DB2P.DSNDBC.DSNDB06.SYSDDF.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNFCX01.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNFDX01.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNFEX01.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNFLX01.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNFLX02.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNFMX01.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNFNX01.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNFPX01.I0001.A001)
SET MAXCC=0

DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.SYSDDF.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY003) CYL(1 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.SYSDDF.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNFCX01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(1 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNFCX01.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNFDX01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(1 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNFDX01.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNFEX01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(1 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNFEX01.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNFLX01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(1 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNFLX01.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNFLX02.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(1 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNFLX02.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNFMX01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(1 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNFMX01.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNFNX01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(1 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNFNX01.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNFPX01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(1 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNFPX01.I0001.A001))
//*------- START Tablespace & Indexes ----------------------------------
//STRTDDF EXEC PGM=IKJEFT1B,DYNAMNBR=20,COND=(4,LT)
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB2P)
-STA DB(DSNDB06) SPACE(SYSDDF,DSNFCX01,DSNFDX01,DSNFEX01,DSNFLX01, -
DSNFLX02,DSNFMX01,DSNFNX01,DSNFPX01) ACCESS(UT)
//*------- RELOAD Tablespace -------------------------------------------
//RLODDDF EXEC PGM=DSNUTILB,COND=(4,LT),PARM='DB2P,DB2P.REORG,RESTART'
//SYSREC DD DSN=DB2P.UNLD.SYSREC,DISP=OLD
//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SORTOUT DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSPRINT DD SYSOUT=*
//UTPRINT DD SYSOUT=*
//SYSIN DD *
REORG TABLESPACE DSNDB06.SYSDDF LOG NO UNLOAD PAUSE
//*
//*=====================
//* SYSGPAUT
//*=====================
//*
//*------- UNLOAD of Tablespace ----------------------------------------
//UNLDGPAU EXEC PGM=DSNUTILB,COND=(4,LT),PARM='DB2P,DB2P.REORG,'
//SYSREC DD DSN=DB2P.UNLD.SYSREC,DISP=OLD
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
REORG TABLESPACE DSNDB06.SYSGPAUT LOG NO UNLOAD PAUSE
//*------- STOP Tablespace/Indexes -------------------------------------
//STOPGPAU EXEC PGM=IKJEFT1B,DYNAMNBR=20,COND=(4,LT)
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB2P)
-STO DB(DSNDB06) SPACE(SYSGPAUT,DSNAGH01,DSNAGX01)
//*------- DELETE/DEFINE -----------------------------------------------
//VSAMGPAU EXEC PGM=IDCAMS,COND=(4,LT)
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE (DB2P.DSNDBC.DSNDB06.SYSGPAUT.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNAGH01.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNAGX01.I0001.A001)
SET MAXCC=0

DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.SYSGPAUT.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY003) CYL(3 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.SYSGPAUT.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNAGH01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(1 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNAGH01.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNAGX01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(1 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNAGX01.I0001.A001))
//*------- START Tablespace & Indexes ----------------------------------
//STRTGPAU EXEC PGM=IKJEFT1B,DYNAMNBR=20,COND=(4,LT)
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB2P)
-STA DB(DSNDB06) SPACE(SYSGPAUT,DSNAGH01,DSNAGX01) ACCESS(UT)
//*------- RELOAD Tablespace -------------------------------------------
//RLODGPAU EXEC PGM=DSNUTILB,COND=(4,LT),PARM='DB2P,DB2P.REORG,RESTART'
//SYSREC DD DSN=DB2P.UNLD.SYSREC,DISP=OLD
//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SORTOUT DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSPRINT DD SYSOUT=*
//UTPRINT DD SYSOUT=*
//SYSIN DD *
REORG TABLESPACE DSNDB06.SYSGPAUT LOG NO UNLOAD PAUSE
//*
//*=====================
//* SYSGROUP
//*=====================
//*
//*------- UNLOAD of Tablespace ----------------------------------------
//UNLDGROU EXEC PGM=DSNUTILB,COND=(4,LT),PARM='DB2P,DB2P.REORG,'
//SYSREC DD DSN=DB2P.UNLD.SYSREC,DISP=OLD
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
REORG TABLESPACE DSNDB06.SYSGROUP LOG NO UNLOAD PAUSE

//*------- STOP Tablespace/Indexes -------------------------------------
//STOPGROU EXEC PGM=IKJEFT1B,DYNAMNBR=20,COND=(4,LT)
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB2P)
-STO DB(DSNDB06) SPACE(SYSGROUP,DSNSSH01)
//*------- DELETE/DEFINE -----------------------------------------------
//VSAMGROU EXEC PGM=IDCAMS,COND=(4,LT)
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE (DB2P.DSNDBC.DSNDB06.SYSGROUP.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNSSH01.I0001.A001)
SET MAXCC=0

DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.SYSGROUP.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY003) CYL(1 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.SYSGROUP.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNSSH01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(1 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNSSH01.I0001.A001))
//*------- START Tablespace & Indexes ----------------------------------
//STRTGROU EXEC PGM=IKJEFT1B,DYNAMNBR=20,COND=(4,LT)
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB2P)
-STA DB(DSNDB06) SPACE(SYSGROUP,DSNSSH01) ACCESS(UT)
//*------- RELOAD Tablespace -------------------------------------------
//RLODGROU EXEC PGM=DSNUTILB,COND=(4,LT),PARM='DB2P,DB2P.REORG,RESTART'
//SYSREC DD DSN=DB2P.UNLD.SYSREC,DISP=OLD
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,3))
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
REORG TABLESPACE DSNDB06.SYSGROUP LOG NO UNLOAD PAUSE
//*
//*=====================
//* SYSPKAGE
//*=====================
//*
//*------- UNLOAD of Tablespace ----------------------------------------
//UNLDPKAG EXEC PGM=DSNUTILB,COND=(4,LT),PARM='DB2P,DB2P.REORG,'
//SYSREC DD DSN=DB2P.UNLD.SYSREC,DISP=OLD
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
REORG TABLESPACE DSNDB06.SYSPKAGE LOG NO UNLOAD PAUSE
//*------- STOP Tablespace/Indexes -------------------------------------
//STOPPKAG EXEC PGM=IKJEFT1B,DYNAMNBR=20,COND=(4,LT)
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB2P)
-STO DB(DSNDB06) SPACE(SYSPKAGE,DSNKAX01,DSNKAX02,DSNKAX03, -
DSNKCX01,DSNKDX01,DSNKDX02,DSNKKX01,DSNKKX02,DSNKLX01, -
DSNKLX02,DSNKPX01,DSNKSX01,DSNKYX01)
//*------- DELETE/DEFINE -----------------------------------------------
//VSAMPKAG EXEC PGM=IDCAMS,COND=(4,LT)
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE (DB2P.DSNDBC.DSNDB06.SYSPKAGE.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNKAX01.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNKAX02.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNKAX03.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNKCX01.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNKDX01.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNKDX02.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNKKX01.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNKKX02.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNKLX01.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNKLX02.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNKPX01.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNKSX01.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNKYX01.I0001.A001)
SET MAXCC=0

DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.SYSPKAGE.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY003) CYL(800 200)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.SYSPKAGE.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNKAX01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(2 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNKAX01.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNKAX02.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(2 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNKAX02.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNKAX03.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(1 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNKAX03.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNKCX01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(1 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNKCX01.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNKDX01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(3 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNKDX01.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNKDX02.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(3 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNKDX02.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNKKX01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(3 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNKKX01.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNKKX02.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(2 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNKKX02.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNKLX01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(1 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNKLX01.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNKLX02.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(1 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNKLX02.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNKPX01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(1 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNKPX01.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNKSX01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY003) CYL(250 50)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNKSX01.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNKYX01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(10 2)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNKYX01.I0001.A001))
//*------- START Tablespace & Indexes ----------------------------------
//STRTPKAG EXEC PGM=IKJEFT1B,DYNAMNBR=20,COND=(4,LT)
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB2P)
-STA DB(DSNDB06) SPACE(SYSPKAGE,DSNKAX01,DSNKAX02,DSNKAX03, -
DSNKCX01,DSNKDX01,DSNKDX02,DSNKKX01,DSNKKX02,DSNKLX01, -
DSNKLX02,DSNKPX01,DSNKSX01,DSNKYX01) ACCESS(UT)
//*------- RELOAD Tablespace -------------------------------------------
//RLODPKAG EXEC PGM=DSNUTILB,COND=(4,LT),PARM='DB2P,DB2P.REORG,RESTART'
//SYSREC DD DSN=DB2P.UNLD.SYSREC,DISP=OLD
//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(500,300))
//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(500,300))
//SORTWK03 DD UNIT=SYSDA,SPACE=(CYL,(500,300))
//SORTOUT DD UNIT=SYSDA,SPACE=(CYL,(500,300))
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(500,300))
//SYSPRINT DD SYSOUT=*
//UTPRINT DD SYSOUT=*
//SYSIN DD *
REORG TABLESPACE DSNDB06.SYSPKAGE LOG NO UNLOAD PAUSE
//*
//*=====================
//* SYSPLAN
//*=====================
//*
//*------- UNLOAD of Tablespace ----------------------------------------
//UNLDPLAN EXEC PGM=DSNUTILB,COND=(4,LT),PARM='DB2P,DB2P.REORG,'
//SYSREC DD DSN=DB2P.UNLD.SYSREC,DISP=OLD
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
REORG TABLESPACE DSNDB06.SYSPLAN LOG NO UNLOAD PAUSE
//*------- STOP Tablespace/Indexes -------------------------------------
//STOPPLAN EXEC PGM=IKJEFT1B,DYNAMNBR=20,COND=(4,LT)
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB2P)
-STO DB(DSNDB06) SPACE(SYSPLAN,DSNAPH01,DSNAPX01,DSNGGX01,DSNPPH01)
//*------- DELETE/DEFINE -----------------------------------------------
//VSAMPLAN EXEC PGM=IDCAMS,COND=(4,LT)
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE (DB2P.DSNDBC.DSNDB06.SYSPLAN.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNAPH01.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNAPX01.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNGGX01.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNPPH01.I0001.A001)
SET MAXCC=0

DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.SYSPLAN.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY003) CYL(20 4)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.SYSPLAN.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNAPH01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(1 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNAPH01.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNAPX01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(1 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNAPX01.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNGGX01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(3 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNGGX01.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNPPH01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(1 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNPPH01.I0001.A001))
//*------- START Tablespace & Indexes ----------------------------------
//STRTPLAN EXEC PGM=IKJEFT1B,DYNAMNBR=20,COND=(4,LT)
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB2P)
-STA DB(DSNDB06) -
SPACE(SYSPLAN,DSNAPH01,DSNAPX01,DSNGGX01,DSNPPH01) -
ACCESS(UT)
//*------- RELOAD Tablespace -------------------------------------------
//RLODPLAN EXEC PGM=DSNUTILB,COND=(4,LT),PARM='DB2P,DB2P.REORG,RESTART'
//SYSREC DD DSN=DB2P.UNLD.SYSREC,DISP=OLD
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(10,30))
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
REORG TABLESPACE DSNDB06.SYSPLAN LOG NO UNLOAD PAUSE
//*
//*=====================
//* SYSSTATS
//*=====================
//*
//*------- UNLOAD of Tablespace ----------------------------------------
//UNLDSTAT EXEC PGM=DSNUTILB,COND=(4,LT),PARM='DB2P,DB2P.REORG,'
//SYSREC DD DSN=DB2P.UNLD.SYSREC,DISP=OLD
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
REORG TABLESPACE DSNDB06.SYSSTATS LOG NO UNLOAD PAUSE
//*------- STOP Tablespace/Indexes -------------------------------------
//STOPSTAT EXEC PGM=IKJEFT1B,DYNAMNBR=20,COND=(4,LT)
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB2P)
-STO DB(DSNDB06) SPACE(SYSSTATS,DSNTCX01,DSNTNX01,DSNTPX01, -
DSNTTX01,DSNTXX01)
//*------- DELETE/DEFINE -----------------------------------------------
//VSAMSTAT EXEC PGM=IDCAMS,COND=(4,LT)
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE (DB2P.DSNDBC.DSNDB06.SYSSTATS.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNTCX01.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNTNX01.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNTPX01.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNTTX01.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNTXX01.I0001.A001)
SET MAXCC=0

DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.SYSSTATS.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY003) CYL(20 10)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.SYSSTATS.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNTCX01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(10 5)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNTCX01.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNTNX01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(4 2)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNTNX01.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNTPX01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(4 2)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNTPX01.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNTTX01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(1 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNTTX01.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNTXX01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(1 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNTXX01.I0001.A001))
//*------- START Tablespace & Indexes ----------------------------------
//STRTSTAT EXEC PGM=IKJEFT1B,DYNAMNBR=20,COND=(4,LT)
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB2P)
-STA DB(DSNDB06) SPACE(SYSSTATS,DSNTCX01,DSNTNX01,DSNTPX01, -
DSNTTX01,DSNTXX01) ACCESS(UT)
//*------- RELOAD Tablespace -------------------------------------------
//RLODSTAT EXEC PGM=DSNUTILB,COND=(4,LT),PARM='DB2P,DB2P.REORG,RESTART'
//SYSREC DD DSN=DB2P.UNLD.SYSREC,DISP=OLD
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(10,30))
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
REORG TABLESPACE DSNDB06.SYSSTATS LOG NO UNLOAD PAUSE
//*
//*=====================
//* SYSSTR
//*=====================
//*
//*------- UNLOAD of Tablespace ----------------------------------------
//UNLDSTR EXEC PGM=DSNUTILB,COND=(4,LT),PARM='DB2P,DB2P.REORG,'
//SYSREC DD DSN=DB2P.UNLD.SYSREC,DISP=OLD
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
REORG TABLESPACE DSNDB06.SYSSTR LOG NO UNLOAD PAUSE
//*------- STOP Tablespace/Indexes -------------------------------------
//STOPSTR EXEC PGM=IKJEFT1B,DYNAMNBR=20,COND=(4,LT)
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB2P)
-STO DB(DSNDB06) SPACE(SYSSTR,DSNSCX01,DSNSDX01,DSNSSX01)
//*------- DELETE/DEFINE -----------------------------------------------
//VSAMSTR EXEC PGM=IDCAMS,COND=(4,LT)
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE (DB2P.DSNDBC.DSNDB06.SYSSTR.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNSCX01.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNSDX01.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNSSX01.I0001.A001)
SET MAXCC=0

DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.SYSSTR.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY003) CYL(1 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.SYSSTR.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNSCX01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(2 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNSCX01.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNSDX01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(2 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNSDX01.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNSSX01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(1 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNSSX01.I0001.A001))
//*------- START Tablespace & Indexes ----------------------------------
//STRTSTR EXEC PGM=IKJEFT1B,DYNAMNBR=20,COND=(4,LT)
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB2P)
-STA DB(DSNDB06) SPACE(SYSSTR,DSNSCX01,DSNSDX01,DSNSSX01) ACCESS(UT)
//*------- RELOAD Tablespace -------------------------------------------
//RLODSTR EXEC PGM=DSNUTILB,COND=(4,LT),PARM='DB2P,DB2P.REORG,RESTART'
//SYSREC DD DSN=DB2P.UNLD.SYSREC,DISP=OLD
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,3))
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
REORG TABLESPACE DSNDB06.SYSSTR LOG NO UNLOAD PAUSE
//*
//*=====================
//* SYSUSER
//*=====================
//*
//*------- UNLOAD of Tablespace ----------------------------------------
//UNLDUSER EXEC PGM=DSNUTILB,COND=(4,LT),PARM='DB2P,DB2P.REORG,'
//SYSREC DD DSN=DB2P.UNLD.SYSREC,DISP=OLD
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
REORG TABLESPACE DSNDB06.SYSUSER LOG NO UNLOAD PAUSE
//*------- STOP Tablespace/Indexes -------------------------------------
//STOPUSER EXEC PGM=IKJEFT1B,DYNAMNBR=20,COND=(4,LT)
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB2P)
-STO DB(DSNDB06) SPACE(SYSUSER,DSNAUH01,DSNAUX02)
//*------- DELETE/DEFINE -----------------------------------------------
//VSAMUSER EXEC PGM=IDCAMS,COND=(4,LT)
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE (DB2P.DSNDBC.DSNDB06.SYSUSER.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNAUH01.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNAUX02.I0001.A001)
SET MAXCC=0

DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.SYSUSER.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY003) CYL(3 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.SYSUSER.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNAUH01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(1 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNAUH01.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNAUX02.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(1 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNAUX02.I0001.A001))
//*------- START Tablespace & Indexes ----------------------------------
//STRTUSER EXEC PGM=IKJEFT1B,DYNAMNBR=20,COND=(4,LT)
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB2P)
-STA DB(DSNDB06) SPACE(SYSUSER,DSNAUH01,DSNAUX02) ACCESS(UT)
//*------- RELOAD Tablespace -------------------------------------------
//RLODUSER EXEC PGM=DSNUTILB,COND=(4,LT),PARM='DB2P,DB2P.REORG,RESTART'
//SYSREC DD DSN=DB2P.UNLD.SYSREC,DISP=OLD
//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SORTOUT DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSPRINT DD SYSOUT=*
//UTPRINT DD SYSOUT=*
//SYSIN DD *
REORG TABLESPACE DSNDB06.SYSUSER LOG NO UNLOAD PAUSE
//*
//*=====================
//* SYSVIEWS
//*=====================
//*
//*------- UNLOAD of Tablespace ----------------------------------------
//UNLDVIEW EXEC PGM=DSNUTILB,COND=(4,LT),PARM='DB2P,DB2P.REORG,'
//SYSREC DD DSN=DB2P.UNLD.SYSREC,DISP=OLD
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
REORG TABLESPACE DSNDB06.SYSVIEWS LOG NO UNLOAD PAUSE
//*------- STOP Tablespace/Indexes -------------------------------------
//STOPVIEW EXEC PGM=IKJEFT1B,DYNAMNBR=20,COND=(4,LT)
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB2P)
-STO DB(DSNDB06) SPACE(SYSVIEWS,DSNGGX02,DSNVTH01,DSNVVX01)
//*------- DELETE/DEFINE -----------------------------------------------
//VSAMVIEW EXEC PGM=IDCAMS,COND=(4,LT)
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE (DB2P.DSNDBC.DSNDB06.SYSVIEWS.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNGGX02.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNVTH01.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNVVX01.I0001.A001)
SET MAXCC=0

DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.SYSVIEWS.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY003) CYL(50 10)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.SYSVIEWS.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNGGX02.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(3 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNGGX02.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNVTH01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(3 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNVTH01.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNVVX01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(3 1)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNVVX01.I0001.A001))
//*------- START Tablespace & Indexes ----------------------------------
//STRTVIEW EXEC PGM=IKJEFT1B,DYNAMNBR=20,COND=(4,LT)
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB2P)
-STA DB(DSNDB06) SPACE(SYSVIEWS,DSNGGX02,DSNVTH01,DSNVVX01) -
ACCESS(UT)
//*------- RELOAD Tablespace -------------------------------------------
//RLODVIEW EXEC PGM=DSNUTILB,COND=(4,LT),PARM='DB2P,DB2P.REORG,RESTART'
//SYSREC DD DSN=DB2P.UNLD.SYSREC,DISP=OLD
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(10,30))
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
REORG TABLESPACE DSNDB06.SYSVIEWS LOG NO UNLOAD PAUSE
//*
//*=====================
//* SYSCOPY (has to be the last one!)
//*=====================
//*
//*------- UNLOAD of Tablespace ----------------------------------------
//UNLDCOPY EXEC PGM=DSNUTILB,COND=(4,LT),PARM='DB2P,DB2P.REORG,'
//SYSREC DD DSN=DB2P.UNLD.SYSREC,DISP=OLD
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
REORG TABLESPACE DSNDB06.SYSCOPY LOG NO UNLOAD PAUSE
//*------- STOP Tablespace/Indexes -------------------------------------
//STOPCOPY EXEC PGM=IKJEFT1B,DYNAMNBR=20,COND=(4,LT)
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB2P)
-STO DB(DSNDB06) SPACE(SYSCOPY,DSNUCH01,DSNUCX01)
//*------- DELETE/DEFINE -----------------------------------------------
//VSAMCOPY EXEC PGM=IDCAMS,COND=(4,LT)
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE (DB2P.DSNDBC.DSNDB06.SYSCOPY.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNUCH01.I0001.A001)
DELETE (DB2P.DSNDBC.DSNDB06.DSNUCX01.I0001.A001)
SET MAXCC=0

DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.SYSCOPY.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY003) CYL(75 15)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.SYSCOPY.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNUCH01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(50 10)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNUCH01.I0001.A001))
DEFINE CL(NAME(DB2P.DSNDBC.DSNDB06.DSNUCX01.I0001.A001) -
LIN REUSE SHR(3 3) VOL(MSY005) CYL(25 5)) -
DATA(NAME(DB2P.DSNDBD.DSNDB06.DSNUCX01.I0001.A001))
//*------- START Tablespace & Indexes ----------------------------------
//STRTCOPY EXEC PGM=IKJEFT1B,DYNAMNBR=20,COND=(4,LT)
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB2P)
-STA DB(DSNDB06) SPACE(SYSCOPY,DSNUCH01,DSNUCX01) ACCESS(UT)
//*------- RELOAD Tablespace -------------------------------------------
//RLODCOPY EXEC PGM=DSNUTILB,COND=(4,LT),PARM='DB2P,DB2P.REORG,RESTART'
//SYSREC DD DSN=DB2P.UNLD.SYSREC,DISP=OLD
//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(10,30))
//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(10,30))
//SORTOUT DD UNIT=SYSDA,SPACE=(CYL,(10,30))
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(10,30))
//SYSPRINT DD SYSOUT=*
//UTPRINT DD SYSOUT=*
//SYSIN DD *
REORG TABLESPACE DSNDB06.SYSCOPY LOG NO UNLOAD PAUSE
//*
//*------- Delete Unload File ------------------------------------------
//DELETE EXEC PGM=IEFBR14,COND=(4,LT)
//SYSREC DD DSN=DB2P.UNLD.SYSREC,DISP=(OLD,DELETE,DELETE)
//*
//*=====================
//*
//* P h a s e I V : IMAGECOPY/QUIESCE all Catalog/Directory TS
//*
//* For Details see DB2 Developers Guide, p. 855 ff.
//*=====================
//*
//*------- Imagecopy SYSUTILX (must be on its own) ---------------------
//IMGCOPX EXEC PGM=DSNUTILB,COND=(4,LT),PARM='DB2P,DB2P.REORG,'
//SYSUTILX DD UNIT=SYSDA,DSN=DB2P.ICOPY.DSNDB01.SYSUTILX.A000(+1),
// DISP=(MOD,CATLG,CATLG),SPACE=(CYL,(3,1),RLSE)
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
COPY TABLESPACE DSNDB01.SYSUTILX COPYDDN SYSUTILX
//*------- Reset COPYPEND on SYSCOPY so we can copy it last ------------
//NOCOPYP EXEC PGM=DSNUTILB,COND=(4,LT),PARM='DB2P,DB2P.REORG,'
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
REPAIR SET TABLESPACE DSNDB06.SYSCOPY NOCOPYPEND
//*------- Imagecopy all CAT/DIR TS except SYSUTILX
//IMGCOPY EXEC PGM=DSNUTILB,COND=(4,LT),PARM='DB2P,DB2P.REORG,'
//DBD01 DD UNIT=SYSDA,DSN=DB2P.ICOPY.DSNDB01.DBD01.A000(+2),
// DISP=(MOD,CATLG,CATLG),SPACE=(CYL,(10,2),RLSE)
//SCT02 DD UNIT=SYSDA,DSN=DB2P.ICOPY.DSNDB01.SCT02.A000(+2),
// DISP=(MOD,CATLG,CATLG),SPACE=(CYL,(50,10),RLSE)
//SPT01 DD UNIT=SYSDA,DSN=DB2P.ICOPY.DSNDB01.SPT01.A000(+2),
// DISP=(MOD,CATLG,CATLG),SPACE=(CYL,(1500,300),RLSE)
//SYSLGRNX DD UNIT=SYSDA,DSN=DB2P.ICOPY.DSNDB01.SYSLGRNX.A000(+2),
// DISP=(MOD,CATLG,CATLG),SPACE=(CYL,(50,10),RLSE)
//SYSCOPY DD UNIT=SYSDA,DSN=DB2P.ICOPY.DSNDB06.SYSCOPY.A000(+2),
// DISP=(MOD,CATLG,CATLG),SPACE=(CYL,(50,10),RLSE)
//SYSDBASE DD UNIT=SYSDA,DSN=DB2P.ICOPY.DSNDB06.SYSDBASE.A000(+2),
// DISP=(MOD,CATLG,CATLG),SPACE=(CYL,(150,30),RLSE)
//SYSDBAUT DD UNIT=SYSDA,DSN=DB2P.ICOPY.DSNDB06.SYSDBAUT.A000(+2),
// DISP=(MOD,CATLG,CATLG),SPACE=(CYL,(1,1),RLSE)
//SYSDDF DD UNIT=SYSDA,DSN=DB2P.ICOPY.DSNDB06.SYSDDF.A000(+2),
// DISP=(MOD,CATLG,CATLG),SPACE=(CYL,(1,1),RLSE)
//SYSGPAUT DD UNIT=SYSDA,DSN=DB2P.ICOPY.DSNDB06.SYSGPAUT.A000(+2),
// DISP=(MOD,CATLG,CATLG),SPACE=(CYL,(1,1),RLSE)
//SYSGROUP DD UNIT=SYSDA,DSN=DB2P.ICOPY.DSNDB06.SYSGROUP.A000(+2),
// DISP=(MOD,CATLG,CATLG),SPACE=(CYL,(1,1),RLSE)
//SYSPKAGE DD UNIT=SYSDA,DSN=DB2P.ICOPY.DSNDB06.SYSPKAGE.A000(+2),
// DISP=(MOD,CATLG,CATLG),SPACE=(CYL,(750,150),RLSE)
//SYSPLAN DD UNIT=SYSDA,DSN=DB2P.ICOPY.DSNDB06.SYSPLAN.A000(+2),
// DISP=(MOD,CATLG,CATLG),SPACE=(CYL,(15,3),RLSE)
//SYSSTATS DD UNIT=SYSDA,DSN=DB2P.ICOPY.DSNDB06.SYSSTATS.A000(+2),
// DISP=(MOD,CATLG,CATLG),SPACE=(CYL,(15,3),RLSE)
//SYSSTR DD UNIT=SYSDA,DSN=DB2P.ICOPY.DSNDB06.SYSSTR.A000(+2),
// DISP=(MOD,CATLG,CATLG),SPACE=(CYL,(1,1),RLSE)
//SYSUSER DD UNIT=SYSDA,DSN=DB2P.ICOPY.DSNDB06.SYSUSER.A000(+2),
// DISP=(MOD,CATLG,CATLG),SPACE=(CYL,(2,1),RLSE)
//SYSVIEWS DD UNIT=SYSDA,DSN=DB2P.ICOPY.DSNDB06.SYSVIEWS.A000(+2),
// DISP=(MOD,CATLG,CATLG),SPACE=(CYL,(50,10),RLSE)
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
COPY TABLESPACE DSNDB01.DBD01 COPYDDN DBD01
COPY TABLESPACE DSNDB01.SCT02 COPYDDN SCT02
COPY TABLESPACE DSNDB01.SPT01 COPYDDN SPT01
COPY TABLESPACE DSNDB06.SYSDBASE COPYDDN SYSDBASE
COPY TABLESPACE DSNDB06.SYSDBAUT COPYDDN SYSDBAUT
COPY TABLESPACE DSNDB06.SYSDDF COPYDDN SYSDDF
COPY TABLESPACE DSNDB06.SYSGPAUT COPYDDN SYSGPAUT
COPY TABLESPACE DSNDB06.SYSGROUP COPYDDN SYSGROUP
COPY TABLESPACE DSNDB06.SYSPKAGE COPYDDN SYSPKAGE
COPY TABLESPACE DSNDB06.SYSPLAN COPYDDN SYSPLAN
COPY TABLESPACE DSNDB06.SYSSTATS COPYDDN SYSSTATS
COPY TABLESPACE DSNDB06.SYSSTR COPYDDN SYSSTR
COPY TABLESPACE DSNDB06.SYSUSER COPYDDN SYSUSER
COPY TABLESPACE DSNDB06.SYSVIEWS COPYDDN SYSVIEWS
COPY TABLESPACE DSNDB01.SYSLGRNX COPYDDN SYSLGRNX
COPY TABLESPACE DSNDB06.SYSCOPY COPYDDN SYSCOPY
//*------- QUIESCE CAT/DIR Tablespaces except SYSUTILX -----------------
//QUIESCE EXEC PGM=DSNUTILB,COND=(4,LT),PARM='DB2P,DB2P.REORG,'
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
QUIESCE TABLESPACE DSNDB01.DBD01
TABLESPACE DSNDB01.SCT02
TABLESPACE DSNDB01.SPT01
TABLESPACE DSNDB06.SYSCOPY
TABLESPACE DSNDB06.SYSDBASE
TABLESPACE DSNDB06.SYSDBAUT
TABLESPACE DSNDB06.SYSDDF
TABLESPACE DSNDB06.SYSGPAUT
TABLESPACE DSNDB06.SYSGROUP
TABLESPACE DSNDB06.SYSPKAGE
TABLESPACE DSNDB06.SYSPLAN
TABLESPACE DSNDB06.SYSSTATS
TABLESPACE DSNDB06.SYSSTR
TABLESPACE DSNDB06.SYSUSER
TABLESPACE DSNDB06.SYSVIEWS
TABLESPACE DSNDB01.SYSLGRNX WRITE YES
//*--------QUIESCE SYSUTILX (must be on its own) -----------------------
//QUIESCX EXEC PGM=DSNUTILB,COND=(4,LT),PARM='DB2P,DB2P.REORG,'
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
QUIESCE TABLESPACE DSNDB01.SYSUTILX WRITE YES
//*------- Start Catalog & Directory in RW mode ------------------------
//STARTRW EXEC PGM=IKJEFT1B,DYNAMNBR=20,COND=(4,LT)
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//* Start DSNDB06 twice, because the first time user defined indexes
//* will not be started because of resource unavail on DSNDSX01
//SYSTSIN DD *