Previous Topic: Catalog a DATABASE StructureNext Topic: Delete Structures


Copy Structures

In the DBMAINT Mode, use the COPY function to replicate a structure or substructure in another status. CA Datacom Datadictionary creates a new structure or substructure in the target status. You can use this function to create a PRODUCTION structure or a new TEST structure from an existing TEST structure.

You can use the COPY function with DATABASE, AREA, TABLE, and DATAVIEW occurrences. KEY and ELEMENT occurrences are replicated with the TABLE substructure.

Note: To copy a structure to TEST status from a HIST or PROD status, use the RESTORE function. For more information, see RESTORE.

To copy an occurrence in the same status with a different occurrence name, enter the name of the existing occurrence in the LIKE field on the ADD or CREATE panels. For more information, see Add Structures.

Important! We recommend that you restore the structure or substructure from PROD status immediately before you change it to avoid any loss of information.

How It Works

When you use this function to create a PROD structure from an existing TEST structure:

Relationships

If the structure contains relationships with occurrences outside the structure, the relationships may not be copied with the structure or substructure. The copy-rule specified for the relationship determines whether the relationship is copied. For more information, about relationship copy-rules, see the CA Datacom Datadictionary User Guide.

Constraints

Constraints are copied with the TABLE, AREA, or DATABASE entity-occurrence to which they are connected.

If you copy a TEST version to PROD status and get either a CON or ALT DSF return code during the copy, restore the PROD status to TEST. Make the changes, and then copy the occurrence to PROD status; or make the changes to PROD status through SQL.

When you execute an SQL ALTER TABLE statement against a table that has a CONSTRAINT attribute-value of Y, CA Datacom Datadictionary sets the CONSTRAINT attribute to A on all TEST and HIST versions of that table. If you later attempt to copy one of these versions (or a structure containing one of these versions) to PROD status, CA Datacom Datadictionary prevents the copy, issues an error message, and identifies the table which has been altered. For more information and instructions, see Maintaining Tables with Related Constraints.

How to Use

Use one of the following procedures to perform this function:

When you select the COPY function on the DB Structure Functions Menu, you receive a prompter panel similar to the following example. Press Enter after completing your entries.

=> => => 1-DDOL000196A - CMPP - PLEASE COMPLETE REQUIRED INFORMATION FOR COMMAND ------------------------------------------------------------------------------- DATACOM/DB Structure Maintenance TMCF COPY DATABASE ________________________________ from STATUS ____ TO STATUS ____ COP BAS (name) STAT (stat) STAT (stat) with PASSWORD using OVERRIDE ____ PSWD (pswd) OVRD (ovrd) PF1=HELP PF2=END PF3=CLARIFY PF4=PROCESS PF5=MENU PF6=STATUS PF7=SCB PF8=SCF PF9=APPLY PF10=PATH PF11=NEXT PF12=INPUT

The following list describes each field, the valid entries and the default (if one exists). Fields that require an entry are highlighted on your terminal. Fields which are not highlighted indicate that an entry is optional.

(name)

(Required) Specify the name of the occurrence copied.

Valid Entries:

1- to 32-character occurrence name

Default Value:

(No default)

from STAT

(Required) Specify the status of the existing occurrence.

Valid Entries:

T001—T999

Default Value:

(No default)

TO STAT

(Required) Specify the status to which you are copying the occurrence.

Valid Entries:

T001—T999
PROD

Default Value:

(No default)

(pswd)

Only required if this occurrence has protection against unauthorized maintenance with a password assignment. Supply the password for this occurrence.

Valid Entries:

1- to 4-character password

Default Value:

(No default)

(ovrd)

Only required if this occurrence is restricted from unauthorized maintenance or retrieval with a lock level assignment. Supply the override code.

Valid Entries:

1- to 4-character override code

Default Value:

(No default)