Re: Disable/Enable scripts?
- From: Thiru Pandian <tpandian@xxxxxxxxx>
- To: bunjibry@xxxxxxxxx
- Date: Thu, 23 Dec 2004 21:15:00 -0500
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
- References:
- Disable/Enable scripts?
- From: Bryan Wells
Other related posts:
- » Disable/Enable scripts?
- » RE: Disable/Enable scripts?
- » RE: Disable/Enable scripts?
- » RE: Disable/Enable scripts?
- » RE: Disable/Enable scripts?
- » Re: Disable/Enable scripts?
- Disable/Enable scripts?
- From: Bryan Wells