DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Disabling Constraints

  1. #1
    Join Date
    Jul 2001
    Posts
    181

    Disabling Constraints

    Hi,

    What is the bets way to disable all fk's and triggers within a given schema!

    Cheers

  2. #2
    Join Date
    Jan 2002
    Location
    Up s**t creek
    Posts
    1,525
    Spool the output from this script and run it against your schema to disable the constraints

    Code:
    SELECT 
      'ALTER TABLE '|| table_name 
      || ' DISABLE CONSTRAINT ' || constraint_name || ' ;'
    FROM user_constraints
    WHERE constraint_type = 'R'
    To disable the triggers

    Code:
    SELECT
      'ALTER TRIGGER '||trigger_name||' DISABLE;'
    FROM user_triggers
    HTH
    Last edited by jovery; 08-21-2003 at 04:59 AM.
    Jim
    Oracle Certified Professional
    "Build your reputation by helping other people build theirs."

    "Sarcasm may be the lowest form of wit but its still funny"

    Click HERE to vist my website!

  3. #3
    Join Date
    Jul 2001
    Posts
    181
    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width