RE: Cannot Disable Constraints

  • From: <Joel.Patterson@xxxxxxxxxxx>
  • To: <dofreeman@xxxxxxxxxxx>, <oracle-l@xxxxxxxxxxxxx>
  • Date: Thu, 12 Apr 2007 15:35:34 -0400

You can user '%'  (excerpt from script).

 

Assuming one schema owns everything.    ... send ORA error #

 

select 'ALTER TABLE ' || table_name      || ' DISABLE CONSTRAINT ' ||

                         constraint_name || ';'

  from USER_CONSTRAINTS

 where table_name like UPPER('&Tbl') and

       constraint_type = 'R'

 order by table_name, constraint_name;

 

Joel Patterson 
Database Administrator 
joel.patterson@xxxxxxxxxxx 
x72546 
904  727-2546 

________________________________

From: oracle-l-bounce@xxxxxxxxxxxxx
[mailto:oracle-l-bounce@xxxxxxxxxxxxx] On Behalf Of Freeman, Donald
Sent: Thursday, April 12, 2007 2:17 PM
To: oracle-l@xxxxxxxxxxxxx
Subject: Cannot Disable Constraints

 

We are having a problem with one of our development databases and have
been working on this thing since 8 this morning.   We are trying to
refresh code tables, which we do all the time, and are getting
constraint violation errors.   I can't think of anything that has
changed on this database.

We spin through the schema, disable constraints on the code tables,
truncate the tables, import new code values, and reenable the
constraints.

After we disable the constraints we find that we cannot truncate about
ten tables and get a constraint violation error.   All the constraints
appear to be disabled.   I cannot figure this out.  We have to move
ahead and are going to drop the whole schema and reimport the whole
thing.   What could cause this problem?   I know we are missing
something but I'm not sure what.    We are out of ideas for now.

Other related posts: