RC/Migrator : Generate an Image Copy of a tablespace before any changes.
search cancel

RC/Migrator : Generate an Image Copy of a tablespace before any changes.

book

Article ID: 70227

calendar_today

Updated On:

Products

RC Compare for DB2 for z/OS RC/Migrator for DB2 for z/OS

Issue/Introduction

Is it possible to always generate statements to take an Image Copy of a tablespace before any changes are made to it or it's associated objects when utilizing RC/Migrator for DB2 for z/OS?

  

 

Environment

Release: R20
Component: RCM

Resolution

This can be done using RC/Migrator Utility Profiles. Note that Copy before is not available for Migration Strategies. 

Create your Utility Profile

First create a Utility Profile using a name such as "MYUTILS" with the Y option in the "Copy" column in the "Before" section in the profile as below.

Utility Profile Information:
PROFILE NAME ==> MYUTILS
SHARE        ==> U (Y,N,U)          General and Parallel Options ==> _ (B,U)
------------------------------------------------------------------------------
                      Utility Execution Processing Options ------ ROW: 21/52
                      Before    Normal
                      --------- --------------------------------------------
                      Copy Unld Unld Reorg Load Check Rebuild Runstats Copy
- Tables:
  ADD PARTITION        Y    _     _    Y     _    _      _       _      _
  ROTATE PARTITION     Y    _     _    _     _    _      _       _      _
  ADD CONSTRAINT       Y    _     _    _     _    Y      _       _      _
  AUDIT                Y    _     _    _     _    _      _       _      _
  RESTRICT ON DROP     Y    _     _    _     _    _      _       _      _
  VOLATILE             Y    _     _    _     _    _      _       _      _
  DATA CAPTURE         Y    _     _    _     _    _      _       _      _
  APPEND ON INSERT     Y    _     _    _     _    _      _       _      _
  ADD MQT              Y    _     _    _     _    _      _       _      _
  IDENTITY COL CHANGES Y    _     _    _     _    _      _       _      _
  SECURITY LABEL       Y    _     _    _     _    _      _       _      _
  ADD COLUMN           Y    _     _    Y     _    _      _       _      _
  RENAME COLUMN        Y    _     _    _     _    _      _       _      _
  RENAME TABLE         Y    _     _    _     _    _      _       _      _
  ALTER COLUMN         Y    _     _    Y     _    _      _       _      _
  LIMITKEY             Y    _     _    Y     _    _      _       _      _
  OTHER PENDING CHANGE Y    _     _    Y     _    _      _       _      _
  NON-ALTERABLE CHANGE Y    _     Y    _     Y    Y      _       _      _

The example above is targeting the table attributes but there are attributes for other objects also in a Utility Profile definition. Select the attributes of the objects that you are changing that will trigger a "before" utility depending on the object types in your strategy and the attributes being changed.

Create your Analysis Profile

Next create an Analysis Profile and in 'Utility Options' select your Utility Profile "MYUTILS" created above.

- Utility Options:
    Use Utility Profile?    ===>   Y
      Profile Name          ===>   MYUTILS
      Profile Creator       ===>   authid

Use the OPTIONS    ===> u   field at the top of the screen to set your MODEL ID in this Utility profile. This is because the model entered into the Utility Profile will be the one used for the analysis. This will have an impact on the vendor utility to be generated , either Quick Copy or IBM COPY. Ensure that the required mix of utilities has been selected on the MODEL you have chosen. 

The Model utilities that need to be "activated" in the model include "QCOPY_B  TS QUICK COPY - BEFORE" and "COPY_B   TS IMAGE COPY - BEFORE" for the Quick Copy and the IBM COPY respectively. 

Note that if the appropriate BEFORE utilities are not activated for some reason in the MODEL you are using then you will see this message in the Analysis:

RMA1071W All before COPY utilities have been excluded. No before COPIES will be generated.

If the requested “before” utility is required, update the utility model to activate the associated “before” utility. If the “before” utility is not required, update the utility profile to modify the schema change(s) so that the “before” utility entries are all blank or N.

Create a Strategy

Then create a Compare or Alteration Strategy (Copy Before is not available for Migrations).  Select your Utility Profile when setting up the Analysis Options for the Strategy Analysis.

OPTION SPECIFICATIONS
UPDATE OPTIONS ===> N
PROFILE NAME ===> MYUTILS
PROFILE CREATOR ===> authid

Analyse your Strategy


Finally, analyse the strategy , in the Analysis Output the following sample statements would be seen at the start of the generated utility code before any other utilities would be executed. 

.CALL UTIL COPY PARM(ssid)
.ALLOC FI(SYSC0000)                                                    +
    DA('hlq.database.tablespace.BCOPY')                                +
    NEW CATALOG UNIT(SYSALLDA)                                         +
    SPACE(121,73) BLK(4096) RLSE
.DATA
   COPY TABLESPACE database.tablespace DSNUM ALL
     COPYDDN SYSC0000
.ENDDATA
.FREE FI(SYSC0000)

The sample above will call an IBM Copy Utility in the selected MODEL using a model utility member called COPY_B     "IMAGE COPY       - BEFORE".  The Quick Copy version is QCOPY_B                "QUICK COPY       - BEFORE".  In a Model the choice of Broadcom vs IBM utility member is a "one or the other" toggle using the "X" line command to make the switch. 

This means that the preference of these two utility model members can be customized to use different image Copy Utility Settings than other Image Copies that are carried out at the end of the job.  After all the changes have been made this can be useful in case the image copies taken before will be different than those at the end.

You can tell that this one is the IBM Copy because it is calling UTIL COPY. If it was Quick Copy it would be calling UTLGLCTL.

You can tell that the code was generated by the BEFORE model because both of the standard BEFORE models uses "BCOPY" as a suffix on the DSN.

This of course can be customised as required.

This is what the Quick Copy for DB2 for z/OS (PQC) version would look like when generated:

.CALL UTLGLCTL  PARM(ssid,)                                            +
   INDDN(SYSIN) OUTDDN(PTIMSG)
.ALLOC FI(SYSCP101)                                                    +
       DA('hlq.database.tablespace.BCOPY')                             +
   NEW CATALOG UNIT(SYSALLDA)                                          +
   SPACE(121,73) BLK(4096) RLSE
.DATA
  COPY TABLESPACE database.tablespace
       COPIES COPY01(Y,SYSCP101)
       COPY-BUFFERS 40
       MODIFYBITS YES
       LINEAR NO
       FULL   YES

Additional Information

Utility Profile Services

 

Analysis Profile Services