Home » Infrastructure » Linux » Why this script can not make database startup at OS bootup? (RedHat 4 update 6 + Oracle10gR2 Single)
Why this script can not make database startup at OS bootup? [message #323099] Tue, 27 May 2008 05:17 Go to next message
wxfjordan
Messages: 92
Registered: December 2006
Member

I want use dbstart script to start database at OS bootup time. I have modify this file at line 78:
...
...
# Set this to bring up Oracle Net Listener
ORACLE_HOME_LISTNER=$ORACLE_HOME
...
...

And I made the script as following, but it always can not startup database. I have used command "chkconfig" to add this script into the OS service. Why it can not startup database???

#!/bin/sh
# chkconfig: 2345 99 01
# description: ORACLE 10g Server

export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_SID=sba
export PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_USER=oracle

if [ ! -f $ORACLE_HOME/bin/dbstart ]
then
echo "ORACLE cannot start"
exit
fi

case "$1" in
start)
echo "Starting Oracle Database..."
su - oracle -c "/u01/app/oracle/product/10.2.0/db_1/bin/dbstart" &
su - oracle -c "/u01/app/oracle/product/10.2.0/db_1/bin/emctl start dbconsole"
;;
stop)
echo "Stoping Oracle Database"
su - oracle -c "/u01/app/oracle/product/10.2.0/db_1/bin/emctl stop dbconsole"
su - oracle -c "/u01/app/oracle/product/10.2.0/db_1/bin/dbshut"
;;
*)
echo $"Usage: $0 {start|stop}"
exit 1
esac

exit $?
Re: Why this script can not make database startup at OS bootup? [message #323114 is a reply to message #323099] Tue, 27 May 2008 06:04 Go to previous messageGo to next message
wxfjordan
Messages: 92
Registered: December 2006
Member

But I still can use this script to startup database in commandline.

# service oracle10g start
Starting Oracle Database...
Processing ASM instance "+ASM": log file /u01/app/oracle/product/10.2.0/db_1/startup.log
Processing Database instance "sba": log file /u01/app/oracle/product/10.2.0/db_1/startup.log
TZ set to Hongkong
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
http://oracle1.localdomain:1158/em/console/aboutApplication
Starting Oracle Enterprise Manager 10g Database Control .................... started.
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/product/10.2.0/db_1/oracle1.localdomain_sba/sysman/log
Re: Why this script can not make database startup at OS bootup? [message #323147 is a reply to message #323114] Tue, 27 May 2008 08:05 Go to previous message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
Check Automating Database Startup and Shutdown on Other Operating Systems.
Previous Topic: Environment Variables Problem in linux
Next Topic: Oracle not available
Goto Forum:
  


Current Time: Wed Dec 11 17:55:55 CST 2024