updated on Thu Jan 26 12:02:26 UTC 2012
[aur-mirror.git] / oracle / oracledb
blob435e01c416838d65be548270469cdc4e9a7e30cd
1 #!/bin/bash
3 # /etc/rc.d/oracledb
5 # Run-level Startup script for the Oracle Listener and Instances
6 # It relies on the information on /etc/oratab
8 export ORACLE_BASE=/home/oracle/app/oracle
9 export ORACLE_HOME=/home/oracle/app/oracle/product/11.1.0/orarch
10 export ORACLE_OWNR=oracle
11 export PATH=$PATH:$ORACLE_HOME/bin
13 if [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ]
14 then
15 echo "Oracle startup: cannot start"
16 exit 1
19 case "$1" in
20 start)
21 # Oracle listener and instance startup
22 echo -n "Starting Oracle: "
23 su $ORACLE_OWNR -c "$ORACLE_HOME/bin/lsnrctl start"
24 su $ORACLE_OWNR -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"
25 touch /var/lock/oracle
26 echo "OK"
28 stop)
29 # Oracle listener and instance shutdown
30 echo -n "Shutdown Oracle: "
31 su $ORACLE_OWNR -c "$ORACLE_HOME/bin/lsnrctl stop"
32 su $ORACLE_OWNR -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME"
33 rm -f /var/lock/oracle
34 echo "OK"
36 reload|restart)
37 $0 stop
38 $0 start
41 echo "Usage: `basename $0` start|stop|restart|reload"
42 exit 1
43 esac
45 exit 0