Before running DSN1COPY

Certain activities might be required before you run the DSN1COPY utility, depending on your situation.

Attention: Do not use DSN1COPY in place of COPY for both backup and recovery. Improper use of DSN1COPY can result in unrecoverable damage and loss of data.

Recommendations

Printing with DSN1PRNT instead of DSN1COPY
If you require only a printed hexadecimal dump of a data set, use DSN1PRNT rather than DSN1COPY.
Copying a table space with DSN1COPY with row formats

When you use a DSN1COPY of a table space to populate another table space, the row formats of the two table spaces must match. If the row formats do not match, the results are unpredictable and could cause integrity problems.

To determine the source table space and target table space row format, run the following query against your Db2 catalog:

 SELECT DBNAME, TSNAME, PARTITION, FORMAT 
    FROM SYSIBM.SYSTABLEPART 
    WHERE (DBNAME = 'source-database-name'
    AND TSNAME='source-table-space-name')
    OR    (DBNAME = 'target-database-name'
    AND TSNAME='target-table-space-name')

If the FORMAT column has a value of 'R', then the table space or partition is in RRF (reordered row format). If the FORMAT column has a blank value, then the table space or partition is in BRF (basic row format).

Determining page size and DSSIZE

Before using DSN1COPY, ensure that you know the page size and data set size (DSSIZE) for the page set. Use the following query on the Db2 catalog to get the information you need in this example for table 'DEPT':

SELECT T.CREATOR,T.NAME,S.NAME AS TABLESPACE,S.PARTITIONS,S.PGSIZE,      
     CASE S.DSSIZE                                      
     WHEN 0 THEN                                        
                 CASE WHEN S.TYPE = 'G' THEN 4194304    
                      WHEN S.TYPE = 'O' THEN 4194304    
                      WHEN S.TYPE = 'P' THEN 4194304    
                      WHEN S.TYPE = 'R' THEN 4194304    
                 ELSE                                   
                      CASE WHEN S.PARTITIONS > 254 THEN 
                           CASE WHEN S.PGSIZE = 4  THEN  4194304        
                                WHEN S.PGSIZE = 8  THEN  8388608        
                                WHEN S.PGSIZE = 16 THEN 16777216        
                                WHEN S.PGSIZE = 32 THEN 33554432        
                           ELSE NULL              
                           END                         
                           WHEN S.PARTITIONS > 64 THEN 4194304   
                           WHEN S.PARTITIONS > 32 THEN 1048576   
                           WHEN S.PARTITIONS > 16 THEN 2097152   
                           WHEN S.PARTITIONS > 0  THEN 4194304   
                      ELSE 2097152                          
                      END   
                 END
      ELSE S.DSSIZE       
      END                      
      AS DSSIZE                     
      FROM SYSIBM.SYSTABLES T,           
           SYSIBM.SYSTABLESPACE S             
      WHERE                                        
           T.NAME = 'DEPT' AND                          
           T.TSNAME = S.NAME; 
Using the OBIDXLAT option with DSN1COPY

When you use DSN1COPY with the OBIDXLAT option to move objects from one system to another system, ensure that the version information on the target system matches the version information on the source version.

Copying a partition-by-range or partition-by-growth table space
When you use DSN1COPY on a partition-by-range or partition-by-growth space, use the SEGMENT option to process the table space.
Copying when pending alterations exist
Before you use DSN1COPY, ensure that the schema of the source and target objects match.
You might also need to run the REORG TABLESPACE utility to materialize pending alterations depending on the following conditions:
  • If the pending alterations are for an added or dropped column, run REORG TABLESPACE.
  • If the pending alteration are for a changed data type, you need to either insert or update at least one row or run REORG TABLESPACE.

After you run DSN1COPY, run REPAIR CATALOG.

Copying a versioned XML table space

Before using DSN1COPY to copy a versioned XML table space, ensure that the definitions of the XML columns START_TS and END_TS match.

Altering a table

When you use ALTER TABLE ADD COLUMN, the table does not change; only the description of the table changes. Before you run DSN1COPY on the table space, run REORG on the table space (so that the data matches its description).