Wednesday 3 May 2017

Oracle RDBMS: Extracting the Table, Index & View Definitions (DDL) and Indexed Columns.

How to extract the table definition (DDL statement) from an Oracle database without having to go through a stack of dictionary views?

A: By calling the GET_DDL() function of metadata package DBMS_METADATA.
Syntax:
select DBMS_METADATA.GET_DDL('TABLE','<table_name>') from DUAL;

example 

select DBMS_METADATA.GET_DDL('TABLE','PO_HEADERS_ALL_556730') from DUAL;

 

copy the table script from query result and paste in new window then able to view the complete table script with index.

No comments:

Post a Comment