#!/bin/sh # # Edit the /etc/oratab file. # Database entries in the oratab file appear in the following format: # ORACLE_SID:ORACLE_HOME:{Y|N} # where Y or N specifies whether you want the dbstart and dbshut # scripts to start up and shut down the database. . /etc/rc.config test -s /etc/rc.config.d/oracle.rc.config && \ . /etc/rc.config.d/oracle.rc.config test -s /etc/profile.d/oracle.sh && \ . /etc/profile.d/oracle.sh # Determine the base and follow a runlevel link name. base=${0##*/} link=${base#*[SK][0-9][0-9]} # Force execution if not called by a runlevel directory. test $link = $base && START_ORACLE="yes" test "${START_ORACLE:-no}" = "yes" || exit 0 echo 750000000 >/proc/sys/kernel/shmmax return=$rc_done if [ ! -f $ORACLE_HOME/bin/dbstart -o -z "$ORA_OWNER" ]; then echo -n "Oracle could not be found (ORACLE_HOME wrong?)" return=$rc_failed echo -e "$return" exit 1 fi case "$1" in start) # Start the Oracle databases: echo "Starting Oracle:" su - $ORA_OWNER -c "$ORACLE_HOME/bin/dbstart" test "${START_LISTENER:-no}" = "yes" && su - $ORA_OWNER -c "$ORACLE_HOME/bin/lsnrctl start" test "${START_AGENT:-no}" = "yes" && su - $ORA_OWNER -c "$ORACLE_HOME/bin/lsnrctl dbsnmp_start" echo -e "$return" ;; stop) # Stop the Oracle databases: echo "Shutting down Oracle:" su - $ORA_OWNER -c "$ORACLE_HOME/bin/lsnrctl dbsnmp_stop" su - $ORA_OWNER -c "$ORACLE_HOME/bin/lsnrctl stop" su - $ORA_OWNER -c "$ORACLE_HOME/bin/dbshut" echo -e "$return" ;; reload) ;; *) echo "Usage: $0 {start|stop}" exit 1 esac test "$return" = "$rc_done" || exit 1 exit 0