How to take script for schema of the tables,View,Package,Type,Trigger and stored procedures of Oracle through SQL Developer tool (SQLPLUS command line interface)?
Generate DDL scripts using DBMS_METADATA.GET_DDL
First Set the SQL Developer Output Format of the Script Using Following Command.
SET SERVEROUTPUT ON SIZE UNLIMITED FORMAT WORD_WRAPPED
SET PAGESIZE 205
SET LONG 1000000
SET SQLFORMAT ANSICONSOLE
Then Write the DBMS_METADATA.GET_DDL script like this.
SELECT DBMS_METADATA.GET_DDL('<object_type','<object_name>','<object owner>') FROM DUAL;
Following example to get table structure of
Object Type : TABLE
Object Name : XX_CAT_ERROR
Object Owner: APPS
Spool is set the local Directory of the PC/Laptop to stored the Written Script locally.
Generate DDL scripts using DBMS_METADATA.GET_DDL
First Set the SQL Developer Output Format of the Script Using Following Command.
SET SERVEROUTPUT ON SIZE UNLIMITED FORMAT WORD_WRAPPED
SET PAGESIZE 205
SET LONG 1000000
SET SQLFORMAT ANSICONSOLE
Then Write the DBMS_METADATA.GET_DDL script like this.
SELECT DBMS_METADATA.GET_DDL('<object_type','<object_name>','<object owner>') FROM DUAL;
Following example to get table structure of
Object Type : TABLE
Object Name : XX_CAT_ERROR
Object Owner: APPS
Spool is set the local Directory of the PC/Laptop to stored the Written Script locally.
spool
C:\DANISH\TABLE\XX_CAT_ERROR.sql; select dbms_metadata.get_ddl('TABLE','XX_CAT_ERROR','APPS')XX_CAT_ERROR from dual; Following example to get Synonym structure of
Following example to get Package structure of
|
No comments:
Post a Comment