Source Code Scripts

SCRIPTS TO GENERATE SOURCE CODE

Note: Save the script file with .SQL extension - the default extension while saving is .TXT

 
Script Name

cr_index.sql

Purpose Index creation script generated based on the base table owner and name passed in as parameter. Wild character may be used (%) in the paramter list. Screen output saved at /tmp/crindex.sql
Parameters 1. Table Owner (Wild character % may be used)
2. Table Name (Wild character % may be used)
Command Line SQL> @cr_index tableowner tablename
View Script
 
Script Name

cr_role.sql

Purpose Role creation script generated based on the role name passed in as parameter. Wild characters may be used (%) in the parameter list. Screen output saved at /tmp/crrole.sql
Parameters 1. Role Name (Wild character % may be used)
Command Line SQL> @cr_role rolename
View Script
 
Script Name

cr_table.sql

Purpose Table creation script generated based on the table name passed in as parameter. Wild characters may be used (%) in the parameter list. Screen output saved at /tmp/crtable.sql
Parameters
1. Table Owner (Wild character % may be used)
2. Table Name (Wild character % may be used)
Command Line SQL> @cr_table tableowner tablename
View Script
 
Script Name

cr_trig.sql

Purpose Trigger creation script generated based on the trigger name passed in as paramter. Wild characters may be used (%) in the parameter list. Screen output saved at /tmp/crtrig.sql
Parameters
1. Trigger Owner (Wild character % may be used)
2. Trigger Name (Wild character % may be used)
Command Line SQL> @cr_trig triggerowner triggername
View Script
 
Script Name

cr_view.sql

Purpose View creation script generated based on the view name passed in as paramter. Wild characters may be used (%) in the parameter list. Screen output saved at /tmp/crview.sql
Parameters
1. View Owner (Wild character % may be used)
2. View Name (Wild character % may be used)
Command Line SQL> @cr_view viewowner viewname
View Script
 
GENSQL - The ultimate package in generating source code to duplicate the Oracle7 database structure
Gensql is a package comprising of various procedures to generate the source code to create objects in the database. The code is generated in a user (schema) level. This is best suited for duplicating databases with a smaller size or with no data (export / import may not allow you to have control over the initial extent size!). The package is capable of generating source code for Profile, User, Role, Table, Foreign key, Primary/Unique key, Check constraint, Index, Comment, View, Synonym, Package/Procedure/Function, Trigger and Database link. The package comes with a procedure which can do all the above object code generations in one command. The online help provides the list of parameters and their default values in each procedure.

The procedure uses the Oracle database 7.3 feature of UTL_FILE to write the output. Make sure you have UTL_FILE_DIRECTORY = /output_directory_path in your init.ora file and to include this path in the script as your output destination.

Search BijooS.com Exact Match Search      
Home Oracle DBA TKMCE Alumni H1B Info Guestbook

Biju Thomas is Oracle7.3 OCP, Oracle8 OCP, 
Oracle8i OCP and Oracle9i OCA/OCP Certified DBA

Questions/Comments? Write to webmaster@bijoos.com. © The scripts, tips and articles appearing on BijooS.com cannot be reproduced elsewhere without the prior permission from the webmaster.