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

Thread: ORATAB - automatic start of oracle

  1. #1
    Join Date
    Jan 2004
    Location
    Washington , USA
    Posts
    132

    ORATAB - automatic start of oracle

    How do I get Oracle to automatically start when my server boots up?

    I have added this entry in oratab file , but still it is not getting started whenever the server boots up. do i need to change in any other file or do i am missing something.

    # $ORACLE_SID:$ORACLE_HOME:[N|Y]
    #
    ORCL:/u01/app/oracle/product/8.1.7:Y

    thanks in advance
    Gajanan

  2. #2
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,334
    you dont mention os, ill guess solaris.

    You do have entries in /etc/rcX.d pointing to ORACLE_HOME/bin/dbstart dont you?

    I am guessing you dont

  3. #3
    Join Date
    Jan 2004
    Location
    Washington , USA
    Posts
    132
    The OS is linux Red Hat advance server

  4. #4
    Join Date
    Feb 2000
    Location
    Singapore
    Posts
    1,758
    1. Update /etc/oratab as
    Code:
    SID:ORACLE_HOME:Y
    2. Create the script /etc/init.d/dbora as...
    Code:
     #!/bin/bash
    
    #
    
    # chkconfig: 35 99 10
    
    # description: Starts and stops Oracle processes
    
    #
    
    # Set ORA_HOME to be equivalent to the $ORACLE_HOME
    
    # from which you wish to execute dbstart and dbshut;
    
    #
    
    # Set ORA_OWNER to the user id of the owner of the
    
    # Oracle database in ORA_HOME.
    
    #
    
    ORA_HOME=
    
    ORA_OWNER=
    
    case "$1" in
    
    'start')
    
    # Start the Oracle databases:
    
    # The following command assumes that the oracle login
    
    # will not prompt the user for any values
    
    su - $ORA_OWNER -c $ORA_HOME/bin/dbstart
    
    # Start the TNS Listener
    
    su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start"
    
    # Start the Intelligent Agent
    
    if [ -f $ORA_HOME/bin/agentctl ]; then
    
    su - $ORA_OWNER -c "$ORA_HOME/bin/agentctl start"
    
    else
    
    su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl dbsnmp_start"
    
    fi
    
    # Start Management Server
    
    if [ -f $ORA_HOME/bin/oemctl ]; then
    
    su - $ORA_OWNER -c "$ORA_HOME/bin/oemctl start oms"
    
    fi
    
    # Start HTTP Server
    
    if [ -f $ORA_HOME/Apache/Apache/bin/apachectl ]; then
    
    su - $ORA_OWNER -c "$ORA_HOME/Apache/Apache/bin/apachectl start"
    
    fi
    
    touch /var/lock/subsys/dbora
    
    ;;
    
    'stop')
    
    # Stop HTTP Server
    
    if [ -f $ORA_HOME/Apache/Apache/bin/apachectl ]; then
    
    su - $ORA_OWNER -c "$ORA_HOME/Apache/Apache/bin/apachectl stop"
    
    fi
    
    # Stop Management Server
    
    if [ -f $ORA_HOME/bin/oemctl ]; then
    
    su - $ORA_OWNER -c "$ORA_HOME/bin/oemctl stop oms sysman/"
    
    fi
    
    # Stop the Intelligent Agent
    
    if [ -f $ORA_HOME/bin/agentctl ]; then
    
    su - $ORA_OWNER -c "$ORA_HOME/bin/agentctl stop"
    
    else
    
    su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl dbsnmp_stop"
    
    fi
    
    # Stop the TNS Listener
    
    su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop"
    
    # Stop the Oracle databases:
    
    # The following command assumes that the oracle login
    
    # will not prompt the user for any values
    
    su - $ORA_OWNER -c $ORA_HOME/bin/dbshut
    
    rm -f /var/lock/subsys/dbora
    
    ;;
    
    esac
    
    # End of script dbora
    3. Set permission to 755 for /etc/ini.d/dbora

    4. Register the Service

    /sbin/chkconfig --add dbora
    Sanjay G.
    Oracle Certified Professional 8i, 9i.

    "The degree of normality in a database is inversely proportional to that of its DBA"

  5. #5
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,334
    i suggest changing dbshut to be shutdown immediate as well, it is currently just shutdown up to 9iR2

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