Operating System - HP-UX
1753731 Members
4575 Online
108799 Solutions
New Discussion юеВ

Re: Oracle 10g startup issue

 
Mike Smith_33
Super Advisor

Oracle 10g startup issue

I am the sysadmin and not Oracle literate but here is the situation. Oracle 10g installed and setup on HPUX 11i.

script in /sbin/init.d/ called dbora
link to that from /sbin/rc3.d file is S990dbora

We noticed that Oracle appeared to start and quite a few processes were there but a closer inspection by the dba showed that Oracle was in some sort of "mount" state instead of a started state.

We have been doing troubleshooting today and it appears that the param start_msg is being passed into the dbora/S990dbora script during startup. The case statement in the script does not have start_msg only start and stop. The system then appears to do a stop on Oracle instead of a start.

It must go into the background at that point because later we see some messages during startup from this script.

I don't understand why this param is being passed to it since it doesn't appear to expect it and I would appreciate any ideas anyone has.
12 REPLIES 12
Indira Aramandla
Honored Contributor

Re: Oracle 10g startup issue

Hi Mike,

When you say "Oracle appeared to start and quite a few processes and later on it is still in mount status. And then about the parameter start_msg". Then you notice that the script does a stop of oracle instead of start.

It would be something to do with the way your oracle start/stop script is written. May be after the start statements, there is no ending in the case and the script is continuing with the next case which is to stop oracle. Also check with you PATH, DISPLAY and export statements. When a database is started it have to be mounted and then in open state for users to be able to use it.

In the case statement this is how one would have.

Check you script
case $1 in
start_msg)
echo "Start Oracle" ;;
stop_msg)
echo "Stopping Oracle" ;;

'start')
this is where you have the db start statements......
........
;;

'stop')
this is where you have the db stop statements....
.........
;;

*)
echo "usage: $0 {start|stop}"
..........
;;
esac



Indira A
Never give up, Keep Trying
Julio Yamawaki
Esteemed Contributor

Re: Oracle 10g startup issue

Hi,

You can find the problem by testing this procedure manually, i.e., using /sbin/init.d/dbora start o stop, to see what is going on, you can put a set -x and set -v at the beginning of dbora.
If you still can't see what happend, you must find alert.ora file from this database, that will have all problems that occured during database startup.

Regards,
Yogeeraj_1
Honored Contributor

Re: Oracle 10g startup issue

hi,


did you check the value of the ORACLE_START_STOP paramter in your /etc/rc.config.d/oracle ?

normally, it should be set to 1


hope this helps
kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Mike Smith_33
Super Advisor

Re: Oracle 10g startup issue

I will assign points once I am able to determine the amount of assistance.

Here are some answers:

Here is the Case statement, the only difference is that the start_msg section at the beginning was added by me. It was not there previously. I would like to know why the system is passing a parameter that the startup script is not expecting.

case $1 in
'start_msg')
echo "$0: startup start_msg"
;;
'start')
echo "$0: starting up" >> $LOG
date >> $LOG
# Start Oracle Net
if [ -f $ORACLE_HOME/bin/tnslsnr ] ; then
echo "starting Oracle Net Listener"
$ORACLE_HOME/bin/lsnrctl start >> $LOG 2>&1 &
fi
echo "Starting Oracle databases"
$ORACLE_HOME/bin/dbstart >> $LOG 2>&1 &
emctl start agent
;;
'stop')
echo "$0: shutting down" >> $LOG
date >> $LOG
# Stop Oracle Net
if [ -f $ORACLE_HOME/bin/tnslsnr ] ; then
echo "stopping Oracle Net Listener"
$ORACLE_HOME/bin/lsnrctl stop >> $LOG 2>&1 &
fi
echo "stopping Oracle databases"
$ORACLE_HOME/bin/dbshut >> $LOG 2>&1 &
emctl stop agent
;;
*)
echo "usage: $0 {start|stop}"
exit
;;
esac


I just spoke with the dba and he said it works if he does things manually. He has reviewed the alert.ora and all comes up but it goes to alter mount state and not started. He is wondering why on a boot the system first tries to shutdown the database. If it is a boot there should not be a database up. We are trying to get a reboot today and will look at the set command. He added echos to the dbstart script on yesterday but we never saw anything from it during startup.


Last but not least, I am unable to find any file related to Oracle in rc.config.d That was something we looked at yesterday based on some other postings we saw.




Steven E. Protter
Exalted Contributor

Re: Oracle 10g startup issue

Mike,

This is wrong

---
if [ -f $ORACLE_HOME/bin/tnslsnr ] ; then
echo "starting Oracle Net Listener"
$ORACLE_HOME/bin/lsnrctl start >> $LOG 2>&1 &
fi
echo "Starting Oracle databases"
$ORACLE_HOME/bin/dbstart >> $LOG 2>&1 &
emctl start agent
---
You should not start oracle as the root user. In a startup script the ORACLE_HOME variable is not set. Starting oracle as root will make it unaccessible to users and is not supported.

What you should do is run it as the oracle user, which hopefully you used to install it.

/usr/bin/su - oracle -c "path to oracle startup script"

That replaces the code above.

That happens is the system changes to the oracle user, gets the proper environment like ORACLE_HOME and then proceeds to start the databse.

Thats how I've always started oracle products and it's worked pretty well.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Steven E. Protter
Exalted Contributor

Re: Oracle 10g startup issue

Here is my current code:

su - oracle -c "lsnrctl start" 1>/dev/null 2>&1
su - oracle -c dbstart 1>/dev/null 2>&1

Good Luck,

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Mike Smith_33
Super Advisor

Re: Oracle 10g startup issue

Steven, that was not the entire code just the case section. There is code above that as follows:


if [ ! "$2" = "ORA_DB" ] ; then
if [ "$PLATFORM" = "HP-UX" ] ; then
# remsh $HOST -l $ORACLE -n "$0 $1 ORA_DB"
if [ "$1" = "start" ]
then
su - oracle -c '/sbin/rc3.d/S990dbora start ORA_DB'
else
su - oracle -c '/sbin/rc3.d/S990dbora stop ORA_DB'
fi
exit
else
rsh $HOST -l $ORACLE $0 $1 ORA_DB
exit
fi
fi


Apparently this thing runs the first time and then runs itself again as Oracle. This is in a ServiceGuard cluster that was setup for us by a consultant. I have about 2 months experience as an HP admin. This is the development node. SG takes care of Oracle on the prod node so it is totally different startup on the other node. This dbora stuff was put there by the consultant and we are pretty sure that all this was tested and ran correctly before he left.
Patrick Wallek
Honored Contributor

Re: Oracle 10g startup issue

Can you post the entire startup script? It appears that is was written rather strangely. Something definitely does not look right.
Mike Smith_33
Super Advisor

Re: Oracle 10g startup issue

The only additions I have made are an occasional echo or date statement and I just added the -v at the top

# cat dbora
#! /bin/sh -x -v
#
# Change the value of ORACLE_HOME to specify the correct Oracle home
# directory for you installation
date
ORACLE_HOME=/oracle/OraHome_1
#
# change the value of ORACLE to the login name of the
# oracle owner at your site
#

ORACLE=oracle

PATH=${PATH}:$ORACLE_HOME/bin:/usr/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"
if [ "$1" = "start" ]
then
su - oracle -c '/sbin/rc3.d/S990dbora start ORA_DB'
else
su - oracle -c '/sbin/rc3.d/S990dbora stop ORA_DB'
fi
exit
else
rsh $HOST -l $ORACLE $0 $1 ORA_DB
exit
fi
fi
#
LOG=$ORACLE_HOME/startup.log
touch $LOG
chmod a+r $LOG
#
case $1 in
'start_msg')
echo "$0: startup start_msg"
;;
'start')
echo "$0: starting up" >> $LOG
date >> $LOG
# Start Oracle Net
if [ -f $ORACLE_HOME/bin/tnslsnr ] ; then
echo "starting Oracle Net Listener"
$ORACLE_HOME/bin/lsnrctl start >> $LOG 2>&1 &
fi
echo "Starting Oracle databases"
$ORACLE_HOME/bin/dbstart >> $LOG 2>&1 &
emctl start agent
;;
'stop')
echo "$0: shutting down" >> $LOG
date >> $LOG
# Stop Oracle Net
if [ -f $ORACLE_HOME/bin/tnslsnr ] ; then
echo "stopping Oracle Net Listener"
$ORACLE_HOME/bin/lsnrctl stop >> $LOG 2>&1 &
fi
echo "stopping Oracle databases"
$ORACLE_HOME/bin/dbshut >> $LOG 2>&1 &
emctl stop agent
;;
*)
echo "usage: $0 {start|stop}"
exit
;;
esac
#
date
exit