Oracle 10, cascade option for constraints?

Posted on 2007-10-16
Last Modified: 2008-01-09
Oracle 10,
I can disable a chain of constraints with the option disable cascade; but, when I try to enable the chain with enable cascade I get an error message. Do I need to use the cascade option to enable a chain of constraints?

Question by:rmtye
    LVL 73

    Expert Comment

    unfortunately there isn't a corresponding enable cascade syntax

    Author Comment

    So what do I need to do to reverse the affect of a "disable cascade" command?
    LVL 73

    Accepted Solution

    You'll have to iterate through the constraints yourself.

    You can do that by querying dba_constraints.

    If the only disabled constraints are those that were disabled by your cascade then it's pretty easy
    you can simply iterate through all STATUS != 'ENABLED' and enable them.

    If you have a mix of other constraints that are disabled then you'll have
    to build a hierarchy and filter out whichever ones don't belong.

    There's no way to tell now which ones were disabled by your cascade and which ones might have already been disabled.

    You can get a reasonable guess by checking the last_ddl_time in dba_objects though and they will likely have a times close together.  But that's all assuming no other ddl has happened.

    Good luck.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
    From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
    This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
    This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now