Re: Disable/Enable scripts?

this is what we use

set pagesize 0
set verify off
set trimspool on
set feed off
column file_name new_value spoolfile
select lower(substr(global_name,1,instr(global_name,'.WORLD')-1))||'_'||lower(us
er) ||'_enable_cons.sql'
 file_name from global_name;
spool &&spoolfile
select 'alter table '|| table_name || ' enable constraint ' ||'
'  || constraint_name ||';' from user_constraints
where constraint_type in ('R','U','P')
order by decode(constraint_type,'R',2,'U',1,'P',0);


to disable change the query like below and change the enable to
disable in top portion.

where constraint_type in ('R','U','P')
and status ='ENABLED'
order by decode(constraint_type,'R',0,'U',1,'P',2);



On Thu, 23 Dec 2004 11:48:52 -0700, Bryan Wells <bunjibry@xxxxxxxxx> wrote:
> All, Im looking for a script to Disable and enable constraints.  Is
> there an order?  I would think the PK would need to be enabled first
> then the FK.
> 
> Thanks for your help...
> 
> Happy Holidays!
> 
> --
> DBA Newbie
> bunjibry@xxxxxxxxx
> --
> http://www.freelists.org/webpage/oracle-l
>
--
http://www.freelists.org/webpage/oracle-l

Other related posts: