RC/Migrator provides a DDL Only option that generates the necessary DDL statements needed to re-create a DB2 structure.
The generated DDL re-creates the DB2 structure including any referential integrity rules or security.
Create a Migration strategy which specifies the Name and Creator of the Database on the RC/M Create Migration Strategy screen. It is best to use the 'A' explode option.
PRIMARY OBJECT TYPE SPECIFICATION. ( Select one type with 'A' , 'S', or 'E' )
_ Storage Group
_ Materialized Query Table
PRIMARY OBJECT SELECTION SPECIFICATION.
Name ==> DBCORP > Creator ==> authid1 > Where ==> N
Once the required object(s) are selected and the Strategy is saved, carry out a Strategy Analysis.
When in the Update Options screen under the label "Exclusive Options" BND/DAT/STAT/SQL/GRNT/RI ==> , select S for SQL.
NO .AUTHS ==> Y
BND/DAT/STA/SQL/GRNT/RI ==> S <------------------
COMMIT ASAP (SQL ONLY) ==> N
The 'S' option means:
S Generate SQL only, with no CA Batch processor commands. Provides a DDL/DCL snapshot.
This option will generate SQL only with no Batch Processor commands included. The result will contain no commands starting with a dot '.' such as .SYNC , .AUTH , .CONNECT and .SYSTEM.
It means that unlike a normal analysis output , the DDL generated can be executed by utilities like SPUFI or DSNTEP2 without any modifications.
In addition, ensure that the Update Options, Control Options , RI (foreign keys) ==> is set to "L" or "G" according to the requirements of the DDL to be generated so that RI are not missed.
Secondly, if the current security is also required to be part of the snapshot, ensure that Update Options, Control Options, SECURITY ==> is set to 'Y'.
'Y' means include all security so there will be GRANT statements generated.
Lastly, you may wish to consider the analysis option TABLE OBID ==> Y , that adds the OBID of the table to the DDL. If the generated DDL could be used in an OBIDXLAT recovery situation then having the original OBID might be of use.