Results 1 to 14 of 14
  1. #1
    Join Date
    Feb 2006
    Posts
    21

    Unanswered: shutting down Oracle 10G on RedHat 4

    Hello,

    I've added the Kill scripts for Oracle (ln -s /etc/init.d/dbora K10dbora) and added them to /etc/rc6.d and /etc/rc0.d - yet Oracle is still not shutting down.

    Is there a required directory that the symbloic links have to be put into for redHat?
    thanks!

  2. #2
    Join Date
    Feb 2006
    Posts
    21
    I've also tried inserting the links into /etc/rc1.d and rc2.d. Still, Oracle is not shutting down?

  3. #3
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    IMO, you have separate & distinct problems.
    1) You need to validate that the shutdown down script is being invoked at all;
    such as placing near the top of the script
    env | sort -o /tmp/ora.env
    If/when the script gets invoked this file should be created.
    2) is the script able to shutdown the database in the context in which it is being invoked?
    It very could be that it does not have the necessary environmental variables.
    (see above).

    HTH & YMMV!
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  4. #4
    Join Date
    Feb 2006
    Posts
    21
    thx for reply.

    I added that line to the script - and the file got created. heres a copy of the dbora script. thanks

    --------------------
    # cat dbora
    #!/bin/sh
    ORA_HOME=/u01/app/oracle/product/10.1.0/db_1
    ORA_OWNER=oracle
    if [ ! -f $ORA_HOME/bin/dbstart ]
    then
    echo "Oracle startup: cannot start"
    exit
    fi
    env | sort -o /tmp/ora.env
    case "$1" in
    'start') # Start the Oracle databases and listeners
    su - $ORA_OWNER -c "$ORA_HOME/bin/dbstart"
    su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start"
    su - $ORA_OWNER -c "$ORA_HOME/bin/emctl start dbconsole"
    su - $ORA_OWNER -c "$ORA_HOME/bin/isqlplusctl start"
    ;;
    'stop') # Stop the Oracle databases and listeners
    su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop"
    su - $ORA_OWNER -c "$ORA_HOME/bin/dbshut"
    su - $ORA_OWNER -c "$ORA_HOME/bin/isqlplusctl stop"
    su - $ORA_OWNER -c "$ORA_HOME/bin/emctl stop dbconsole"
    ;;
    esac

  5. #5
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    what is the contents of /tmp/ora.env?
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  6. #6
    Join Date
    Feb 2006
    Posts
    21
    # cat ora.env
    _=/bin/env
    G_BROKEN_FILENAMES=1
    HISTSIZE=1000
    HOME=/root
    HOSTNAME=demo4
    INPUTRC=/etc/inputrc
    KDEDIR=/usr
    LANG=en_US.UTF-8
    LD_LIBRARY_PATH=
    LESSOPEN=|/usr/bin/lesspipe.sh %s
    LOGNAME=root
    LP_BAK=
    LS_COLORS=no=00:fi=00:di=00;34:ln=00;36i=40;33:so=00;35:bd=40;33;01:cd=40;33;01r=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32: *.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*. sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj =00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00; 31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.t z=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif =00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=0 0;35:*.tif=00;35:
    MAIL=/var/spool/mail/root
    PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin:/usr/local/trigence/bin
    PWD=/usr/local/trigence/containers
    SHELL=/bin/bash
    SHLVL=5
    SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
    SSH_CLIENT=::ffff:127.0.0.1 36052 22
    SSH_CONNECTION=::ffff:127.0.0.1 36052 ::ffff:127.0.0.1 22
    SSH_TTY=/dev/pts/4
    TERM=xterm
    USER=root

  7. #7
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    The process does not have the necessary environmental variables; such as ORACLE_HOME, etc.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  8. #8
    Join Date
    Feb 2006
    Posts
    21
    hmm I noticed that too. Can I just add the variables into the dbora script? I believe I may be runing this script as root - so perhaps thats why the variables arent there. Any recommendations/advice? thank-you

  9. #9
    Join Date
    Jul 2003
    Posts
    2,296
    read the docs. I don't think your home is /u01/app/oracle/product/10.1.0/db_1
    more likely it is: =/u01/app/oracle/product/10.1.0/
    PHP Code:
    #!/bin/sh
    #
    # create this file onto Unix server as: /etc/init.d/dbora
    # make sure the permissions are: -rwxr--r--
    #
    # 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=/apps/oracle/9.2
    ORA_OWNER
    =oracle

    if [ -f $ORA_HOME/bin/dbstart ]
    then
    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 &
         
    su $ORA_OWNER -"$ORA_HOME/bin/lsnrctl start db1_listener" &
         ;;

         
    '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 &
         
    su $ORA_OWNER -"$ORA_HOME/bin/lsnrctl stop db1_listener" &
         ;;

    esac
    else
         echo 
    "Oracle startup: cannot start"
         
    exit
    fi 
    - The_Duck
    you can lead someone to something but they will never learn anything ...

  10. #10
    Join Date
    Feb 2006
    Posts
    21
    I verified the $ORACLE_HOME variable - it is correct.

    Anacedent - you can see in the script that performing the su to the Oracle user will give the Oracle env variables necessary (ie ORACLE_HOME, ORACLE_SID) etc.

  11. #11
    Join Date
    May 2004
    Location
    Dominican Republic
    Posts
    721
    When you execute /etc/init.d/dbora start from the shell, as the root user, what does it do ?

  12. #12
    Join Date
    Feb 2006
    Posts
    21
    Quote Originally Posted by JMartinez
    When you execute /etc/init.d/dbora start from the shell, as the root user, what does it do ?
    starts up fine:

    /etc/init.d/dbora start:

    Processing Database instance "orcl": log file /u01/app/oracle/product/10.1.0/db_1/startup.log

    LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 26-JUN-2006 10:45:50

    Copyright (c) 1991, 2005, Oracle. All rights reserved.

    TNS-01106: Listener using listener name LISTENER has already been started
    TZ set to US/Eastern
    Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
    Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
    Starting Oracle Enterprise Manager 10g Database Control ................ started.
    ------------------------------------------------------------------
    Logs are generated in directory /u01/app/oracle/product/10.1.0/db_1/nj-centos-000.nj.trigence.com_orcl/sysman/log
    iSQL*Plus 10.2.0.1.0
    Copyright (c) 2003, 2005, Oracle. All rights reserved.
    Starting iSQL*Plus ...
    iSQL*Plus started.
    Operation successful

  13. #13
    Join Date
    May 2004
    Location
    Dominican Republic
    Posts
    721
    How do you know it is not shutting down ? If the init daemon is running, it should be fine. For instance, 0 or 6 should be fine for shutting down.. (1 and 2 are for startup).

  14. #14
    Join Date
    Feb 2006
    Posts
    21
    thx everyone for their help.

    The software I'm working with actually has a script which makes a call to dbora stop. But the script was looking for a /var/lock/subsys/oracle. In Oracle 10G, it looks as though file no longer gets created - therefore our script was failing.

    Added this line to /etc/init.d/dbora to resove issue.

    touch /var/lock/subsys/oracle

    thanks again

Posting Permissions

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