[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1877
  • Last Modified:

Oracle 10, cascade option for constraints?

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?

Thanks
Ron
0
rmtye
Asked:
rmtye
  • 2
1 Solution
 
sdstuberCommented:
unfortunately there isn't a corresponding enable cascade syntax
0
 
rmtyeAuthor Commented:
So what do I need to do to reverse the affect of a "disable cascade" command?
0
 
sdstuberCommented:
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.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now