Forum Stats

  • 3,734,273 Users
  • 2,246,935 Discussions
  • 7,857,216 Comments

Discussions

Auto run sql script when DB opens

651550
651550 Member Posts: 6
edited Sep 10, 2008 10:39AM in General Database Discussions
Is it possible to configure a DB so a given SQL script is run each time the database opens?

Thanks a lot in advance.
Tagged:

Best Answer

  • 595286
    595286 Member Posts: 243
    Accepted Answer
    You can create an after startup trigger to run PL/SQL

    Is it ok for you or do you really need to call a script stored on disk ?

    http://download.oracle.com/docs/cd/B28359_01/server.111/b28318/triggers.htm#i6061

Answers

  • 595286
    595286 Member Posts: 243
    Accepted Answer
    You can create an after startup trigger to run PL/SQL

    Is it ok for you or do you really need to call a script stored on disk ?

    http://download.oracle.com/docs/cd/B28359_01/server.111/b28318/triggers.htm#i6061
  • 347756
    347756 Member Posts: 130
    The trigger on system startup is a way of doing this. If you use the dbstartup and dbshutdown scripts, you could add a line in the script to execute your startup script.
    347756
  • Niall Litchfield
    Niall Litchfield Member Posts: 976 Bronze Badge
    rafadc wrote:
    Is it possible to configure a DB so a given SQL script is run each time the database opens?

    Thanks a lot in advance.
    Either include the script in a startup script for the database, dbstart on *nix you'd need to write your own on windows, or else move the code into a startup trigger.

    Niall Litchfield
    http://www.orawin.info/
    Niall Litchfield
This discussion has been closed.