DB2-DSN1COPY

15
DB2 Stand-Alone Utilities DB2 Stand-Alone Utilities DSN1COPY DSN1COPY Reference : IBM manuals ( Utility Reference Guide and Db2 V 8.0 Administration Guide ) Author : Debaranjan Sahoo

Transcript of DB2-DSN1COPY

Page 1: DB2-DSN1COPY

DB2 Stand-Alone UtilitiesDB2 Stand-Alone Utilities

DSN1COPYDSN1COPY

Reference : IBM manuals

( Utility Reference Guide and Db2 V 8.0 Administration Guide )

Author : Debaranjan Sahoo

Page 2: DB2-DSN1COPY

Scope of DSN1COPYScope of DSN1COPY

DB2 VSAM data sets to sequential data sets

DSN1COPY sequential data sets to DB2 VSAM data sets

DB2 image copy data sets to DB2 VSAM data sets

DB2 VSAM data sets to other DB2 VSAM data sets

DSN1COPY sequential data sets to other sequential data sets

Page 3: DB2-DSN1COPY

What VSAMs should be used ?What VSAMs should be used ?

Internally Db2 data is stored in the Internally Db2 data is stored in the VSAM datasets (LDS)VSAM datasets (LDS)

A DB2 VSAM dataset is single piece A DB2 VSAM dataset is single piece of a nonpartitioned tablespace or of a nonpartitioned tablespace or index or single partition of a index or single partition of a tablespace or indextablespace or index

Page 4: DB2-DSN1COPY

How to locate the VSAMs ?How to locate the VSAMs ? catname.DSNDBx.dbname.psname.y

0001.znnnX : C (for VSAM clusters) or D (for VSAM data

components)Dbname : DB2 database namepsname : Table space name or index namey0001 : Instance qualifier for the data setZnnn : Data set number

Page 5: DB2-DSN1COPY

Syntax used for DSN1COPYSyntax used for DSN1COPY

Page 6: DB2-DSN1COPY

Instructions for running Instructions for running DSN1COPYDSN1COPY

It can be executed as a z/OS job when the DB2 subsystem is It can be executed as a z/OS job when the DB2 subsystem is either active or in-activeeither active or in-active

When DB2 is active, following instructions need to be followedWhen DB2 is active, following instructions need to be followed

1. Start the table space as read-only by using START DATABASE.

2. Run the QUIESCE utility with the WRITE (YES) option to externalize all data pages and index pages.

3. Run DSN1COPY with DISP=SHR on the data definition (DD) statement.

4. Start the table space as read-write by using START DATABASE to return to normal operations.

Page 7: DB2-DSN1COPY

Authorizations requiredAuthorizations required

It does not require any authorizationIt does not require any authorization The submitter of the utility job should The submitter of the utility job should

have the RACF authority on the have the RACF authority on the datasets on which the action is datasets on which the action is performedperformed

Page 8: DB2-DSN1COPY

Required DatasetsRequired Datasets

Page 9: DB2-DSN1COPY

DD statements usedDD statements used SYSPRINT : Defines the data set that contains output messages

from the DSN1COPY program and all hexadecimal dump output.

SYSUT1 : Defines the input data set. This data set can be a sequential data set that is created by the DSN1COPY or COPY utilities, or a VSAM data set.

SYSUT2 : Defines the output data set. This data set can be a sequential data set, a VSAM data set, or a DUMMY data set.

SYSXLAT :Defines for translation the DBIDs, OBIDs, presentation space ID (PSID), or ISOBIDs.

Page 10: DB2-DSN1COPY

How to find the DBID, OBID, PSIDHow to find the DBID, OBID, PSID

Do not fetch DBID value from SYSIBM.SYSTABLE

Do not fetch OBID from SYSIBM.SYSTABLESPACE

Run the queries for the table space on which you want to run DSN1COPY

Page 11: DB2-DSN1COPY

How to Find ISOBID How to Find ISOBID

While restoring the Index space ISOBID needs to be found out

Page 12: DB2-DSN1COPY

Restrictions with DSN1COPYRestrictions with DSN1COPY

DSN1COPY does not alter data set structure.

DSN1COPY cannot copy DB2 recovery log data sets.

DSN1COPY cannot be run on concurrent copies.

Page 13: DB2-DSN1COPY

OBIDXLATOBIDXLAT

When DSN1COPY is used with When DSN1COPY is used with OBIDXLAT option to move data from OBIDXLAT option to move data from one subsystem to another subsystem one subsystem to another subsystem , ensure that the source and the , ensure that the source and the target subsystem are present at the target subsystem are present at the same version. If not what will happen same version. If not what will happen ????

Page 14: DB2-DSN1COPY

Sample JCL for TS migrationSample JCL for TS migration//STEP020 EXEC PGM=DSN1COPY,PARM='RESET,FULLCOPY,OBIDXLAT' //STEP020 EXEC PGM=DSN1COPY,PARM='RESET,FULLCOPY,OBIDXLAT' //STEPLIB DD DSN=SYS1.DSNDB2B.SDSNLOAD,DISP=SHR //STEPLIB DD DSN=SYS1.DSNDB2B.SDSNLOAD,DISP=SHR //SYSPRINT DD SYSOUT=* //SYSPRINT DD SYSOUT=* //* IMAGE COPY DATASET //* IMAGE COPY DATASET //SYSUT1 DD DSN=FMS.DB2B.FIC.FMSDF01.FMSSHCL.D04233.T2247567, //SYSUT1 DD DSN=FMS.DB2B.FIC.FMSDF01.FMSSHCL.D04233.T2247567, // DISP=SHR // DISP=SHR //* THE VSAM CLUSTER WHICH DESCRIBES THE DEV TABLESPACE //* THE VSAM CLUSTER WHICH DESCRIBES THE DEV TABLESPACE //SYSUT2 DD DSN=FMS.DSNDBC.FMSDF01.FMSSHCL.I0001.A001,DISP=OLD //SYSUT2 DD DSN=FMS.DSNDBC.FMSDF01.FMSSHCL.I0001.A001,DISP=OLD //* THE TRANSLATION OF PROD TO DEV PSID, DBID,OBID //* THE TRANSLATION OF PROD TO DEV PSID, DBID,OBID //SYSXLAT DD * //SYSXLAT DD * 273,439 273,439 342,342 342,342 343,343 343,343 /* /*

Page 15: DB2-DSN1COPY

After Running DSN1COPY on TSAfter Running DSN1COPY on TS

The INDEX needs to be rebuiltThe INDEX needs to be rebuilt Index space can also be recovered Index space can also be recovered

using DSN1COPYusing DSN1COPY Start the database in RW modeStart the database in RW mode