<< Click to Display Table of Contents >>

Generating a DDL Script

Top Previous Next

Reverse DB prompts you for a user name and password. Once the database connection is established, you will see the main form, which is divided into two parts:

A series of check boxes on the left displays DDL categories. Each checked item will be included in the generation.

On the right, multiple overlapping pages, where a sheet represents one category. You can activate a page by clicking its tab or the corresponding item in the check list box.

 

The topmost Schema page contains the schema and database names and some general options:

Should the scripts include statements to create the roles granted to the schema owner?

Should the scripts define the system privileges granted to the schema owner?

Should the scripts define grants the schema owner received from other users?

Should the scripts contain a SPOOL SQL*Plus command?

Should the scripts contain empty COMMENT statements if no comment exists?

Should the scripts contain a tablespace clause? You should disable this option if you want to compare two database structures by comparing their DDL scripts.

Should the scripts contain a storage parameter clause? You should disable this option if you want to compare two database structures by comparing their DDL scripts.

Should the scripts define grants that the schema owner has made to other users?

Should the scripts contain a dbms_utility.compile_schema command?

Should sequences be set to start with the original start value, the last number used, or 1?

All other tab sheets also contain check list boxes. The selectable options vary according to the category of object.. You can enable/disable all items of a category using the left side's (category) check list box. You can then use the check list boxes of the corresponding tab on the right side to select individual objects within that category, or use a filter dialog to specify which objects should be included.

RevDDL_frmMain

There are some dependencies between different categories of objects. The utility takes this into account and automatically selects objects depending on the current object. For example, when you select a table, the utility automatically selects the indexes, constraints, comments and triggers belonging to the table.

At the bottom of the form, you can specify the output file name. Once you press the Generate button, the reverse-engineering process starts. Before you know it, it has finished its work, and you can see the results by opening the DDL script in the SQL Editor.

 

You can also generate SQL scripts in batch mode. Therefore, you have to run a command like

RevereseDB.exe  <filename>  <connectstring>

or

RevereseDB.exe  C:\Temp\Scott.SQL  SCOTT/TIGER.

 

Please don't forget to "quote" file names if including white space.

If the program runs with at least 2 parameters, error messages are redirected to a file defined by the first parameter.