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

Thread: Triggers

  1. #1
    Join Date
    Apr 2001
    Posts
    55

    Question

    anyone know what kind of script I can run in through SQL plus to compile all triggers within a database. I know how to compile a trigger individually 'ALTER TRIGGER XXX COMPILE' however I need an esay way to compile over 300 triggers. any ideas?????

  2. #2
    Join Date
    Apr 2001
    Location
    West Sussex, England
    Posts
    15
    try this :

    set heading off
    set pagesize 0
    set feedback off

    spool xyz.sql

    select 'alter trigger '||trigger_name||' compile;'
    from user_triggers;

    spool off

    @xyz.sql

  3. #3
    Join Date
    May 2001
    Location
    San Francisco, California
    Posts
    511
    Try this:

    set heading off;
    set feedback on;
    set pages 10000;

    spool &&spoolfile

    select 'alter '||object_type, object_name
    ||' compile;'
    from user_objects
    where object_type = 'TRIGGER'

    spool off

    @&&spoolfile;

    host del &&spoolfile;

    undefine spoolfile;

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