Q on automatic shutdown-restart on solaris
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Q on automatic shutdown-restart on solaris

  1. #1
    Join Date
    Dec 2000
    Posts
    138

    Question

    HI,
    I wanted to do an automatic shutdown and startup of db in a solaris 7 and from the forums prev discussion and docs i created a file dbora in /etc/init.d
    #!/bin/sh
    # 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=/u01/app/oracle/product/8.1.7
    ORA_OWNER=oracle
    if [! -f $ORA_HOME/bin/dbstart]
    then
    echo "Oracle startup: cannot start"
    exit
    fi
    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 &
    ;;
    í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 &
    ;;
    esac

    I have stopped here:

    after that the doc says to
    4. Link dbora by entering:
    # ln -s /etc/init.d/dbora /etc/rc0.d/K10dbora
    # ln -s /etc/init.d/dbora /etc/rc2.d/S99dbora

    i assumed that when u eexec the above a copy of the above file is created in K10dbora and S99dbora (IMO -that the dir are created when u execute the cmds), and a link to the origianl file is maintained and in ls -l the links should be 2(if i am correct).

    can i go ahead from step 4- from what i have said - please correct me if i am wrong.

    the next Q is how would i know if the db has been shutdown using the above file during a system shutdown.the problem arose bcos of the power outages in California.is there anyway to find if this file is executed and successful.
    and does the system pass the shutdown or startup as arguments to the dbora file bcos the case..esac has them.
    any help is appreciated.
    thanks,
    dharma
    PS: I am new to UNIX.

  2. #2
    Join Date
    Oct 2000
    Location
    Saskatoon, SK, Canada
    Posts
    3,925
    If I had understood your question correctly, when you create a link, what happens in Unix is that it would create a pointer to the file. As a result making modification at one place get reflected to all the pointer locations. When you choose that link, what happens is you would be reading the files from its original location, there by you are restraining yourself from having to manage multiple files.

    Now comming to the point of K... and S... file suffixes, they get executed at different points. I don't know which gets exected at boot time and which one at the shutdown time.

    To know whether the program got executed during the boot time or not, check the boot log and it would reveal the informations.

    Please let us know if you have any more questions.

    Sam
    Thanx
    Sam



    Life is a journey, not a destination!


  3. #3
    Join Date
    Feb 2001
    Posts
    163
    K => Kill / Stop
    S => Start

    BTW, these scripts are executed only when the system goes through the normal init levels to shutdown. If there is a power outage and the system has a hard crash or if you issue a reboot the kill scripts will not work

    Uday

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