How to back out (reverse) DDL that is created in a RC/Migrator or RC/Compare strategy
search cancel

How to back out (reverse) DDL that is created in a RC/Migrator or RC/Compare strategy

book

Article ID: 22055

calendar_today

Updated On:

Products

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

Issue/Introduction

Is there a way to back out (reverse) the DDL that is created in RC/Migrator for Db2 for z/OS (RCM) or
RC/Compare for Db2 for z/OS (RCC) strategy.

Resolution

The strategy analysis screen provides an option to generate the information necessary to recover the objects. The method to use is
the RECOVERY option (set to Y) in the Execution Specifications section of the screen when creating the strategy.

RMA3  20.0   --------- RC/M Migration Strategy Analysis -------- yy/mm/dd hh:mm
COMMAND ===>

STRATEGY ===> strategy     DESCRIPTION ===> strategy description
CREATOR  ===> authid1         SHAREOPTION ===> U
--------------------------------------------------------------------- authid
EXECUTION SPECIFICATIONS                          ACCESS SPECIFICATIONS
 EXECUTION MODE ===>   ( O - Online, B - Batch )   ACM ANALYSIS   ===> N
 OVERRIDE       ===> N                             PDS ANALYSIS   ===> N
 RECOVERY       ===> Y
                                                  DB2 SSID SPECIFICATIONS
OPTION SPECIFICATIONS                              SOURCE SSID    ===> ssid
UPDATE OPTIONS    ===> N                          TARGET SSID    ===> ssid
  PROFILE NAME     ===>
  PROFILE CREATOR  ===>

 GLOBAL CHANGES ===> N
  SET NAME      ===>
  SET CREATOR   ===>

OUTPUT ANALYSIS SPECIFICATIONS
EDIT OUTPUT    ===> N          ANALYSIS USER ===> authid1
STRATEGY       ===> strategy   ANALYSIS DATE ===> N/A
CREATOR        ===> authid1    ANALYSIS TIME ===> N/A
 COMMENT        ===>

The Recovery option permits recovery from a strategy execution. Using the Recovery option, all objects in the strategy can be returned to their original versions.

Field:  RECOVERY                                          

Description:  Indicate whether you want the migration, alteration, or compare to be recoverable.                 

Values:  Y   Yes.  Generate the information necessary to recover, and save it in a recovery dataset.  

             Also display the Recovery Options screen.    

       N   (Default)  No.  Do not make the objects recoverable.     

      U   Display the Recovery Options  Screen

During the execution of the analysis , the recovery information is gathered by the generated SNAPSHOT step.
The recovery DDL is ONLY available AFTER execution of the analysis not before!

In the initial analysis output a call statement like this indicates that the recovery option will be used:

When using MANAGED OUTPUT... 

.CALL SNAPSHOT -
       PARM(ssid,authid1 ,strategy,authid1,2021092902452336,25001,B)

When output to a partitioned dataset....

.CALL SNAPSHOT
.ALLOC FI(RCVRFILE) +
  DA('hlq.hlq1.pds(strategy)') OLD
.DATA

After the analysis has been executed, the recovery DDL is available using the 'R' line command on the analysis output line.

Line Command    Function
------------  ----------------------------------------------------------------
     R        Submit the associated Recovery analysis output DDL for batch
              processor execution.

RMS1 20.0   -------------- RC/M Strategy Services -------------- yy/mm/dd hh:mm
COMMAND ===>                                                  SCROLL ===> CSR

DB2 SSID ===> ssid
STRATEGY ===> strategy  CREATOR ===> authid1  TYPE ===> *    SRC SSID ===> *
--------------------------------------------------------------------- authid

                                              T S SRC  +---- LAST UPDATE ----+
O STRATEGY DESCRIPTION               CREATOR  P O SSID   USER     DATE   TIME
_ ________ _________________________ authid1  _ N ____ <== STRATEGY CREATION
_ strategy                         authid1  A U ssid authid1 yy/mm/dd hh:mm
R * MANAGED OUTPUT *                                 authid1 yy/mm/dd hh:mm

The "R" line command then transfers to the Batch Processor screen for execution of the recovery.

Before deciding to execute the recovery, use the EDIT INPUT     ===> Y field to review the DDL that has been generated to undo the DDL from the initial analysis.

PTBPT 20.0   --------- Batch Processor Interface --------- yyyy/mm/dd hh:mm
COMMAND ===>

EXECUTION SPECIFICATIONS:
 EXECUTION MODE ===>           ( B - Batch mode, O - Online mode )
DB2 SSID       ===> ssid

BATCH PROCESSOR ANALYSIS INPUT:
STRATEGY       ===> strategy    ANALYSIS USER  ===> authid
CREATOR        ===> authid1     ANALYSIS DATE  ===> yyyymmdd
                               ANALYSIS TIME  ===> hhmmssss
 EDIT INPUT     ===> Y         ( Y - Yes, N - No )


This takes the user to the Recovery Analysis that was generated at execution of the initial analysis and that is ready for execution if a backout is desired. 

--======================================================================
-- 20.0         CA-DB2   DROP RECOVERY Analysis Report      yy/mm/dd hh:mm:ss
--======================================================================
--Strategy Information:
--Strategy ==> RECOVERY  Description  ===> DROP RECOVERY
--Creator  ==> authid1   Share Option ===> N (U,Y,N,X,L)  Src SSID ===>
--
--Drop Recovery Objects:
-- OBJECT TYPE NAME                             CREATOR
-- TABLESPACE  tsname                           creator
--
--
--Analysis Options:
--  Execution Mode    ===> O (O - Online, B - Batch)
--  Analysis Override ===> N
--  Access Mode       ===> CATALOG
--  Model ID          ===> authid1
--  Model Creator     ===> authid1
--
--  Security          ===> Y             Statistics   ===> Y
--  Data Statistics   ===> N             Check Data   ===> Y
--  No Set SQLID STMT ===> N             Image Copy   ===> P
--  Truncate          ===> N             Bind/rebind  ===> R
--  All Rows          ===> Y             Reorg        ===> B
--  Number Rows       ===>               Recover IX   ===> N
--  Default SQLID     ===> authid1
--  Alias SQLID       ===>
--  Drop & Re-create  ===> N
--  Regenerate Views  ===> N
--  MQT Refresh       ===> N
--  Set Terminator    ===> ;  (defaulted)
--
--  No .AUTHS         ===> Y             VSAM Defines  ===> N
--  SQL Only          ===> N             VSAM Deletes  ===> N
--  Commit ASAP       ===> N

If the initial analysis was not executed or there was some problem with it, an attempt to view the recovery DDL
using the "R" line command may return this error message:

RM114 RM114E: No recovery DDL is available -- RECOVERY=N. HELP for info.

Control of the location for the Recovery Analysis Output is set via the.....

RC/Migrator PROFILE,

2 - RC/Migrator Profile Variables,

UPDATE OUTPUT SPECIFICATIONS ===> Y Y - View or update analysis output specifications.

RMPROF2 20.0   ------- RC/M Global Operational Parameters ------ yy/mm/dd hh:mm
COMMAND ===>

 ANALYSIS OUTPUT TO PDS ===> Y    (Y,N)
DEFAULT ANALYSIS PDS   ===> 'hlq.hlq1.pds1'

 RECOVERY OUTPUT TO PDS ===> Y    (Y,N)
DEFAULT RECOVERY PDS   ===> 'hlq.hlq1.pds'

 ICL OUTPUT TO PDS      ===> N    (Y,N)
DEFAULT ICL PDS        ===> 'hlq.hlq1.pds.ICL'

 BATCH JCL OUTPUT PDS   ===> N    (Y,N)
DEFAULT OUTPUT JCL PDS ===> 'hlq.hlq1.pds.CNTL'


Field:  RECOVERY OUTPUT TO PDS

Description:  Indicate whether RC/MIGRATOR will write
a recovery output to a default PDS or to a Managed
Output table.

Values:  Y   Yes, write recovery analysis output to the
             default PDS designated in the Default
             Recovery PDS field.

         N   No, do not send recovery output to a PDS.
             Send it to a table managed by RC/MIGRATOR's
             Output Manager.

Additional Information

Recovery Option