Skip to content

Instantly share code, notes, and snippets.

@wstrange
Created September 7, 2011 19:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wstrange/1201519 to your computer and use it in GitHub Desktop.
Save wstrange/1201519 to your computer and use it in GitHub Desktop.
Oracle startup script
#!/bin/bash
#
# oracle Init file for starting and stopping
# Oracle Database. Script is valid for 10g and 11g versions.
#
# chkconfig: 35 80 30
# description: Oracle Database startup script
# Source function library.
. /etc/rc.d/init.d/functions
ORACLE_OWNER="oracle"
ORACLE_HOME=/oracle/app/oracle/product/11.2.0/dbhome_1/
case "$1" in
start)
echo -n $"Starting Oracle DB:"
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"
echo "OK"
;;
stop)
echo -n $"Stopping Oracle DB:"
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME"
echo "OK"
;;
*)
echo $"Usage: $0 {start|stop}"
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment