2015-09-24
Vim/etc/rc.d/init.d/oracle
#!/bin/bash# Oracle:start/Stop Oracle Database 11g r2# chkconfig:345 - Ten# description:the Oracle Database is an Object-relational Database Management system.#./etc/rc.d/init.d/Functionslockfile=/var/lock/subsys/Oracleoracle_home=/u01/app/oracle/product/11.2.0Oracle_user=Oracle Case " $" inch'Start')
If [-F $LOCKFILE];thenEcho$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" su-$ORACLE _user-c"$ORACLE _home/bin/emctl start Dbconsole" 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" su-$ORACLE _user-c"$ORACLE _home/bin/emctl Stop Dbconsole" RM-f $LOCKFILE;;'Restart') $0Stop $0start;;'Status') if[-F $LOCKFILE]; Then Echo$0started. Else Echo$0stopped. fi ;;*) Echo "Usage: $ [Start|stop|status]"Exit1EsacExit0
Oracle startup, shutdown, restart scripts