RDBPROD: How to Restore the connection between an Rdb Database and CDD when INTEGRATE does not do this

(Doc ID 983302.1)

Last updated on AUGUST 03, 2016

Applies to:

Oracle Rdb Server on OpenVMS - Version 7.0 to 7.2.5 [Release 7.0 to 7.2]
Oracle CDD/Repository - Version 7.0 to 7.2.0.2 [Release 7.0 to 7.2]
HP OpenVMS VAX
HP OpenVMS Itanium
HP OpenVMS Alpha

Goal

When an Rdb database is integrated into the CDD, using record and field definitions in the CDD for the tables and domains, links are stored in both the CDD and the Rdb database.

Begin with 4 fields, F1, F2, F3 and F4, and a record R1 in the CDD. Create an Rdb database called RDBCDD, with 4 domains F1 - F4 using the fields F1 - F4 from the CDD, and a table R1 using the CDD record R1.

$ assign sys$common:[cddplus]cdd_integ cdd$default
$ mc cdo
CDO> define field f1 datatype is signed longword.
CDO> define field f2 datatype text size 5.
CDO> define field f3 datatype is signed longword.
CDO> define field f4 datatype text size 5.
CDO> define record r1.
cont> f1.
cont> f2.
cont> f3.
cont> f4.
cont> end record.
CDO> dir

Directory SYS$COMMON:[CDDPLUS]CDD_INTEG

F1(1) FIELD
F2(1) FIELD
F3(1) FIELD
F4(1) FIELD
R1(1) RECORD
CDO> show record r1
Definition of record R1
| Contains field F1
| Contains field F2
| Contains field F3
| Contains field F4

CDO> exit
$ mc sql$
SQL> create database filename rdbcdd pathname cdd$default.rdbcdd;
SQL> disconnect all;
SQL> attach 'pathname rdbcdd';
SQL> create domain from f1;
SQL> create domain from f2;
SQL> create domain from f3;
SQL> create domain from f4;
SQL> create table from r1;
SQL> commit;
SQL>


The link between the database and the CDD is shown by doing a SHOW DOMAIN or SHOW TABLE in SQL:

SQL> attach 'pathname cdd$default.rdbcdd';
SQL> show domains
User domains in database with pathname SYS$COMMON:[CDDPLUS]CDD_INTEG.RDBCDD;1
F1 INTEGER
F2 CHAR(5)
F3 INTEGER
F4 CHAR(5)
SQL> show domain f1
F1 INTEGER
CDD Pathname: SYS$COMMON:[CDDPLUS]CDD_INTEG.F1;1

SQL> show table (col) r1
Information for table R1

CDD Pathname: SYS$COMMON:[CDDPLUS]CDD_INTEG.R1;1

Columns for table R1:
Column Name Data Type Domain
----------- --------- ------
F1          INTEGER   F1
F2          CHAR(5)   F2
F3          INTEGER   F3
F4          CHAR(5)   F4

SQL> exit


We see that the table and domains in the database have a connection to the record and fields in the CDD.

From the CDD viewpoint, an "integrated" database is represented by an object of type CDD$DATABASE. A CDD$DATABASE in this article means a collection of all definitions for an Rdb database. In this example, this object is called RDBCDD. The connection for the records and fields in the CDD to the Rdb database goes through the RDBCDD object. This can be seen with a SHOW USES of the fields and record in CDO. There is no direct connection to the Rdb database, instead they link to the CDD$DATABASE object RDBCDD in the CDD:

$ mc cdo
CDO> dir

Directory SYS$COMMON:[CDDPLUS]CDD_INTEG

F1(1) FIELD
F2(1) FIELD
F3(1) FIELD
F4(1) FIELD
R1(1) RECORD
RDBCDD(1) CDD$DATABASE
CDO> show uses f1
Owners of SYS$COMMON:[CDDPLUS]CDD_INTEG.F1(1)
| SYS$COMMON:[CDDPLUS]CDD_INTEG.R1(1) (Type : RECORD)
| | via CDD$DATA_AGGREGATE_CONTAINS
| RDBCDD (Type : CDD$RDB_DATABASE)
| | via CDD$RDB_DATA_ELEMENT
CDO> show uses r1
Owners of SYS$COMMON:[CDDPLUS]CDD_INTEG.R1(1)
| RDBCDD (Type : CDD$RDB_DATABASE)
| | via CDD$RDB_DATA_AGGREGATE
CDO>

 
The path from the CDD to the Rdb database root file is stored within the CDD$DATABASE object RDBCDD, as is most of the metadata for the Rdb database (there are a few items that are not yet supported within CDD). The entire contents of the CDD$DATABASE may be seen with:

$ mc cdo
CDO> set output rdbcdd.lis
CDO> show generic cdd$database/full rdbcdd


The output file contains the internal representation of the database's system metadata as well as the tables, columns, indexes, etc. There is an entry for CDD$DATABASE_FILE which contains the name of the actual Rdb database root.

Using the shorter form:

$ mc cdo
CDO> show generic cdd$database rdbcdd
Definition of RDBCDD (Type : CDD$DATABASE)
| MCS_allowConcurrent 1
| Contains CDD$DATABASE_SCHEMA
| | RDBCDD (Type : CDD$RDB_DATABASE)
| Contains CDD$DATABASE_FILE
| | RDBCDD (Type : MCS_BINARY)

CDO>


RDBCDD consists of a CDD$DATABASE_SCHEMA (which contains the database metadata, including the domains and tables and their connections to the fields and records in the CDD), and a CDD$DATABASE_FILE, of the type MCS_BINARY. To see the contents of the  CDD$DATABASE_FILE it must be "Enter"ed. Since the names of the integrated database and this CDD$DATABASE_FILE are the same (both are called RDBCDD), a separate directory must be used.

After entering, the file specification of the Rdb root file is visible, as shown below.

$ mc cdo
CDO> define directory cdd$default.fil.
CDO> set default cdd$default.fil
CDO> enter generic mcs_binary rdbcdd from generic cdd$database
cont> SYS$COMMON:[CDDPLUS]CDD_INTEG.RDBCDD
CDO> show generic mcs_binary rdbcdd
Definition of RDBCDD (Type : MCS_BINARY)
| MCS_storeType              1
| MCS_allowConcurrent        1
| MCS_storedIn               $1$DGA24:[DATABASE]RDBCDD.RDB;
| MCS_user_specified_name    rdbcdd

CDO>


If maintenance of the Rdb database metadata is to be performed by changing the definition in the CDD, followed by an INTEGRATE with ALTER FILES to update the database, the links above must all be present in both the database and the CDD.

This article describes what can be done if some (or all) of these links between the database and the CDD are lost.

Solution

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms