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

Thread: automating a database startup

  1. #1
    Join Date
    Oct 2000
    Posts
    7

    Exclamation

    I have automated the dbstart and dbstop but I need help in automating the actual initdatabase.ora file please help if you can

    mark

  2. #2
    Join Date
    Apr 2000
    Posts
    126

    Question RE: Automating a database startup

    What do mean automate the init.ora?

  3. #3
    Join Date
    Oct 2000
    Location
    Saskatoon, SK, Canada
    Posts
    3,925
    If you have put the dbstart and dbshut scripts in the /etc/init.d/dbora file then make sure that your oratab files under /var/opt/oracle/oratab have the instances set to Y. this would enable the instances to start at the time of system boot and shutdown at the time of syste shutdown. On the other hand if your want your instances to be started and shutdown at perticular times, then you could creat a shell script and put it in the cron tab. I hope that this would answer your question. In the future, pl. don't forget to include the oracle version and platform in your postings, such that it would help folks to better trouble shoot the issue.

    Good luck,
    Sam

  4. #4
    Join Date
    Oct 2000
    Posts
    7

    Exclamation

    Hi I'm sorry about forgetting that information I'm working on linux platform with red hat 6.2 and oracle 8i. I have done as you say, I have set the instance to Y but I still have to do this command to get the initSID.ora to start:

    I login as sys/oracle as sysdba

    CONNECT INTERNAL

    mark = database

    STARTUP PFILE=u01/app/oracle/admin/mark/pfile/initmark.ora;


    after this the database is working

    I want to automate it so that it does on system boot up!!


  5. #5
    Join Date
    Oct 2000
    Posts
    7

    Angry

    Yes I wish to automate the init.ora file so that it loads straight from a system boot rather than doing the startup command in an oracle instance!

  6. #6
    Join Date
    Apr 2000
    Posts
    126

    Wink

    You need to create a link for the init.ora.

    cd $ORACLE_HOME/dbs
    ln -s /u01/app/oracle/admin/mark/pfile/initmark.ora initmark.ora

  7. #7
    Join Date
    Oct 2000
    Posts
    7

    Here is my dbora file see if you can spot my problem because I can't

    #!/bin/bash
    #
    #
    #
    #
    #Setup environment for script execution
    . /home/oracle/.bash_profile

    #determine and execute action based on command line parameter

    case "$1" in
    start)
    echo "Starting Oracle database(s) listed in etc/oratab ..."
    sleep 2
    su - oracle -c "$ORACLE_HOME/bin/dbstart"
    echo "starting TNS listener ..."
    sleep 2
    su - oracle -c "$ORACLE_HOME/bin/lsnrctl start"
    touch /var/lock/subsys/dbora
    ;;
    stop)
    echo "Shutting down TNS listener ..."
    sleep 2
    su - oracle -c "$ORACLE_HOME/bin/lsnrctl stop"
    echo "Shutting down Oracle database(s) listed in /etc/oratab ..."
    sleep 2
    su - oracle -c "$ORACLE_HOME/bin/dbshut"
    rm -f /var/lock/subsys/dbora
    ;;
    status)
    ps -ax | grep -e ora_ -e tnslsnr
    ;;
    *)
    echo "Usage:dbora {start|stop|status}"
    exit 1
    esac

    exit 0

    Have a look and try and help

    Mark

  8. #8
    Join Date
    Apr 2000
    Posts
    126

    Wink automating a database startup

    When the system boots, dbstart and dbshut are called from /sbin/init.d/oracle. Take a look at this file.

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