set feedback off
set heading off
set long 4000
SELECT DBMS_METADATA.get_ddl(‘CONSTRAINT’ ,constraint_name,owner) FROM DBA_CONSTRAINTS
WHERE owner not in (‘SYS’,’SYSTEM’,
‘SCOTT’,’DBSNMP’,’OUTLN’,’WKPROXY’,’WMSYS’,’ORDSYS’,’ORDPLUGINS’,’MDSYS’,
‘CTXSYS’,’XDB’,’ANONYMOUS’,’OWNER’,’WKSYS’,’ODM_MTR’,’ODM’,’OLAPSYS’,
‘HR’,’OE’,’PM’,’SH’,’QS_ADM’,’QS’,’QS_WS’,’QS_ES’,’QS_OS’,’QS_CBADM’,
‘QS_CB’,’QS_CS’,’PERFSTAT’)
————————————

set feedback off
set heading off
set long 4000
select dbms_metadata.get_ddl(‘CONSTRAINT’,constraint_name) FROM USER_CONSTRAINTS

Reklamlar