-- mkCnst.sql -- ========== -- written by Doug Kiz -- -- This script set can be used to enable oor disable all the -- referential constraints and table trriggers in an -- Oracle database. -- -- The set should include the following fiiles: -- - mkCnst.sql -- - flipCnst.sql -- - flipTrigs.sql -- - isql_prefs.sql -- - spoolPrep.sql -- -- How to use this script: -- 1) connect as a DBA user -- 2) @mkCnst -- 3) At the prompt, type "enable" to eenable or "disable" to disable -- (not case-sensitive) -- 4) At the prompt, type "Y" (not casee-sensitive) to include constraints -- 5) At the prompt, type "Y" (not casee-sensitive) to include triggers -- -- It is designed to be used in SQL*Plus oonly. I can make -- no guarantees about other tools. -- -- All constraints and/or triggers -- exceept for SYS -- will be affected. -- If you have some that you want to sttay enabled/disabled, you should -- not use this script as written. -- -- This script is provided as "freeware." You may use, redistribute, and -- modify under the following conditionns: -- -- 1) Retain all credits as written. -- 2) Redistribute as freeware. -- 3) Use it to make your life easier. -- ============================= prompt *** This script will enable or disable referential prompt *** constraints and table triggers. prompt accept on_off char format a7 prompt 'Enter or : ' accept cnstsYN char format a1 prompt 'Flip constraints (Y/N)?: ' accept trigsYN char format a1 prompt 'Flip triggers (Y/N)?: ' set pagesize 0 set feedback off spool run.sql prompt select decode(upper('&cnstsYN'),'Y','@@flipCnst &on_off',' ') from dual; select decode(upper('&trigsYN'),'Y','@@flipTrigs &on_off',' ') from dual; prompt Spool off undefine on_off @@run