Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Constraint Enable/Disable

Re: Constraint Enable/Disable

From: Nikunj Gupta <good_dba_at_hotmail.com>
Date: Thu, 01 Nov 2001 20:51:22 -0800
Message-ID: <F001.003BB0F6.20011101205018@fatcity.com>

Hi,
 

Hope these script will help you..
 

Disable
Constraints..
 

select 'alter table &tab disable constraint '||constraint_name||' cascade;'   from dba_constraints   where owner = upper('&owner') and   table_name = upper('&tab')
  /
 

Enable
Constraints
 

select 'alter table &tab enable constraint '||constraint_name||';'   from dba_constraints   where owner = upper('&owner') and   table_name = upper('&tab')   /

 

Try these in your test environment.. and have fun
 

Nikunj
 

------------------------------------Make a FREE long distance call from 
your PC!<A
href="">http://www.eboom.com/free/
<BLOCKQUOTE dir=ltr
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

  Sent: Thursday, November 01, 2001 08:15   PM
  Subject: Constraint Enable/Disable      

  Hi,
  Is there a way to disable all constraints, and then enable them all   again?
  Thanx
  Sujatha Received on Thu Nov 01 2001 - 22:51:22 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US