RI Manager for Db2 for Z/OS : Create a new set of tables as an identical RI set but with a different creator.
search cancel

RI Manager for Db2 for Z/OS : Create a new set of tables as an identical RI set but with a different creator.

book

Article ID: 232736

calendar_today

Updated On:

Products

RI Manager for DB2 for z/OS

Issue/Introduction

Create a new set of tables as an identical RI set but with a different Database, tablespace or creator.

Environment

DB2 for Z/OS

Release : R20

Resolution

Enter into RI/Manager(Option 6 on the main products menu)

Select your RI structure and enter the EXPLODE command to display all the tables:

20.0   --------------- RI Manager Relationship Sets Management ---------------
Command ===>                                                  Scroll ===> CSR

Specify Named Relationship Set Filter Criteria:
  DB2 SSID ==> ssid                     Include NRS ==> N        RI only ==> N
  Tbl Name ==> TBROLE                       Creator ==> authid1   >
  Nrs Name ==>                              Creator ==>            Share ==> A

Cm   Name                             Creator  Sh +---- NRS Last Update -----+
 - -ssid:authid1:TBROLE
   Desc: Catalog derived relationship set                      Lvl RI Status
      1 authid1.TBROLE                                           1
      2 authid1.TBEMP_TASK_ROLE                                  2 S
      3 authid1.TBDEPT                                           1
      4 authid1.TBDEPT (3+)                                      2 S
      5 authid1.TBPROJECT                                        2 S
      6 authid1.TBPROJECT (5+)                                   3 S
      7 authid1.TBTASK                                           3 S
      8 authid1.TBEMP_TASK_ROLE (2)                              4 S
      9 authid1.TBWORK_GROUP                                     2 S
     10 authid1.TBEMP                                            3 S
     11 authid1.TBDEPT (3+)                                      4 S
     12 authid1.TBEMP_TASK_ROLE (2)                              4 S
     13 authid1.TBPROJECT (5+)                                   4 S

One of the line commands available is:
R  - Copy Relationships.  Create a new set of tables as an identical RI set but with a different creator.

Enter "R" against a table in the table list below.

20.0   --------------- RI Manager Relationship Sets Management ---------------
Command ===>                                                  Scroll ===> CSR

Specify Named Relationship Set Filter Criteria:
  DB2 SSID ==> ssid                     Include NRS ==> N        RI only ==> N
  Tbl Name ==> TBROLE                       Creator ==> authid1   >
  Nrs Name ==>                              Creator ==>            Share ==> A

Cm   Name                             Creator  Sh +---- NRS Last Update -----+
 - -ssid:authid1:TBROLE
   Desc: Catalog derived relationship set                      Lvl RI Status
      1 authid1.TBROLE                                           1
      2 authid1.TBEMP_TASK_ROLE                                  2 S
      3 authid1.TBDEPT                                           1
      4 authid1.TBDEPT (3+)                                      2 S
      5 authid1.TBPROJECT                                        2 S
      6 authid1.TBPROJECT (5+)                                   3 S
      7 authid1.TBTASK                                           3 S
      8 authid1.TBEMP_TASK_ROLE (2)                              4 S
      9 authid1.TBWORK_GROUP                                     2 S
R    10 authid1.TBEMP                                            3 S
     11 authid1.TBDEPT (3+)                                      4 S
     12 authid1.TBEMP_TASK_ROLE (2)                              4 S
     13 authid1.TBPROJECT (5+)                                   4 S

ENTER 

This window is displayed:

----------------- Copy Relationships Specification -----------------
Command ===>

  Mode    : B              (O-Online, B-Batch)
SSID    : ssid
  RI Type : S              (S-System, U-User, *-Same as source)
  Stogroup      :           > (Stogroup Name or *-Same as source)
  Database      : *           (Database Name or *-Same as source)
  Tablespace    : *           (Tablespace Name or *-Same as source)
  Table Creator :           >

Change the fields according to the requirements:

Command ===>
                                                                           
       Mode    : B              (O-Online, B-Batch)
     SSID    : ssid                                                        
       RI Type : S              (S-System, U-User, *-Same as source)
    Stogroup      :           > (Stogroup Name or *-Same as source)      
       Database      : DBCORPC     (Database Name or *-Same as source)
       Tablespace    : *           (Tablespace Name or *-Same as source)
     Table Creator : authid2   >

This will create a new Database, will keep the same tablespace names and create the tables with a new creator authid2.

Enter

This is the next screen to be displayed:

---------- Copy Relationships Batch Processing ---------  2022/01/20 20:17
Command ===>

  Batch Option       : 2   ( 1-Create DDL Only, 2-Create DDL and Execute )
  Restart Option     : N   ( N-No, O-Override )
  DDL Dataset Name   :

ALLOCATION PARAMETERS
  Volume Serial      :            ( Blank for authorized default volume )
  Generic Unit       : SYSDA      ( Unit name for non-SMS datasets )
  Disposition        : CATALOG    ( Catalog )
  Output Disposition : REPLACE    ( New, Replace )

SMS PARAMETERS
  Management Class   :            ( Blank for default management class )
  Storage Class      :            ( Blank for default storage class )
  Data Class         :            ( Blank for default data class )


Change the fields as required:

Options selected below:
Option 2 to create and execute the DDL.
Specify the output DDL dataset name to be created.
Specify if the JCL generated will contain a .RESTART OVERRIDE card if this is not the first time that this DDL has been executed as the DDL must be executed again.

---------- Copy Relationships Batch Processing ---------  yyyy/mm/dd hh:mm
Command ===>

Batch Option       : 2   ( 1-Create DDL Only, 2-Create DDL and Execute )
  Restart Option     : o   ( N-No, O-Override )
  DDL Dataset Name   : 'hlq.ddlfile'

ALLOCATION PARAMETERS
  Volume Serial      :            ( Blank for authorized default volume )
  Generic Unit       : SYSDA      ( Unit name for non-SMS datasets )
  Disposition        : CATALOG    ( Catalog )
  Output Disposition : REPLACE    ( New, Replace )

SMS PARAMETERS
  Management Class   :            ( Blank for default management class )
  Storage Class      :            ( Blank for default storage class )
  Data Class         :            ( Blank for default data class )

Enter to go to the job submission screen and submit the job.


The job is then submitted and the output is placed on the DDL Dataset Name above.
RI manager executes the DDL it has generated for you.

The new RI structure is below.

20.0   --------------- RI Manager Relationship Sets Management ---------------
Command ===>                                                  Scroll ===> CSR

Specify Named Relationship Set Filter Criteria:
  DB2 SSID ==> ssid                     Include NRS ==> N        RI only ==> N
Tbl Name ==> TBEMP                        Creator ==> authid2   >
  Nrs Name ==>                              Creator ==>            Share ==> A

Cm   Name                             Creator  Sh +---- NRS Last Update -----+
   - -ssid:authid1:TBROLE
   Desc: Catalog derived relationship set                      Lvl RI Status
    1 authid2.TBROLE                                           1
    2 authid2.TBEMP_TASK_ROLE                                  2 S
    3 authid2.TBDEPT                                           1
    4 authid2.TBDEPT (3+)                                      2 S
    5 authid2.TBPROJECT                                        2 S
    6 authid2.TBPROJECT (5+)                                   3 S
    7 authid2.TBTASK                                           3 S
    8 authid2.TBEMP_TASK_ROLE (2)                              4 S
    9 authid2.TBWORK_GROUP                                     2 S
   10 authid2.TBEMP                                            3 S
   11 authid2.TBDEPT (3+)                                      4 S
   12 authid2.TBEMP_TASK_ROLE (2)                              4 S
   13 authid2.TBPROJECT (5+)                                   4 S

Looking at the Database structure with an RC/Query batch report, it looks the same as the original other than the creator:

yyyy/mm/dd  hh:mm                                                                                                 Page      1.1
                 DB2 SSID:ssid     ---------- RC/Q OBJECT DEPENDENCY -----------
LOCATION: LOCAL
 DATABASE  TABLESPACE   TABLENAME           TBCREATR INDEXNAME               IXCREATR
DBCORPC
           TSDEPT
                        TBDEPT              authid2
                                                     PIXTBDEPT               authid2
                                                     TBDEPTX1                authid2
                        TBWORK_GROUP        authid2
                                                     PIXTBWORK_GROUP         authid2
           TSEMP
                        TBEMP               authid2
                                                     XEMP1                   authid2
           TSPROJ
                        TBEMP_TASK_ROLE     authid2
                                                     PIXTBEMP_TASK_ROLE      authid2
                        TBPROJECT           authid2
                                                     PIXTBPROJECT            authid2
           TSROLE
                        TBROLE              authid2
                                                     PIXTBROLE               authid2
           TSTASK
                        TBTASK              authid2
                                                     PIXTBTASK               authid2

Additional Information

Copy RI Structures