RC/Compare for DB2 for Z/OS : Table Altered in a compare but related Views not generated.
search cancel

RC/Compare for DB2 for Z/OS : Table Altered in a compare but related Views not generated.

book

Article ID: 54072

calendar_today

Updated On:

Products

RC Compare for DB2 for z/OS

Issue/Introduction

A compare Strategy will regenerate the Table correctly, but the required View (SELECT VIEW ..) Statement will not be regenerated within the compare Strategy. Why?

 

Environment

Release: R20
Component: RCC

Resolution

Consider the situation where,  during a COMPARE Strategy, a change to a table is found such as the attribute of a column that is used by one or more associate views.

In this case the table might just be altered. The associated views however must be regenerated. 

When starting an analysis of the Compare Strategy, select UPDATE OPTIONS    ===> y  and set the control option: REGENERATE VIEWS ==> Y

For details, please see RC/Migrator User Guide, under ANALYSIS, Control Options

Field:  REGENERATE VIEWS (Y|N)

Description:  Indicate whether you want REGENERATE VIEW statements
to be produced for VIEWS that are affected by an ALTER TABLE.

Values:  Y   Produce the REGENERATE VIEW statements that are needed.
         N   (Default)  Do not produce REGENERATE VIEW statements.

In the Analysis JCL/Parms used by the Analysis job there will be a REGVIEW parm generated there.

//PARMFILE DD   *
STRTSSID ssid
CREATOR  authid1
 STRATEGY ACT
 OUTPUT   DDL_TABLE
 COMPRESS B
 AUXIMP   N
 MQTIMP   Y
 REFMQT   Y
 RI GLOBAL
 LOBTOO
 SEQIMP
 RTNIMP
 RTNIIO   N
 SECURITY
SQLID    authid1
 REGVIEW <--------------------------
 UNLOAD
 DATASTAT
 HEADER
 TRAILER
 REPINDDL
 DELUNLD
 DELTEMP
 RUNSTATS
 CHEKDATA
 IMAGCOPY
 RECOVIX
 REORGTS
 REORGIX
 BIND
PREFIX   authid1
 MODEL4   @DEFAULT
MODEL4C  authid1
/*

Sample Analysis Output:

Table authid1.ACT has column ACTDESC altered to be 30 characters.

The Analysis generates the ALTER statement(assuming you want an ALTER not a DROP/CREATE).

ALTER   TABLE authid1.ACT
    ALTER
      COLUMN ACTDESC
             SET DATA TYPE VARCHAR    (30   )
            ;

There are three associated views that use that column ACTDESC:

 ALTER VIEW authid2.VSTAFAC2            REGENERATE ;

.AUTH  authid1

 ALTER VIEW authid1.VSTAFAC1            REGENERATE ;

.AUTH  authid1

 ALTER VIEW authid1.VACT                REGENERATE ;

 

The Compare Analysis Report will show:

Table Changes for:
Creator: authid1
Name:    ACT

------------ Table Column Changes --------------------
Attribute      Status       Value
-------------  -----------  ----+----1----+----2----+----3--
NAME           Currently:   ACTDESC
               Changed To:  (NOT CHANGED)
SIZE           Currently:   20
               Changed To:  30

Additional Information

Analysis Options

Control Options