Important We are integrating BMC AMI LOBMaster technology into the BMC AMI Reorg product and discontinuing BMC AMI LOBMaster as a separate product. For the latest integrated documentation, see BMC AMI Reorg for Db2 13.1.

Reorganizing table spaces


Use the following procedure to reorganize simple, segmented, or partitioned table spaces.

Before you begin

BMC AMI Reorg automatically produces an image copy after each reorganization. Use the BMC-AMI-Reorg-OUTPUT-command or XCPYDYNM-dynamic-image-copy-data-set-allocation-automation-control-point to allocate data sets for the image copies.

If you are reorganizing partition-by-growth (PBG) table spaces, see Reorganizing-partition-by-growth-PBG-table-spaces.

If you are reorganizing XML table spaces, see Reorganizing-XML-table-spaces.

If you are reorganizing LOB table spaces, see Reorganizing-LOB-table-spaces.

To reorganize table spaces

  1. 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.ALLACCTS

    A 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.CARUVS

    A 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)

  2. Run the statement.

Important

  • BMC AMI Reorg might report a differing number of keys before and after a reorganization. Row deletions performed before or during the reorganization might cause this difference. This is not indicative of a program error or data integrity issue.
  • BMC AMI Reorg processes only the first occurrence of the table space and ignores the multiple occurrences of the same object in SYSIN.


 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*