LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Oracle Startup Script (http://www.linuxquestions.org/questions/linux-software-2/oracle-startup-script-93196/)

linux_pioneer 09-15-2003 07:55 PM

Oracle Startup Script
 
Well I finally got through the installation error free. Oracle 9i R2 on redhat 9. After the installation the database configuration assistant ran smoothly. I was able to see the listener running, logged on to sqlplus with the default user, and logged back out. The tutorial I used had a start up script to run. I put it in /etc/init.d and have it run at system start up. Problem is it is not starting up properly. Here is the script file:

#!/bin/bash
#
# Run-level Startup script for the Oracle Instance and Listener
#
# chkconfig: 345 91 19
# description: Startup/Shutdown Oracle listener and instance

ORA_HOME="/home/u01/app/oracle/product/9.2.0.1.0"
ORA_OWNR="oracle"

# if the executables do not exist -- display error

if [ ! -f $ORA_HOME/bin/dbstart -o ! -d $ORA_HOME ]
then
echo "Oracle startup: cannot start"
exit 1
fi

# depending on parameter -- startup, shutdown, restart
# of the instance and listener or usage display

case "$1" in
start)
# Oracle listener and instance startup
echo -n "Starting Oracle: "
su - $ORA_OWNR -c "$ORA_HOME/bin/lsnrctl start"
su - $ORA_OWNR -c $ORA_HOME/bin/dbstart
touch /var/lock/subsys/oracle
echo "OK"
;;
stop)
# Oracle listener and instance shutdown
echo -n "Shutdown Oracle: "
su - $ORA_OWNR -c "$ORA_HOME/bin/lsnrctl stop"
su - $ORA_OWNR -c $ORA_HOME/bin/dbshut
rm -f /var/lock/subsys/oracle
echo "OK"
;;
reload|restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 start|stop|restart|reload"
exit 1
esac
exit 0

The error I get is: "Usage: $0 start|stop|restart|reload". I understand that this error means that the script is not getting a proper parameter. It should be start, shutdown, or reload/restart. My question is: Does the system supply this script file with the parameter? I would assume so but want to make sure. Next question is: If the system does supply the parameters are start, stop, and restart the correct parameters?

Please take a look at the script file. Everything looks in order to me. The only problem appears to be that the script file is not getting the proper parameter.


All times are GMT -5. The time now is 01:49 AM.