Results 1 to 7 of 7
  1. #1
    Join Date
    Dec 2003
    Posts
    47

    Question Unanswered: Excute a sqlscript when database startup

    I have an sqlscript, and I want to execute it when database startup. How can I do ? And I also want to create a procedure and execute like that. Pleae show me how. Thanks a lot

  2. #2
    Join Date
    Jul 2002
    Location
    Beijing . China
    Posts
    9
    Try to create a trigger , system-level trigger.

  3. #3
    Join Date
    Aug 2003
    Location
    Guwahati, India
    Posts
    33

    Re: Excute a sqlscript when database startup

    Hi,

    You must have oracle 8i or later to get system level trigger get going. There are a lot level of triggers. Please go through those. Please refer to PL/SQL guide in otn.oracle.com for details. If you don't have an otn account, create a free otn account.
    G J Shankar Nath
    IT Consultant, Vedswasti Services Pvt. Ltd
    Guwahati-781007
    India

  4. #4
    Join Date
    Dec 2003
    Location
    South Africa
    Posts
    4

    Re: Excute a sqlscript when database startup

    You can also edit the dbstop & dbstart scripts in the $ORACLE_HOME/bin directory. The only downside to this is that you *MUST* use the dbstop & dbstart script to stop & start the database(s). The upside is that should you NOT want to execute the scripts you start the database via sqlplus/svrmgrl (8i =<).

  5. #5
    Join Date
    Dec 2003
    Posts
    47
    Thank you for answering me.
    I really have a problem, this is:
    When my database startup, I receive some errors in alert file:
    ORA-12012: error on auto execute 0f job 2
    ORA-29540: class ttk does not exist
    ORA-06512: at "SR.LISTFNAME", line 0 . . .
    This server is installed by copying files from another server, I don't know much about it. So I want to fix this problem. I tried query from DBA_TRIGGERS to find out if there is any triggers executed when database is startup, but there isn't. What can I do next ?

  6. #6
    Join Date
    Dec 2003
    Location
    South Africa
    Posts
    4
    The 1st error ORA-12012 refers to database jobs, I suggest the you set the JOB_QUEUE_PROCESSES=0 in your init.ora file. This will prevent all database jobs from running. This should at least get your database up and running.

    The 2nd & 3rd errors ORA-29540 & ORA-06512 tell you why the job failed. You also mentioned that the server files were copied, that's probaby why you get the errors, the 2nd error tell you that the ttk java class is missing. So you have to locate the ttk java class on the old server and copy all the directories and files exactly to the new server.

    I hope this helps

  7. #7
    Join Date
    Dec 2003
    Posts
    47
    I have checked database init file: JOB_QUEUE_PROCESSES=4
    I can't copy java class again because they only gave me those files, no more support.
    Can I tell Oracle not run that class ?
    I intend to export data and import exported file into my own database but I don't know what sqlscript to run after create my database to ensure every procedures will work well. How can I get information about those from their database ? What information I must set to make my database like their database ?
    Last edited by fire2fire; 12-30-03 at 22:13.

Posting Permissions

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