set pagesize
set long 100000
select dbms_metadata.get_ddl('TABLESPACE','SYSTEM') from dual;
set pagesize 0
set long 90000
SELECT DBMS_METADATA.GET_DDL('INDEX','X_ALLTRNLOG_ID') FROM dual;
set long 20000
column ddl format a1000
exec dbms_metadata.set_transform_param (dbms_metadata.session_transform, 'SQLTERMINATOR', true);
select DBMS_METADATA.GET_DDL('SYNONYM',synonym_name,owner) ddl from dba_synonyms
where table_owner like '%APP_ADMIN%'
;
set pagesize 0
set long 90000
SELECT DBMS_METADATA.GET_DDL('PACKAGE','PK_OS_CALLS') FROM dual;
SELECT DBMS_METADATA.GET_DDL('PACKAGE',object_name) FROM user_objects WHERE object_type = 'PACKAGE';
set pagesize 0
set long 90000
SELECT DBMS_METADATA.GET_DDL('PACKAGE_BODY','PK_CRACKER_BOX') FROM dual;
set pagesize 0
set long 90000
-- table_name
SELECT DBMS_METADATA.GET_DDL('TABLE','MERCHANT_MACHINES') FROM dual;
-- table_name, owner
SELECT DBMS_METADATA.GET_DDL('TABLE','MERCHANT_MACHINES','APPADMIN') FROM dual;
-- user
set long 10000
SELECT DBMS_METADATA.GET_DDL('USER','JOHNSON') FROM dual;
set pagesize 0
set long 90000
SELECT DBMS_METADATA.GET_DDL('VIEW','V_INSTANCE') FROM dual;
set pagesize 0
set long 90000
SELECT DBMS_METADATA.GET_DDL('PACKAGE','PK_OS_CALLS') FROM dual;
SELECT DBMS_METADATA.GET_DDL('PACKAGE',object_name) FROM user_objects WHERE object_type = 'PACKAGE';
PACKAGE
PACKAGE_SPEC
PACKAGE_BODY
set pagesize 0
set long 90000
SELECT DBMS_METADATA.GET_DDL('PROCEDURE','P_SECURITY_IW') FROM dual;
/*
OBJECT TYPES
------------
ASSOCIATION
AUDIT
AUDIT_OBJ
CLUSTER
COMMENT
CONSTRAINT
CONTEXT
DB_LINK
DEFAULT_ROLE
DIMENSION
DIRECTORY
FUNCTION
INDEX
INDEXTYPE
JAVA_SOURCE
LIBRARY
MATERIALIZED_VIEW
MATERIALIZED_VIEW_LOG
OBJECT_GRANT
OPERATOR
OUTLINE
PACKAGE
PACKAGE_SPEC
PACKAGE_BODY
PROCEDURE
PROFILE
PROXY
REF_CONSTRAINT
ROLE
ROLE_GRANT
ROLLBACK_SEGMENT
SEQUENCE
SYNONYM
SYSTEM_GRANT
TABLE
TABLESPACE
TABLESPACE_QUOTA
TRIGGER
TRUSTED_DB_LINK
TYPE
TYPE_SPEC
TYPE_BODY
USER
VIEW
*/
|