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

Thread: Database Autostart and Autostop.

  1. #1
    Join Date
    Jul 2000
    Posts
    147

    Database Autostart and Autostop.

    Any one have clear instruction how to do it? Somehow Oracle instruction is not working for me.
    I have 3 (three) db in oratab file with Y. but none of db start at startup. Do you have a working scripts and
    linking Instructions that you can shear. It would a very kind of you.

    Instructions I followed....

    http://download-east.oracle.com/docs...p.htm#CFAHAHGA

    Edit the oratab file for your platform.


    On Solaris:

    # vi /var/opt/oracle/oratab

    Then I created a file in /etc/init.d called dbora

    #! /bin/sh -x
    #
    # Change the value of ORACLE_HOME to specify the correct Oracle home
    # directory for your installation.

    ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
    #
    # Change the value of ORACLE to the login name of the
    # oracle owner at your site.
    #
    ORACLE=oracle

    PATH=${PATH}:$ORACLE_HOME/bin
    HOST=`hostname`
    PLATFORM=`uname`
    export ORACLE_HOME PATH
    #
    if [ ! "$2" = "ORA_DB" ] ; then
    if [ "$PLATFORM" = "HP-UX" ] ; then
    remsh $HOST -l $ORACLE -n "$0 $1 ORA_DB"
    exit
    else
    rsh $HOST -l $ORACLE $0 $1 ORA_DB
    exit
    fi
    fi
    #
    case $1 in
    'start')
    $ORACLE_HOME/bin/dbstart $ORACLE_HOME &
    ;;
    'stop')
    $ORACLE_HOME/bin/dbshut $ORACLE_HOME &
    ;;
    *)
    echo "usage: $0 {start|stop}"
    exit
    ;;
    esac
    #
    exit


    Then.......

    # chgrp dba dbora
    # chmod 750 dbora


    Then.....

    # ln -s /etc/init.d/dbora /etc/rc3.d/K01dbora
    # ln -s /etc/init.d/dbora /etc/rc3.d/S99dbora


    Thanks in advance.

  2. #2
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,334
    you dont say what doesnt work - try adding some debug messages in

    What OS?

    As the script runs as root, there are many things wrong with it anyway. Google for it, there are many many hits

  3. #3
    Join Date
    May 2005
    Location
    AZ, USA
    Posts
    131
    Is the startup/shutdown script called from the correct rcx.d directory? are they executable? Are they setup to executed during the startup/shutdown?

  4. #4
    Join Date
    Jul 2000
    Posts
    147
    OS - Solaris 10
    Oracle 10g R2

    ============

    Databases jsut wouldn't start. I'm thinking that maybe it could my env setup. But as you can see from the scripts that there is ORACLE_HOME and SID setup ( I change it according to my .profile ).



    # chgrp dba dbora
    # chmod 750 dbora

    Then.....

    # ln -s /etc/init.d/dbora /etc/rc3.d/K01dbora
    # ln -s /etc/init.d/dbora /etc/rc3.d/S99dbora

  5. #5
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,334
    you are trying to start things as root - cant do that

  6. #6
    Join Date
    Jul 2000
    Posts
    147
    1.Log in as the root user.

    2.Edit the oratab file.
    # vi /var/opt/oracle/oratab

    Code:
    db1:/u01/app/oracle/product/10.2.0/dbhome:Y
    db2:/u01/app/oracle/product/10.2.0/dbhome:Y
    db3:/u01/app/oracle/product/10.2.0/dbhome:Y
    Then still root I created a file in /etc/init.d called dbora. Like bellow….

    Code:
    #! /bin/sh  -x
    #
    # Change the value of ORACLE_HOME to specify the correct Oracle home
    # directory for your installation.
    
    ORACLE_HOME=/u01/app/oracle/product/10.2.0/dbhome
    #
    # Change the value of ORACLE to the login name of the
    # oracle owner at your site.
    #
    ORACLE=oracle
    
    PATH=${PATH}:$ORACLE_HOME/bin
    HOST=`hostname`
    PLATFORM=`uname`
    export ORACLE_HOME PATH
    #
    if [ ! "$2" = "ORA_DB" ] ; then
       if [ "$PLATFORM" = "HP-UX" ] ; then
          remsh $HOST -l $ORACLE -n "$0 $1 ORA_DB"
          exit
       else
          rsh $HOST -l $ORACLE  $0 $1 ORA_DB
          exit
       fi
    fi
    #
    case $1 in
    'start')
            $ORACLE_HOME/bin/dbstart $ORACLE_HOME &
            ;;
    'stop')
            $ORACLE_HOME/bin/dbshut $ORACLE_HOME &
            ;;
    *)
            echo "usage: $0 {start|stop}"
            exit
            ;;
    esac
    #
    exit
    
    then …
    Change the group of the dbora file to the OSDBA group (typically dba), and set the permissions to 750: ( still root )

    Code:
    # chgrp dba dbora
    # chmod 750 dbora
    After that, still root..

    Code:
    # ln -s /etc/init.d/dbora /etc/rc3.d/K01dbora
    # ln -s /etc/init.d/dbora /etc/rc3.d/S99dbora
    After that reboot the system, but db just don't start at the boot. I can start manually without problems. Now you tell me what and where I did wrong?

  7. #7
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,334
    stop starting the database as root

  8. #8
    Join Date
    May 2005
    Location
    AZ, USA
    Posts
    131

  9. #9
    Join Date
    Jul 2006
    Posts
    1
    Having same problem (solaris 10, oracle 10g rel 2), did you get it sorted? I've changed relevant lines of code to be

    ORA_OWNER=oracle

    su - $ORA_OWNER -c $ORACLE_HOME/bin/dbstart $ORACLE_HOME &
    ;;
    su - $ORA_OWNER -c $ORACLE_HOME/bin/dbshut $ORACLE_HOME &
    ;;

    Also had to edit dbshut and dbstart because oratab location was wrong.
    Not sure if there's anything else I should do?

  10. #10
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,334
    well whats the problem?

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