We help IT Professionals succeed at work.

Disabling dependencies on a constraint

rmtye
rmtye asked
on
2,495 Views
Last Modified: 2008-01-09
Im trying to disable a constraint; but, I get an error message that dependencies exist. How do I discover what these dependencies are and how do I get rid of them?

Thanks
Ron

SQL> ALTER TABLE RT_TEST.SERVICE_LINE   MODIFY CONSTRAINT  XCL01200 DISABLE;
ALTER TABLE RT_TEST.SERVICE_LINE   MODIFY CONSTRAINT  XCL01200 DISABLE
*
ERROR at line 1:
ORA-02297: cannot disable constraint (RT_TEST.XCL01200) - dependencies exist

Comment
Watch Question

This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Mark GeerlingsDatabase Administrator
CERTIFIED EXPERT

Commented:
I started posting this earlier (before you accepted an answer) but got interrupted before I finished.

if you want to see constraints and/or dependencies before deleting them, you could use this script in SQL*plus:

undefine referenced_object;
select substr(owner,1,20) "Owner", substr(name,1,40) "Cname", type,
referenced_type "Referenced obj.", null "Delete rule", null "Status"
from all_dependencies
where referenced_name = upper('&&referenced_object')
and referenced_name <> 'STANDARD'
union
select substr(c.owner,1,20), substr(c.table_name||'.'||c.constraint_name,1,40), 'TABLE',
c.r_constraint_name, c.delete_rule, c.status
from all_constraints c
where (c.r_constraint_name,c.r_owner) in (select x.constraint_name,x.owner
from all_constraints x
where x.table_name in upper('&&referenced_object')
and x.constraint_type in ('P','U'))
order by 3,2;
undefine referenced_object;
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.