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: Disabling Constraints in a Schema!..??

Re: Disabling Constraints in a Schema!..??

From: Ruth Gramolini <rgramolini_at_tax.state.vt.us>
Date: Fri, 02 Mar 2001 06:00:21 -0800
Message-ID: <F001.002C2113.20010302055623@fatcity.com>

Spool the output of thie sql and then run the spooled file: select 'alter table schema_name.'||table_name||' disable constraint '||constraint_name||';'
from dba_constraints
where owner='schema_name'
and CONSTRAINT_TYPE in ('R','P','U') This line is optional.

This will disable the constraints in schema_name of choice. You can enable all of the constraints by changing disable to enable. You can change disable to drop to drop all constraints.

I got this from a lister on one of the lists. It works very well.

HTH,
Ruth
----- Original Message -----
To: "Multiple recipients of list ORACLE-L" <ORACLE-L_at_fatcity.com> Sent: Friday, March 02, 2001 3:30 AM

> Hi DBAs,
>
> We r using Oracle 8.1.6 . db.
> I would like to disable all the constraints on the Tables available
> under one schema.
> Is there any single command to do this in 8i . Any DBMS package
> available?
> Any other suggestions for doing the same??
>
> Thank You.
> Arul.
>
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Arul kumar
> INET: rakumar_at_mahindrabt.com
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Ruth Gramolini
  INET: rgramolini_at_tax.state.vt.us

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Fri Mar 02 2001 - 08:00:21 CST

Original text of this message

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