Reorganizing table spaces
To reorganize table spaces
Create a REORG TABLESPACE statement as follows:
To reorganize
Do this
Example
A simple table space
Create a basic REORG TABLESPACE statement
REORG TABLESPACE NWDB.ALLACCTSA set of table spaces but exclude specific table spaces within the set
Include an EXCLUDE-TABLESPACE clause.
REORG TABLESPACE ADMINDB.CAR%
EXCLUDE TABLESPACE ADMINDB.CARMIDSZ
EXCLUDE TABLESPACE ADMINDB.CARLUXRY
EXCLUDE TABLESPACE ADMINDB.CARUVSA table space but send discards to a data set based on specific criteria
Include a Discard specification clause and a WHERE clause.
//OBSOLETE DD DISP=SHR,DSN=ADMIN.CENTRAL.DISCARDS
//SYSIN DD *
REORG TABLESPACE DB9900.CENTRAL
DISCARDDN(OBSOLETE)
DISCARD FROM TABLE DB9900.CENTRAL_INV_TBL WHERE (SKU > '592032')Physical partitions of a partitioned table space (a single partition, a range, or a mixture of both)
Include an PART or PARTS keyword. PART and PARTS are interchangeable.
Specifies a single partition:
REORG TABLESPACE NWDB.ALLACCTS PART(7)Specifies a range of partitions by including the starting and ending partition numbers, separated by a colon:REORG TABLESPACE NWDB.ALLACCTS PARTS(2:8)
Specifies a mixture of single partitions and ranges:REORG TABLESPACE NWDB.ALLACCTS PART(2,5:9,12,15:22,25,30)
Logical partitions of a partitioned table space (a single partition, a range, or a mixture of both)
Include an LPART or LPARTS keyword. LPART and LPARTS are interchangeable.
Specifies a single partition:
REORG TABLESPACE NWDB.ALLACCTS LPART(7)Specifies a range of partitions by including the starting and ending partition numbers, separated by a colon:REORG TABLESPACE NWDB.ALLACCTS LPARTS(2:8)
Specifies a mixture of single partitions and ranges:REORG TABLESPACE NWDB.ALLACCTS LPART(2,5:9,12,15:22,25,30)
- Run the statement.