Use of the REORG utility at partition level in a RC/Migrator strategy
search cancel

Use of the REORG utility at partition level in a RC/Migrator strategy

book

Article ID: 220494

calendar_today

Updated On:

Products

RC/Migrator for DB2 for z/OS

Issue/Introduction

How can the @DEFAULT model in RC/Migrator for Db2 for z/OS (RCM) "Utility Model Services" be used in order to generate the REORG utility at partition level in a RCM strategy.

Resolution

There is no need to change the model. The Analysis, Control option  "Drop & Re-create" should be set to "N" so that a DROP/CREATE is not generated.

RC/Migrator (RCM) generates the REORG utility statements depending on the situation. 

Consider a partitioned tablespace with four parts. 

If for example the PRIQTY of part 2 and 4 of a tablespace are altered in an RCM Alteration Strategy, the analysis will generate two separate REORG statements after the ALTER statements.

    ALTER TABLESPACE MYDB.MYTS
           ALTER PARTITION 2
                                    SECQTY 200
    ;

.SYNC 5         'ALTER TABLESPACE MYDB.MYTS'


    ALTER TABLESPACE MYDB.MYTS
           ALTER PARTITION 4
                                    SECQTY 200
    ;

.SYNC 10        'ALTER TABLESPACE MYDB.MYTS'

.CALL UTIL REORG PARM(ssid)
.DATA
TEMPLATE PTIUNLD
         DSN      'AUTHID.MYDB.MYTS.V7334.P&PA..UNLD'
         SPACE CYL

TEMPLATE PTIPUNCH
         DSN      'AUTHID.MYDB.MYTS.V7334.P&PA..PNCH'
         SPACE CYL

TEMPLATE PTICOPY
         DSN      'AUTHID.MYDB.MYTS.V7334.P&PA..SCPY'
         SPACE CYL

  REORG TABLESPACE MYDB.MYTS
        SHRLEVEL       CHANGE
        DRAIN_WAIT     20
        RETRY          10
        RETRY_DELAY    60
        MAXRO          18
        DRAIN          WRITERS
        LONGLOG        CONTINUE
        DELAY          1200
        FASTSWITCH     YES
        UNLOAD         CONTINUE
        KEEPDICTIONARY
        PART           002
        UNLDDN         PTIUNLD
        PUNCHDDN       PTIPUNCH
        SORTDEVT       SYSDA
        COPYDDN        PTICOPY
        STATISTICS
          TABLE(ALL)
          INDEX(ALL)
          REPORT       NO
          UPDATE       ALL
          HISTORY      NONE
          FORCEROLLUP  NO

  REORG TABLESPACE MYDB.MYTS
        SHRLEVEL       CHANGE
        DRAIN_WAIT     20
        RETRY          10
        RETRY_DELAY    60
        MAXRO          18
        DRAIN          WRITERS
        LONGLOG        CONTINUE
        DELAY          1200
        FASTSWITCH     YES
        UNLOAD         CONTINUE
        KEEPDICTIONARY
        PART           004
        UNLDDN         PTIUNLD
        PUNCHDDN       PTIPUNCH
        SORTDEVT       SYSDA
        COPYDDN        PTICOPY
        STATISTICS
          TABLE(ALL)
          INDEX(ALL)
          REPORT       NO
          UPDATE       ALL
          HISTORY      NONE
          FORCEROLLUP  NO

However, if the whole tablespace is to be reorganized, such as when PAGENUM , SEGSIZE or DSSIZE is altered,  RCM generates only one REORG statement.
This is how the product (and MODEL) was designed.

    ALTER TABLESPACE MYDB.MYTS
          PAGENUM RELATIVE;

.SYNC 5         'ALTER TABLESPACE MYDB.MYTS'

.CALL UTIL REORG PARM(ssid)
.DATA
TEMPLATE PTIUNLD  DSN 'AUTHID.MYDB.MYTS.V7653.S.UNLD'
         SPACE CYL

TEMPLATE PTICOPY  DSN 'AUTHID.MYDB.MYTS.V7653.S&PA..COPY'
         SPACE CYL

TEMPLATE PTIDISC  DSN 'AUTHID.MYDB.MYTS.V7653.S.DISC'
         SPACE CYL

REORG TABLESPACE MYDB.MYTS
      LOG            NO
      COPYDDN        PTICOPY
      UNLDDN         PTIUNLD
      DISCARDDN      PTIDISC
      SHRLEVEL       CHANGE
      DRAIN_WAIT     20
      RETRY          10
      RETRY_DELAY    60
      MAXRO          18
      DRAIN          WRITERS
      LONGLOG        CONTINUE
      DELAY          1200
      FASTSWITCH     YES
      UNLOAD         CONTINUE
      KEEPDICTIONARY
      STATISTICS
        TABLE(ALL)
        INDEX(ALL)
        REPORT      NO
        UPDATE      ALL
        HISTORY     NONE
        FORCEROLLUP NO