DLM Chapter 12: DMDDBE Definition Database Extract

advertisement
Chapter 12
DMDDBE
Definition Database Extract
DMDDBE Definition Database Extract  497
DMDDBE
Purpose:
The DMDDBE utility can be used to extract all or a portion of a Definition Database that
can be used as a source statement file ready for input to DMDBA. The statements appear
in a predetermined order, and duplicate objects are omitted. With the statements the
Definition Database can be recreated.
Operating Systems:
All
Syntax:
Windows, UNIX, VMS
DMDDBE UID=id UPW=pw DB=database
{ACTION=SELECT | ALL | ONE}
{INPUT=infile}
{OBJECT_NAME=object_name}
{OBJECT_TYPE=object_type}
{OUTPUT=outfile}
{PUT=putfile}
{RECORDLC=recordlc}
{RECORDTYPE=VAR | FIX}
{VF=vocfile}
498  DMDDBE Definition Database Extract
Parameters:
For instructions about entering parameters on various operating systems, see Tables 1-1
and 11-1.
Required Parameters:
UID=id
(Required)
See Table 11-2.
UPW=pw
(Required)
See Table 11-2.
DB=database
(Required)
See Table 11-2.
Optional Parameters:
ACTION=SELECT | ALL | ONE
(Optional)
Specifies the method for extracting objects from the DDB. The default is SELECT.
SELECT
Lets you interactively choose which object(s) to extract.
DMDDBE prompts for object types and, if necessary, object
names to extract until you enter an EXIT command.
ALL
Extracts all of the objects in the database, creating a complete
source file for the database.
ONE
Extracts one object type from the database. If you do not
enter the OBJECT_TYPE parameter, DMDDBE prompts for
object type. If you do not enter the OBJECT_NAME
parameter and the object type requires an object name,
DMDDBE prompts for it.
DMDDBE Definition Database Extract  499
INPUT=infile
(Optional)
See Tables 11-2 and 11-3.
OBJECT_NAME=object_name
(For Windows, UNIX, and VMS, Optional)
OBJECT_TYPE=object_type
(For Windows, UNIX, and VMS, Optional)
OUTPUT=outfile
(Optional)
See Tables 11-2 and 11-3.
PUT=putfile
(Optional)
File that will contain the source statements created by DMDDBE. Each execution of
DMDDBE creates a new PUT file.
For
the default is
UNIX
dmddbe.put
VMS
DMDDBE.PUT
RECORDLC=recordlc
(Optional)
Maximum length in characters of a record in the PUT file. The maximum length of a
record in the PUT file is 80 characters. The default is 80 characters.
VF=vocfile
(Optional)
See Tables 11-2 and 11-3.
Description:
You can use DMDDBE to produce source statement files (PUT files) that you can print to
show various components of your database. You can edit the source statement files using
your host system editor. You can then use DMDBA to receive and compile source
statement files from one database to become the part of the definition for another
database.
The following table describes what can be extracted from the Definition Database and the
object types and object names used to extract them.
500  DMDDBE Definition Database Extract
Table 12-1: DMDDBE object types and object names
To extract the following from the
Definition Database . . .
Enter the following
keyword for Object
Type . . .
And enter the appropriate
value for Object Name . . .
Entire Actual Data Model description:
WORD_LIST, CODE_LIST, RECORD
and fields, ASSERT, DOMAIN,
PARAMETER_SET, ADM FIELD_LIST,
THESAURUS_DATA_CONTROL set,
SEARCH_CONTROL set, REVL
statements
ADM_ALL
none required
Entire Actual Data Model,
Structural Data Model, and
User Data Model descriptions
ALL
none required
ASSERT
ASSERT
assert_number:assert_number
assert_number
* (all assertions)
CODE_LIST
CODE_LIST
code_list_name
stem*
* (all code lists)
DOMAIN
DOMAIN
domain_name
stem*
* (all domains)
DMDDBE Definition Database Extract  501
To extract the following from the
Definition Database . . .
Enter the following
keyword for Object
Type . . .
And enter the appropriate
value for Object Name . . .
FIELD_LIST, MODEL (if UDM field list)
FIELD_LIST
ADM.record_name.field_list
ADM.record_name.stem*
ADM.record_name.*
ADM.stem*
ADM.*
model_name.view_name.field_l
ist
model_name.view_name.stem*
model_name.view_name.*
model_name.stem*
model_name.*
stem*
* (all ADM and UDM field
lists)
All Structural Data Model file descriptions:
FILE, JOURNAL, AREA,
DEFINITION_DATABASE,
BACKUP_SET, DDB_JOURNALS
FILES_ALL
none required
INDEX
INDEX
record_name.index_name
record_name.stem*
record_name.*
stem*
* (all indexes)
Some User Data Model descriptions:
MODEL, PROGRAM, VIEW and fields,
UDM FIELD_LIST
MODEL_ALL
model_name
stem*
* (all models)
PARAMETER_SET
PARAMETER_
SET
parameter_set_name
stem*
* (all parameter sets)
RECORD and fields, ADM FIELD_LIST
RECORD
record_name
stem*
* (all record types)
502  DMDDBE Definition Database Extract
Complete Record descriptions:
RECORD_ALL
WORD_LIST, CODE_LIST, ASSERT,
DOMAIN, PARAMETER_SET, RECORD
and fields, VIEW and fields, FIELD_LIST,
INDEX, RECORD_STORAGE,
THESAURUS_DATA_CONTROL set,
SEARCH_CONTROL set, REVL
statements
record_name
stem*
* (all record types)
REVL statements
REVL
record_name
stem*
* (all REVL definitions)
Entire Structural Data Model description:
INDEX, RECORD_STORAGE, AREA,
FILE, JOURNAL, BACKUP_SET,
DEFINITION DATABASE, DDB
JOURNALS
SDM_ALL
none required
SEARCH_CONTROL set
SEARCH_
CONTROL
set_name
stem*
* (all search control sets)
THESAURUS_DATA_CONTROL set
THESAURUS_
DATA_
CONTROL
set_name
stem*
* (all thesaurus data control
sets)
All User Data Model descriptions:
MODEL, PROGRAM, VIEW and fields,
UDM FIELD_LIST
UDM_ALL
none required
MODEL, PROGRAM, VIEW and fields,
UDM FIELD_LIST
VIEW
model_name.view_name
model_name.stem*
model_name.*
stem*.view_name
stem*
*.view_name
* (all models, all view types)
WORD_LIST
WORD_LIST
word_list_name
stem*
* (all word lists)
DMDDBE Definition Database Extract  503
For examples of extracted source statement files, see Database Definition and
Development, “TOUR Demo Database Definition.”
Key Point:

If an object type has pending change orders that add something—for example, add a
new RECORD or add a REVL statement—those additions are extracted with the
object type. If an object type has pending change orders that change something,
those changes are not extracted with the object type.
1.
Suppose you had a record type in one database that you wanted to use with slight
revisions in another database. Use DMDDBE to extract the record definition. You
can edit the source statement file as you wish and create a record definition for the
other database by running DMDBA with ACTION=UPDATE. In this example,
DMDDBE uses the default values and it prompts for object type.
Examples:
DMDDBE
. . .
user id> id
user pw> pw
database> TOUR
Enter type of object you wish to have extracted.
Type EXIT to leave DMDDBE
object type> RECORD EMPLOYEE
object type> EXIT
Performing extraction
*
*
NORMAL TERMINATION - DMDDBE
2.
Extract only the EMPLOYEE record type.
DMDDBE UID=id UPW=pw DB=TOUR ACTION=ONE +
OBJECT_TYPE=RECORD OBJECT_NAME=EMPLOYEE
. . .
Performing extraction
*
*
NORMAL TERMINATION - DMDDBE
504  DMDDBE Definition Database Extract
3.
Suppose you have a number of “generic” code lists (state abbreviations, for example)
in your database that could also be used in another database. Extract all code lists so
you can easily load them into another database. Use DMDDBE to extract all the
code lists from the TOUR Definition Database and put them into a PUT file.
The INPUT file, which will supply the missing parameters, contains the following
four lines:
pw
TOUR
CODE_LIST *
EXIT
The DMDDBE command line and output displayed follow.
DMDDBE UID=id PUT=CODE.DDL INPUT=CODE.INP
. . .
user pw>
database>
Enter type of object you wish to have extracted
Type EXIT to leave DMDDBE
object type> CODE_LIST *
object type> EXIT
Performing extraction
NORMAL TERMINATION - DMDDBE
4.
Extract the entire TOUR Definition Database and put it into a PUT file. Send any
error messages to the OUTPUT file.
DMDDBE UID=id UPW=pw DB=TOUR ACTION=ALL +
OUTPUT=ERROR.DMP PUT=TOUR.DDL
. . .
NORMAL TERMINATION - DMDDBE
5.
Extract all the views in the ALLC model which start with “EMP” and all the views in
the ALLF model which begin with “DEP”.
DMDDBE UID=id UPW=pw DB=TOUR
. . .
Enter type of object you wish to have extracted.
Type EXIT to leave DMDDBE
object type> VIEW ALLC.EMP*
object type> VIEW ALLF.DEP*
object type> EXIT
Performing extraction
NORMAL TERMINATION - DMDDBE
DMDDBE Definition Database Extract  505
6.
Extract all view types named “EMPLOYEE” from all models.
DMDDBE UID=id UPW=pw DB=TOUR ACTION=ONE
. . .
object type> VIEW *.EMPLOYEE
object type> EXIT
Performing extraction
NORMAL TERMINATION - DMDDBE
7.
Extract all the indexes for the EMPLOYEE record type, and all field lists referencing
the EMPLOYEE record type. The DMDDBE instructions, in a file named
EMP.INP, consist of the following three lines:
INDEX EMPLOYEE.*
FIELD_LIST ADM.EMPLOYEE.*
EXIT
The DMDDBE command line and interactive session follow.
DMDDBE UID=id UPW=pw DB=TOUR INPUT=EMP.INP
. . .
Enter type of object you wish to have extracted.
Type EXIT to leave DMDDBE
object type> INDEX EMPLOYEE.*
object type> FIELD_LIST ADM.EMPLOYEE.*
object type> EXIT
Performing extraction
NORMAL TERMINATION - DMDDBE
8.
Extract assertions numbered 5, 7, and 10:15 from the definition.
DMDDBE UID=id UPW=pwf DB=TOUR ACTION=SELECT
. . .
Enter type of object you wish to have extracted.
Type EXIT to leave DMDDBE
object type> ASSERT 5
object type> ASSERT 7
object type> ASSERT 10:15
object type> EXIT
Performing extraction
NORMAL TERMINATION - DMDDBE
9.
Extract all indexes for all record types beginning with the letter “P.”
DMDDBE UID=id UPW=pw DB=TOUR ACTION=ONE +
OBJECT_TYPE=INDEX OBJECT_NAME='P'
. . .
Performing extraction
NORMAL TERMINATION - DMDDBE
506  DMDDBE Definition Database Extract
10. Extract the entire Structural Data Model.
DMDDBE UID=id UPW=pw DB=TOUR ACTION=ONE +
OBJECT_TYPE=SDM_ALL
.
.
.
Performing extraction
NORMAL TERMINATION - DMDDBE
11. Extract all word lists, assertions numbered 1:5, and all code lists beginning with
“EMP.”
DMDDBE UID=id UPW=pw DB=TOUR
. . .
Enter type of object you wish to have extracted.
Type EXIT to leave DMDDBE
object type> WORD_LIST *
object type> ASSERT 1:5
object type> CODE_LIST EMP*
object type? EXIT
Performing extraction
NORMAL TERMINATION - DMDDBE
12. Extract all field listsin the ALL model.
DMDDBE UID=id UPW=pw DB=TOUR ACTION=ONE +
OBJECT_TYPE=FIELD_LIST OBJECT_NAME='ALL.*.*'
. . .
Performing extraction
NORMAL TERMINATION - DMDDBE
13. Extract all field lists in the TOUR Definition Database.
DMDDBE UID=id UPW=pw DB=TOUR
. . .
Enter type of object you wish to have extracted.
Type EXIT to leave DMDDBE
object type> FIELD_LIST *
object type> EXIT
Performing extraction
NORMAL TERMINATION - DMDDBE
14. Extract all field lists in the ALL model, in view types beginning with “EMP.” Note
that object_name is prompted for if it is not supplied.
DMDDBE UID=id UPW=pw DB=TOUR
.
.
.
Enter type of object you wish to have extracted.
Type EXIT to leave DMDDBE
object type> FIELD_LIST
object name> ALL.EMP*
object type> EXIT
Performing extraction
NORMAL TERMINATION – DMDDBE
DMDDBE Definition Database Extract  507
508  DMDDBE Definition Database Extract
Download