Friday, March 19, 2010

metadata extraction methode in Oracle Objects.

How to Extract Metadata of Objects in Oracle database.
=========================================================

set heading off
set echo off
set flush off
set pagesize 9999
set linesize 9999
set long 9999

select dbms_metadata.get_ddl('OBJECT_TYPE','OBJECT_NAME ','SCHEMA_NAME') from dual;

select dbms_metadata.get_ddl('MATERIALIZED_VIEW','TEST_MV','TEST') from dual;

select dbms_metadata.get_ddl('SYNONYM','TEST_V','TEST') from dual;
select dbms_metadata.get_ddl('VIEW','TEST_VIEW','TEST') from dual;
select dbms_metadata.get_ddl('SYNONYM','TEST_SYN','TEST') from dual;
select dbms_metadata.get_ddl('TABLE','TEST_TABLE','TEST') from dual;
select dbms_metadata.get_ddl('INDEX','TEST_INDX','TEST') from dual;

In case of date issue.
=========================
alter session set nls_date_format = 'dd-mm-rr';

and try to Extract metadata.

No comments:

Post a Comment