Incorporating DB2 Databases

#### Search Results

Search

# Incorporating DB2 Databases

This document covers the following topics:

- Prerequisites for DB2 Databases

- Selecting DB2 Databases

- Incorporation Functions for DB2 Databases

- Incorporate DB2 Databases in Batch Mode

## Prerequisites for DB2 Databases

Incorporation of DB2 objects is subject to DB2 security mechanisms. See the section DB2 and SQL/DS in the Predict and Other Systems documentation.

Note
See Concepts of Incorporation for basic information on how to use incorporation functions.

## Selecting DB2 Databases

The Incorporate DB2 Databases screen is called with function code I and object code D2 in a Predict main menu or with the command `INCORPORATE DB2`.

    17:52:43             *****  P R E D I C T  *****              2007-05-31
    Plan   0               - Incorporate DB2 Databases -

    DB2 database name ....
    SQL Server ..........*                                  <Default Server>

    Select option
      Creator name .......

    Processing option
      Connect automatic .. N (Y/N)

    Update when connecting
      DB attributes ...... Y (Y/N)

    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

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

Parameters
DB2 database name | DB2 database name. Asterisk notation is allowed.
Creator name | Creator name. Asterisk notation is allowed.
Connect automatic | Y - The DB2 database and the Predict object will be connected by the Compare function (code T) if no differences were detected between the file lists of the two objects.
DB attributes | Y - Attributes of the Predict database object are to be updated.

Databases which meet the selection criteria and are not already connected to a Predict database object are then listed as follows.

    13:09:09             *****  P R E D I C T  *****             2007-05-31
                           - Incorporate DB2 Databases -
    Search-crit.: DB2 database name=ALL
                 Database Default
    Cmd Creator  name     stogroup Predict database ID              Remark

    __  BHD      ABAG     SYSDEFLT
    __  BHD      ADAPT1   SYSDEFLT
    __  BHD      DSNCV    SYSDEFLT
    __  BHD      DSNDB07  SYSDEFLT
    __  BHD      DSNDDF   SYSDEFLT
    __  BHD      DSNRGFDB SYSDEFLT
    __  BHD      DSNRLST  SYSDEFLT
    __  BHD      LANDMARK LMRK0001                                  SC missing
    __  BHD      RISPADB  RISPASTO                                  SC missing

Columns in the List
Creator | Creator of the database.
Database name | Name of the database
Predict database ID | ID of Predict database object for a DB2 database with this DB2 name.
Remark | Either the following type-specific remark or blank. For type-independent remarks see Remarks which apply to all Object Types.
SC missing | Default storagegroup is not documented. Incorporation is not possible.

## Incorporation Functions for DB2 Databases

Valid functions:

- Compare - Code T

- Connect - Code C

- Incorporate - Code I

### Compare - Code T

Compares the database and the Predict database object and reports differences between attributes and file lists.

If no differences between the file lists are found and Connect automatic is set to Y, the dictionary object is connected to the database.

### Connect - Code C

Connects the DB2 database to the corresponding Predict database object and

- copies current information from the DB2 catalog into the dictionary object;

- writes to the generation log of the Predict database object that a corresponding implemented database existed when the connection was established.

### Incorporate - Code I

#### Scope of the Incorporation

- Creates a database object of type D with attributes documenting the database.

- The new database object is linked to the Predict object documenting the current virtual machine via association "Contains DA".

- Connects the database and the Predict database object.

Specify the following parameters in an additional input screen before executing the function. The parameter Database ID is mandatory, the other parameter is optional

Incorporation Options
Database ID | ID of the new Predict database object. The creator and DB2 name of the database joined by a hyphen is displayed and can be accepted or overwritten.
List incorporated code |
Y | The values of all attributes incorporated for the database are to be listed.

## Incorporate DB2 Databases in Batch Mode

Command: `INCORPORATE DB2-DATABASE`

Enter parameters on next line using positional or keyword form.

Field | Keyword | Position
--- | --- | ---
DB2 database name | DB2NAME | 1
Creator name | CREATOR | 2
Connect automatic | AUTO-CONNECT | 3
Function | SUB-FUNCTION | 4
Database ID | DATABASE-ID | 5
List incorporated code | LIST | 6
Update DB attributes | UPD-DB | 7
SQL Server | SQL-SERVER | 8

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 incorporate the DB2 database "DSN8D13A" as database object in Predict with ID "TEST-DB" and display the database attributes, code the command:

    INCORPORATE DB2
    DB2NAME=DSN8D13A,SUB-FUNCTION=I,DATABASE-ID=TEST-DB,LIST=Y

or

    INCORPORATE DB2
    DSN8D13A,,,I,TEST-DB,Y

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

### On this page

- Prerequisites for DB2 Databases
- Selecting DB2 Databases
- Incorporation Functions for DB2 Databases
- Incorporate DB2 Databases in Batch Mode