Limited support BMC provides limited support for this version of the product. As a result, BMC no longer accepts comments in this space. If you encounter problems with the product version or the space, contact BMC Support.BMC recommends upgrading to the latest version of the product. To see documentation for that version, see ALTER and BMC AMI Change Manager for Db2 13.1.

-REOR (IBM REORG utility)


The -REOR command invokes the IBM REORG utility.

Related topic

This command and its parameters are passed to Db2. 

Example of -REOR command

-REOR 000700
             REORG INDEX DEMOCJ.ASCIIN3
             SHRLEVEL CHANGE
             MAXRO 0
             WORKDDN (WRK1001)
             STATISTICS
                        KEYCARD
                        HISTORY ALL

Table spaces that are VCAT defined are reorganized in two phases. The RESTART parameter is used in the -REOR command in the second phase of the reorganization.

Example of  -REOR command—two-phase reorg

-REOR 000250
             REORG TABLESPACE ACMX02A.X20NV
             UNLOAD PAUSE
             UNLDDN SYR1001
             SORTKEYS
             SORTDATA LOG NO
...
-REOR 000650 ,RESTART
             REORG TABLESPACE ACMX02A.X20NV
             UNLOAD PAUSE
             UNLDDN SYR1001
             SORTKEYS
             SORTDATA LOG NO

In some cases, the only changes that you make in a work ID can be accomplished by using ALTER statements and online reorganizations (for example, online schema changes). In those cases, you can use IBM REORG to perform an online reorg (SHRLEVEL CHANGE) of your table spaces.

Example of -REOR command—online reorg

-REOR 000350
             REORG TABLESPACE DEMSMP01.TS003PV
             UNLDDN SYR1001
                    COPYDDN (SYCL0001)
             SORTKEYS
             SORTDATA LOG NO
             SHRLEVEL CHANGE
             MAXRO 0
             MAPPINGTABLE RDACRJ.CRJTBMAP

ALTER and BMC AMI Change Manager for Db2 support the dynamic allocation of data sets for IBM REORG. When the Analysis component generates the worklist, the component includes the names of the data sets. You can enable or disable dynamic allocation by using the DYNREORG installation option, the DYNREORG or NODYNREORG ALUIN keywords, or an option on the Analysis Utility Dataset Options panel. Example of -REOR command—dynamically allocated data sets shows an example of the syntax that IBM REORG uses for the data sets.

-REOR 000550
  TEMPLATE SYRC
      DSN 'RDACRJ.DEGA.RB10206D.SR000001'
      UNIT SYSDA

  TEMPLATE SYDS
      DSN 'RDACRJ.RB10206D.SD000001'
      UNIT SYSDA

  TEMPLATE SYPU
      DSN 'RDACRJ.RB10206D.STEP1.SP000001'
      UNIT SYSDA

  TEMPLATE DCPYLOCP
      DSN 'RDACRJ.RB10206D.T02ASSEG.P000.LP000001'
      UNIT SYSDA

             REORG TABLESPACE CJBASIC.T02ASSEG
             UNLDDN SYRC
                    COPYDDN (DCPYLOCP)
             SORTKEYS
             SORTNUM  32
             SORTDEVT SYSDA
             SORTDATA LOG NO
             SHRLEVEL REFERENCE

(SPE2010) When you specify to use the IBM REORG utility under the following circumstances, the utility requires that the DCPYLOCP TEMPLATE must allocate a separate data set for each partition:

  • You are converting a table space to or performing online schema changes to a partition-by-range table space that uses relative page numbering.
  • The entire table space, or some of the partitions in the table space, must be reorganized.

The Analysis component appends the “.P&PART.” variable to the end of the data set name in the local primary copy (DCPYLOCP) TEMPLATE to accommodate the IBM REORG requirement. For example:

-REOR 000450                                               
 TEMPLATE SYRC                                            
      DSN 'RDACRJ.DELT.RCB0812B.SR000001'                  
      UNIT SYSDA                                           
                                                         
 TEMPLATE SYDS                                            
      DSN 'RDACRJ.RCB0812B.SD000001'                       
      UNIT SYSDA                                           
                                                         
 TEMPLATE SYPU                                            
      DSN 'RDACRJ.RCB0812B.STEP1.SP000001'                 
      UNIT SYSDA                                           
                                                        
 TEMPLATE DCPYLOCP                                        
      DSN 'RDACRJ.RCB0812B.TX03PBR.P000.LP000001.P&PART.'  
      UNIT SYSDA                                           

                                                         
             REORG TABLESPACE R1RPN504.TX03PBR             
             UNLDDN SYRC                                   
                    COPYDDN (DCPYLOCP)                     
             SORTKEYS                                      
             SORTNUM  32                                    
             SORTDEVT SYSDA                                
             SORTDATA LOG NO                               
             SHRLEVEL CHANGE                               
             MAXRO 0                                        
             MAPPINGTABLE RDAJZB.JZBTBMAP
             FASTSWITCH YES               

When you specify to use the utility under the following circumstances, Analysis appends the ".&SN" variable to the end of the data set name in the copy TEMPLATEs (DCPYLOCP, DCPYLOCB, DCPYREMP, DCPYREMB). With this variable, IBM REORG generates a copy for each affected table space.

  • (PTF BQU2734) When a base table space for a partition-by-growth table space includes a table with a LOB column and the REORG includes AUX YES
  • (SPE2104)

     When Analysis uses the ALTER TABLESPACE MOVE TABLE statement to move tables from multi-table spaces to partition-by-growth table spaces

-REOR 003300
 TEMPLATE SYRC
      DSN 'RDACRJ2.DEJM.RCB0129K.SR000001'
      UNIT SYSDA

 TEMPLATE SYDS
      DSN 'RDACRJ2.RCB0129K.SD000001'
      UNIT SYSDA

 TEMPLATE SYPU
      DSN 'RDACRJ2.RCB0129K.STEP1.SP000001'
      UNIT SYSDA

 TEMPLATE DCPYLOCP
      DSN 'RDACRJ2.RCB0129K.TX02SSEG.LP000001.&SN.'
      UNIT SYSDA

             REORG TABLESPACE R1WBALL.TX02SSEG
             UNLDDN SYRC
                    COPYDDN (DCPYLOCP)
             SORTKEYS
             SORTNUM 32
             SORTDEVT SYSDA
             SORTDATA LOG NO
             SHRLEVEL CHANGE
             MAXRO 0
             MAPPINGTABLE RDAJZB.JZBTBMAP
             FASTSWITCH YES

Note that the suffix in the name of a copy data set varies, depending on whether the data set is dynamically allocated. (PTF BQU4258) If the &SN variable is already included in the data set prefix, Analysis does not append the variable to the end of the data set name. If the P&PART variable is already appended to the data set prefix, you might receive an error because the length of the data set name is too long. To resolve the problem, perform one of the following actions to remove the variable from the data set prefix:

  • In your product options file (POF), edit the PCPY1_PREFIX keyword.
  • In the JCL Generation options for local primary copies, edit the data set prefix.

For more information, see the IBM documentation.

Note

The utility command starts on the second line of the statement. The first line is reserved for parameters that are passed to the utility.

 

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