Obtain DDL scripts for oracle schema objects

Background:

During the application development phase and more often the DDL needs to be backed up for the schema objects in .SQL format which supports the readability and recover or portability of the objects creation later on when needed. This could be easily done by the oracle data pump utility.

Workaround:

Step1: First make the export dump for the intended schema for the metadata only.

$ expdp system schemas = test directory = data_pump_dir dumpfile = test_ddl_25112020.dmp logfile = test_ddl_25112020.log content = metadata_only

Step2: Import the contents of the dump file to a .sql file by the IMPDP. The parameter sqlfile provide the transfer of dump file contents to SQL format.

$ impdp system directory = data_pump_dir dumpfile = test_ddl_25112020.dmp sqlfile = test_ddl_25112020.sql

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.