Here's a script that disables all foreign keys in the user's schema. In SQL*Plus, run the following script:
spool disablefk.sql select 'alter table ' || table_name || ' disable constraint ' || constraint_name || ';' from user_constraints where constraint_type = 'R'; spool off start disablefk.sql
For More Information
- What do you think about this tip? E-mail us at editor@searchDatabase.com with your feedback.
- The Best Oracle Web Links: tips, tutorials, scripts, and more.
- The Best SQL Web Links
- Have an Oracle tip to offer your fellow DBA's and developers? The best tips submitted will receive a cool prize--submit your tip today!
- Ask your technical Oracle questions--or help out your peers by answering them--in our live discussion forums.
- Check out our Ask the Experts feature: Our Oracle gurus are waiting to answer your toughest questions.