Skip to content

Instantly share code, notes, and snippets.

@apathyboy
Created June 6, 2014 22:12
Show Gist options
  • Select an option

  • Save apathyboy/d6ed8f3a5e0df0bcd88b to your computer and use it in GitHub Desktop.

Select an option

Save apathyboy/d6ed8f3a5e0df0bcd88b to your computer and use it in GitHub Desktop.
#!/bin/sh
# chkconfig: 345 99 10
# description: Oracle auto start-stop script.
#
# Set ORA_HOME to be equivalent to the $ORACLE_HOME
# from which you wish to execute dbstart and dbshut;
#
# Set ORA_OWNER to the user id of the owner of the
# Oracle database in ORA_HOME.
#ORA_HOME=/u01/app/oracle/product/10.2.0/db_1
#ORA_HOME=/u01/app/oracle/product/11.1.0/db_1
#ORA_HOME=/u01/app/oracle/product/11.2.0/db_1
ORA_HOME=/u01/app/oracle/product/12.1.0/dbhome_1
ORA_OWNER=oracle
export ORACLE_UNQNAME=orcl
if [ ! -f $ORA_HOME/bin/dbstart ]
then
echo "Oracle startup: cannot start"
exit
fi
case "$1" in
'start')
# Start the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
# Remove "&" if you don't want startup as a background process.
su $ORA_OWNER -c "$ORA_HOME/bin/dbstart $ORA_HOME" &
touch /var/lock/subsys/dbora
;;
'stop')
# Stop the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su $ORA_OWNER -c "$ORA_HOME/bin/dbshut $ORA_HOME"
rm -f /var/lock/subsys/dbora
;;
esac
@TyroneSWG
Copy link

hmm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment