[next] [previous] [contents]

  DBATOOLS EXTRACT/SOURCE

  Extracts source definitions from an Oracle Rdb database.

  Format

  DBATOOLS EXTRACT/SOURCE class-name[,...]
                                                  [object-name[,...]]

  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



  ATTACH Include an ATTACH FILENAME state-
                              ment at the beginning of the generated
                              SQL script.
  EXIT Include an EXIT statement at the end of
                              the generated SQL script.
  NODE_SIZE An integer specifying the node size to use
                              with sorted indices.
  PERCENT_FILL An integer specifying the fill percentage
                              to use with sorted indices.
  STORE A string specifying the store clause to use
                              with indices. The cluas doesn't incluse
                              the store word eg. /CLUES=(STORE="in
                              my_area") would result in the clause
                              store in my_area to be used.
  [NO]VERIFY Include a VERIFY or NOVERIFY state-
                              ment at the beginning of the generated
                              SQL script.

  By default, /NOCLUES is assumed.

  /COMMENT="text"

  Specifies the comment to be placed in the header of each
  generated source.

  /DATABASE=database-root
  Specifies the root file of the database from which definitions
  should be extracted.

  By default, /DATABASE=SQL$DATABASE is assumed.

  /EXCLUDE=(name[,...])
  /NOEXCLUDE (Default)

  Specifies whether certain objects should be excluded.
  Standard OpenVMS wildcards are supporterd.

  By default, /NOEXCLUDE is assumed.

  /HEADER
  /NOHEADER (default)

  Specifies that a comment block is included for each generated
  object source.

  /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



  CDO Generate a CDD/Repository
                                          source which creates an equiv-
                                          alent to a database object. Valid
                                          for domains and tables only.
  SDML Generate a DECdocument source
                                          which describes a database object.
                                          Valid for domains, tables, triggers
                                          and views only.
  SQL CREATE Generate an SQL script which
                                          creates the matching database
                                          objects. This is the default lan-
                                          guage and option.
                    DROP Generate an SQL scrip which
                                          drops the matching database
                                          objects.
                    DUPLICATE Generate an SQL script whish
                                          finds duplicates for a non unique
                                          index.
  SQLMOD Generate an SQLmodule for a
                                          table or index.

  By default, /LANGUAGE=SQL=CREATE is assumed.

  /LOG
  /NOLOG (default)

  Displays the file specification of each new file created as the
  command executes.

  /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.
Note that this qualifier is ignored when extracting an index
  definition as columns in an index are always orderd by their
  position.

  /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.

  /SEPARATE={CLASSES | OBJECTS}
  /NOSEPARATE (Default)

  Specifies whether and and what points the output should be
  placed in separate files.

  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:



  Option Usage

  BATCH_
  UPDATE

                              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;
            .
            .
            .