#!/bin/bash# #oracle: Start/stop Oracle Database 11g r2/12c## chkconfig:345 - Ten# description:the Oracle Database Server is a RDBMS created by Oracle corporation## processname:oracle./etc/rc.d/init.d/Functionslockfile=/var/lock/subsys/Oraclepath= $PATH: $HOME/Binoracle_user=Oracleexport pathoracle_base=/home/oracle/oracle_12c/app/Oracleoracle_home= $ORACLE _base/product/12.1.0/Dbhome_1oracle_sid=Myoraclepath= $PATH: $ORACLE _home/Binld_library_path= $ORACLE _home/lib: $ORACLE _home/Lib32nls_lang=American_china. Zhs16gbkexport oracle_base oracle_home PATH oracle_sid ld_library_path Nls_lang Case " $" inchstart)if[-F $LOCKFILE]; Then Echo$0already running. Exit1 fi Echo-N $"starting Oracle Database:" su-$ORACLE _user-c"$ORACLE _home/bin/lsnrctl Start" su-$ORACLE _user-c"$ORACLE _home/bin/dbstart $ORACLE _home" Touch$LOCKFILE;; Stop)if[!-f $LOCKFILE]; Then Echo$0already stopping. Exit1 fi Echo-N $"stopping Oracle Database:" su-$ORACLE _user-c"$ORACLE _home/bin/lsnrctl Stop" su-$ORACLE _user-c"$ORACLE _home/bin/dbshut $ORACLE _home" RM-f $LOCKFILE;;'Restart') $0Stop $0start;;'Status') if[-F $LOCKFILE]; Then Echo$0started. Else Echo$0stopped. fi ;;*) Echo "Usage: $ [Start|stop|status]"Exit1EsacExit0