Simpler Navigation for Servers and Operating Systems
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
cancel
Showing results for 
Search instead for 
Did you mean: 

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
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
Yogeeraj_1
Honored Contributor

Re: Oracle 10g startup issue

hi mike,

one simple way to do it is:
....
'start')

# source the system configuration variables
if [ -f /etc/rc.config ] ; then
. /etc/rc.config
else
echo "ERROR: /etc/rc.config defaults file MISSING"
fi

# Check to see if this script is allowed to run...
if [ "$ORACLE_START_STOP" != 1 ]; then
rval=2
else

# Execute the commands to start your subsystem
echo "/u01/app/oracle/product/8.1.7/bin/lsnrctl start "| su - oracle
echo "/u01/app/oracle/product/8.1.7/bin/sqlplus /nolog <
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)

Re: Oracle 10g startup issue

There is nothing wrong with your script; is is run twice. Once as root, who changes it to run it as oracle.
The paramaters given to the script are part of the HP-UX startup paradigm ( first a start_msg to show what it's doing on the boot console, then a start to do the actual job ).
What can be the case is that your database is left in an 'unknown' state after starting and interrupting it for instance. What you have to do is: run the startup script and then do a shutdown abort. Then try again to start the database with dbora start

Good luck,
Philippe
Eric Antunes
Honored Contributor

Re: Oracle 10g startup issue

Hi Mike,

In my opinion you aren't doing the right way. You should have 5 files, for example:

/sbin/init.d/dbora10
/sbin/rc3.d/K110dbora10
/sbin/rc2.d/S990dbora10 --> this and the above file are a link to /sbin/init.d/dbora10.
/disc/.../scripts/start_boot.sh -- starts the db and services
/disc/.../scripts/stop_boot.sh -- stops the db and services

Look at my scripts (that works) at:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=982198

Best Regards,

Eric Antunes
Each and every day is a good day to learn.