DBATOOLS EXTRACT/SOURCE
Extracts source definitions from an Oracle Rdb database.
Parameters
class-name[,...]
Specifies the classes for which definitions should be extracted.
The extractions occur in the order specified. Valid classes
include:
.
Constraints
.
Domains
.
Functions or Routines
.
Indices or Indexes
.
Outlines
.
Storage_Maps
.
Tables
.
Triggers
.
Views
object-name[,...]
Specifies the objects for which definitions should be extracted.
The object names may contain OpenVMS wildcards. The ex-
tractions occur in the order specified. No occlusion occurs
i.e. if two wildcard object names are specified and some ob-
jects match both values, the definitions of those objects are
extracted twice.
Qualifiers
/CLUES=(name=value[,...])
/NOCLUES (Default)
Specifies clues to apply in generating te output. The following
table lists the clues currectly supported:
Clue Name Value and Usage
By default, /NOCLUES is assumed.
/DATABASE=database-root
Specifies the root file of the database from which definitions
should be extracted.
By default, /DATABASE=SQL$DATABASE is assumed.
By default, /NOEXCLUDE is assumed.
/LANGUAGE[=name[=option]]
Specifies the language in which the extracted definition
should be formatted. Some languages also support an addi-
tional option. Valid languages include:
Language Ooption Usage
By default, /LANGUAGE=SQL=CREATE is assumed.
/ORDER_BY={NAME | POSITION}
Specifies which order columns are listed in when the order
doesn't affect the functionality of the result.
Using /ORDER_BY=NAME indicates that columns are listed
in alphabetic order. This formt is useful when comparing the
meta-data of two databses.
Using /ORDER_BY=POSITION indicates that columns are
listed in the order in which they are stored. This is useful
when dealing the meta-data related to unloaded data (i.e.
extracted using the RMU/UNLOAD command.
By default, /ORDER_BY=NAME is assumed.
/OUTPUT[=output-file-spec]
/NOOUTPUT
Specifies the output file specification for the command.
By default, /OUTPUT=SYS$OUTPUT is assumed. The
/NOOUTPUT qualifier means that no output will be pro-
duced by the command.
/PREFIX=value
/NOPREFIX
Specifies a prefix to be used for certain names such as the
source file name for a database object.
By default, the current context application code is used.
By default, /NOSEPARATE is assumed which indicates that
all definitions are placed in a single output file.
Using /SEPARATE=CLASSES indicates that a separate out-
put file is created for each class. All the object definitions for
that class are placed in a single output file.
Using /SEPARATE=OBJECTS indicates that a separate
output file is created for each object definition.
/TRANSACTION=(option[,...])
/NOTRANSACTION (Default)
Specifies whether set transaction and commit work statements
should be included in the output. This qualifier is only valid if
/LANGUAGE=SQL is specified or implied.
The valid options include:
The set transaction statement should use
batch update mode.
OBJECT A transaction should be placed around
each object based statement. This is
particularly useful for database objects
such as indices which can cause large
operations to be performed.
READ_ONLY The set transaction statement should use
read only mode.
READ_WRITE The set transaction statement should use
read write mode.
SOURCE A transaction should be placed at the be-
ginning of and the end of each generated
source. This is particularly useful for
database meta-data definitions.
Examples
1.
$ DBATOOLS EXTRACT/SOURCE TABLES
Extracts the definitions for all tables in the current default
database.
2.
$ DBATOOLS EXTRACT/FUNCTION *DATE*/DATABASE=FIN_RDB_DIR:FIN_DATABASE
Extracts the definitions for functions containing DATE
within their name from the indicated database in the FIN
application.
3.
$ DBATOOLS EXTRACT/SOURCE INDEX DDAL$* -
_$ /CLUE=(-
_$ NODE_SIZE=990,-
_$ PERCENT_FILL=100,-
_$ STORE="in ddal_indices")-
_$ /DATABASE=FIN_RUNTIME_DATABASE-
_$ /LANGUAGE=SQL=CREATE-
_$ /OUTPUT=FIN_RUN_DIR:FIN_DATABASE_CREATE_DDAL_INDICES.SQL-
_$ /TRANSACTION=(BATCH_UPDATE,OBJECT)
Extracts SQL create index statements for indices start-
ing with DDAL$ in the FIN database. The following is a
fragment of the resultant output file:
.
.
.
set transaction batch update;
create unique index DDAL$DBKEY_INDEX9_1
on CUSTOMER_DETAILS (
DDAL$DBKEY asc )
type is sorted
node size 990
percent fill 100
disable compression
store in ddal_indices;
commit work;
.
.
.