Search

Get DDL for Oracle object

set feed off

set long 1000000

set longchunksize 1000000

set pages 0

set lines 32767

set trimspool on

set feed off

set wrap on

set serveroutput on format wrapped

set def off

set tab off


exec dbms_metadata.set_transform_param(dbms_metadata.session_transform, 'SQLTERMINATOR', TRUE);


select dbms_metadata.get_ddl('<TYPE>', '<NAME>', '<OWNER>') from dual;


-- Example:

select dbms_metadata.get_ddl('INDEX', 'XLA_AE_HEADERS_N1', 'XLA') from dual;

3 views0 comments

Recent Posts

See All

Cancelled scheduled concurrent requests

This SQL query returns all concurrent requests that were scheduled in the past and are not scheduled currently. It can be used for identifying scheduled requests that failed to be resubmitted. select

Foreign key constraint violation

/* This PL/SQL script checks violations of foreign key constraints Example of the tables: CREATE TABLE temp_supplier ( supplier_id numeric(10) not null, supplier_name varchar2(50) not null, contact_na

From Concurrent to Trace

-- Find running concurrent request's database session SELECT fcr.request_id, ftl.user_concurrent_program_name program_name, v.meaning phase, vs.sid, vs.serial#, v1.meaning status, fu.user_name usernam