Library

Product




Previous | Contents

2.24 RMU Extract Command

Reads and decodes Oracle Rdb metadata and reconstructs equivalent statements in Relational Database Operator (RDO) or SQL (structured query language) code for the definition of that database. These statements can either be displayed or extracted. You can use these statements to create your database again if you no longer have the RDO or SQL code that defined your database.

In addition, you can direct the RMU Extract command to produce output for the following:


Format




DESCRIPTION

The RMU Extract command decodes information and reconstructs equivalent commands in the language you select with the Language qualifier for the definition of that database.

You can extract the definitions to either a file or to SYS$OUTPUT.

The RMU Extract command extracts the following character set information:

The RMU Extract command encloses all object names in double quotation marks to preserve the uppercase and lowercase characters.


COMMAND PARAMETERS

root-file-spec

The file specification for the database root file from which you want to extract definitions. Note that you do not need to specify the file extension. If the database root file is not found, the command exits with a "file not found" error.

COMMAND QUALIFIERS

Items[=item-list]

Allows you to extract and display selected definitions. Note that each of the item names can be combined to provide shorter command lines such as the following:
$ RMU/EXTRACT/NOLOG/ITEMS=(ALL,NODATABASE) MF_PERSONNEL 

If you omit the Items qualifier from the command line or specify it without any options, the action defaults to Items=All.

The following options can be specified with the Items qualifier:

Language=lang-name

Allows you to select one of the following interfaces:

The default is Language=SQL.

The Language qualifier has no effect on the output generated by the Items=Load, Items=Unload, and Items=Verify qualifiers. This is because these qualifiers generate scripts that contain Oracle RMU commands only.

Log[=log-file]

Nolog

Enable or disables log output during execution of the RMU Extract command. The log includes the current version number of Oracle Rdb, and the values of the parameter and qualifiers. The default is Nolog. The default file extension is .log. If you specify Log without specifying a file name, output is sent to SYS$OUTPUT.

Options=options-list

This qualifier is used to change the output of the RMU Extract command. This qualifier is not applied to output created by the Items=Volume, Items=Unload, Items=Load, Items=Security, or the Items=Verify qualifier.

The following options can be specified with the Options qualifier:

Output=[out-file]

Nooutput

Names the file to which the RMU Extract command writes the data definition language (DDL) statements. The file extension defaults to .rdo, if you specify the Language=RDO qualifier; .sql, if you specify either the Language=SQL or the Language=ANSI_SQL qualifier. If you specify the Volume option only, the output file type defaults to .pdl. If you specify Load, Security, Verify, or Unload only, the output file type defaults to .com. The default is SYS$OUTPUT. If you disable the output by using the Nooutput qualifier, command scripts are not written to an output file. The Log output can be used to determine which features used by the database cannot be converted to SQL.

Table 2-10 shows the effects of the various combinations of the Language and Options qualifiers.

Table 2-10 Using Qualifiers to Determine Output Selection
Language Option Effect on Output
RDO Normal Generates RDO syntax.
Full Generates RDO syntax.
Dictionary_
References
Outputs path name references to the repository.
Nodictionary_
References
Converts path name references to the repository to RDO syntax.
Multischema Ignored by RDO.
SQL Normal Generates SQL syntax.
Full Tries to convert RDO specific features to SQL (for example, the VALID IF clause).
Dictionary_
References
Outputs path name references to the data dictionary.
Nodictionary_
References
Converts path name references to the data dictionary to SQL syntax.
Multischema Selects SQL multischema naming of objects.
ANSI_SQL Normal Generates ANSI/ISO syntax.
Full Generates ANSI/ISO SQL92 syntax supported by SQL.
Dictionary_
References
Ignored for ANSI_SQL.
Nodictionary_
References
Converts path name references to the data dictionary to SQL syntax. This is the default for ANSI_SQL.
Multischema Selects SQL multischema naming of objects.
Any Debug Annotates output where possible.
Volume_Scan Forces a true count of Tables. Only valid for Items=Volume.
Filename_Only Truncates all file specifications extracted from the database to only the file name.


USAGE NOTES


EXAMPLES

Example 1

The following command extracts these database items: COLLATING_SEQUENCES, DOMAINS, TABLES, INDEXES, STORAGE_MAPS, VIEWS, and TRIGGERS.

The All option is the default. The All or Noall option can be used in conjunction with other items to select specific output. For example, the Items=(All,Nodatabase) qualifier selects all metadata items except the physical database characteristics.

$ RMU/EXTRACT/ITEM=(ALL, NODATABASE) MF_PERSONNEL 

Example 2

The following command generates a DCL command procedure containing an RMU Load command for each table in the database:

$ RMU/EXTRACT/ITEMS=LOAD MF_PERSONNEL 

Example 3

The following command displays the protection access control list (ACL) definitions in the mf_personnel.rdb database:

$ RMU/EXTRACT/ITEMS=PROTECTIONS MF_PERSONNEL.RDB 

Example 4

The following command generates a DCL command procedure containing an RMU Unload command for each table in the database:

$ RMU/EXTRACT/ITEMS=UNLOAD MF_PERSONNEL.RDB 

Example 5

The following command displays cardinality information in a PDL-formatted file for use by Oracle Expert for Rdb:

$ RMU/EXTRACT/ITEMS=VOLUME MF_PERSONNEL.RDB 

Example 6

The following example displays index definitions:

$ RMU/EXTRACT/ITEMS=INDEXES MF_PERSONNEL 

Example 7

The following example displays domain and table definitions. Note that the Noall option could have been omitted.

$ RMU/EXTRACT/ITEMS=(NOALL,DOMAINS,TABLES) MF_PERSONNEL 

Example 8

The following example displays definitions for domains (fields) and tables (relations) that reference data dictionary path names rather than using the information contained in the Oracle Rdb system tables. In addition to the database statements, it also references the data dictionary path name stored in the database, as shown in the following example:

$ RMU/EXTRACT/LANG=SQL/ITEM=ALL/OPTION=DIC/OUTPUT=CDD_MODEL.LOG/LOG= - 
_$ CDD_EXTRACT.LOG CDD_SQL_DB 

Example 9

The following example creates a command procedure containing a script of partial RMU Verify commands or verify command partitions for the mf_personnel database. This command procedure was created with the following RMU Extract command:

$ RMU/EXTRACT/ITEM=VERIFY MF_PERSONNEL 

Example 10

The following command displays a query outline definition that was previously added to the mf_personnel database:

$ RMU/EXTRACT/ITEMS=(OUTLINES) MF_PERSONNEL 

Example 11

The following command displays the after-image journal (.aij) file configuration for mf_personnel:

$ RMU/EXTRACT/ITEMS=(ALTER_DATABASE) MF_PERSONNEL 

Example 12

The following command displays the function definitions in mf_personnel for functions previously created using SQL:

$ RMU/EXTRACT/ITEM=FUNCTION MF_PERSONNEL 

Example 13

The following command displays the table and column cardinalities based on sorted indexes:

$ RMU/EXTRACT/OPTION=COLUMN_VOLUME/ITEM=VOLUME MF_PERSONNEL 

Example 14

The following example:

SQL> -- Create interchange file, SAVED_PERS.RBR. 
SQL> -- 
SQL> EXPORT DATABASE FILENAME MF_PERSONNEL.RDB INTO SAVED_PERS.RBR; 
SQL> EXIT; 
$ ! 
$ RMU/EXTRACT/ITEM=IMPORT/OPTION=FILENAME_ONLY/OUTPUT=IMPORT_PERS.SQL - 
_$ MF_PERSONNEL 
$ DEFINE/USER RMUEXTRACT_RBR SAVED_PERS.RBR 
$ ! 
$ SQL 
SQL> @IMPORT_PERS.SQL 
SQL> set language ENGLISH; 
SQL> set default date format 'SQL92'; 
SQL> set quoting rules 'SQL92'; 
SQL> set date format DATE 001, TIME 001; 
SQL> 
SQL> -- RMU/EXTRACT for Oracle Rdb V7.0-00         1-JUL-1996 15:34:38.63 
SQL> -- 
SQL> --                         Physical Database Definition 
SQL> -- 
SQL> --------------------------------------------------------------------- 
SQL> import database from rmuextract_rbr 
cont>     filename 'MF_PERSONNEL' 
   .
   .
   .


Previous | Next | Contents



Library

Product

Copyright ©1996, Oracle Corporation All rights reserved.