Comparing DB2 Tablespaces

This document covers the following topics:


Prerequisites

DB2 must be installed. See the section DB2 and SQL/DS in the Predict and Other Systems documentation.

See also General Prerequisites for Comparison Functions.

Calling the Function

The Compare DD Objects with Tablespaces screen is called with code C and object code TS in any Predict main menu or with the command COMPARE TABLESPACE.

18:06:13             *****  P R E D I C T  *****              2007-05-31
Plan   0          - Compare DD Objects with Tablespaces -        Profile SYSTEM
                                                                               
Dataspace ID ..........                                                        
Located in DA .........                                                        
                                                                               
SQL Server ...........*                                  <Default Server>      
                                                                               
Check options                           List options                           
  Dataspace attributes ... Y (Y/N)        Dataspace attributes .....* D        
  Files .................. Y (Y/N)        Files ....................* D        
                                                                               
                                                                               
Update options                                                                 
  Dataspace attributes ... N (Y/N)                                             
  Unlink files ........... N (Y/N)                                             
                                                                               
                                                                               
Restrictions ............*   Profile Default ,used                             
                                                                               
Command ===>                                                                   
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
      Help  Next  Stop  Last  LnkEl Flip  Print Impl  AdmFi SelFi Prof  Main   

Parameters

Common parameters which are not included in the table below are described under Common Parameters for All DB2 Types.

Parameters
Dataspace ID ID of the Predict dataspace object that is to be compared. Asterisk notation can be used.
Contained in DA Predict database object the dataspace object is linked to (via association "Contains DC"). Asterisk notation can be used.
Check options
If check options are not set, compare functions will not reset the Modified after generation flag. See Resetting the Modified after generation Flag for more information.
Dataspace attributes
Y Attributes of the Predict dataspace are compared with the DB2 tablespace.
Files
Y The file list of the dataspace is to be compared with the DB2 tablespace.
List options
Dataspace attributes
How dataspace attributes are reported.
Y All attributes of the Predict dataspace are reported.
N No attributes are reported.
D Different: only attributes of dataspace that are different from the tablespace are reported.
Files
How files linked to the dataspace via association "Contains FI" are to be reported:
Y All files
N No files
D Different: only files that are either not implemented in the DB2 tablespace or not defined in Predict.
Update options
Dataspace attributes
Y Attributes of the Predict dataspace that differ from the DB2 tablespace are changed.
Unlink files
Y Files that are not implemented in the DB2 tablespace are removed from the file list of the Predict dataspace object and from the file list of the database object to which the dataspace belongs.

Comparing DB2 Tablespaces in Batch Mode

Command: COMPARE TABLESPACE

Enter parameters on the next line in positional or keyword form.

Field Keyword Position
Dataspace ID DATASPACE-ID 1
Contained in DA DB 2
Check options 
Dataspace attributes CHECK-DS 3
Files CHECK-FILE 4
List options
Dataspace attributes LIST-DS 5
Files LIST-FILE 6
Update options
Dataspace attributes UPD-DS 7
Unlink files UNLINK-FILE 8
SQL Server SQL-SERVER 9

If you explicitly set SQL-SERVER to blank in order to use the default server, another keyword must be specified after the SQL-SERVER keyword. If it is not possible to specify another keyword, the SQL-SERVER keyword must be followed by "D1=*" as shown below:

SQL-SERVER= ,D1=*

Example

To compare all dataspaces with prefix "TEST" and display all files, code the command:

COMPARE TABLESPACE
DATASPACE-ID=TEST*,LIST-FILE=Y

or

COMPARE TABLESPACE
TEST*,,Y

The example above uses the Natural parameter ID=, and IA==.