The below script is to Disable constraints,

 

SET PAGES 0
SET TRIMSPOOL ON
SET LINES 200
set echo off
set feedb off
set trimspool on
set verify off
col stmt format a80

— ALTER TABLE WWCN.WW_SITE_PROCESS_AUDIT ENABLE CONSTRAINT WW_SITE_PROCESS_AUDIT_CHECK1;

define schemaowner=&1

SPOOL tmp_disable_fk_cons.sql

select ‘alter table ‘||owner||’.’||table_name||
‘ disable constraint ‘||constraint_name||’;’
from dba_constraints
WHERE OWNER = upper(‘&schemaowner’)
and constraint_type IN (‘R’)
and STATUS =’ENABLED’
and table_name not like ‘BIN$%’
ORDER BY 1;

SPOOL OFF

set echo on
set feedb on
prompt @tmp_disable_fk_cons.sql
@tmp_disable_fk_cons.sql

undefine schemaowner

 

Recent Posts

Start typing and press Enter to search