1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | #!/bin/sh # # dbora This scripts starts and shuts down the # oracle database # # chkconfig: 345 99 10 # description: This script calls the dbstart script # to start Oracle # and dbshut to stop it # processname: oracle* # config: /etc/oratab # # Set ORACLE_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 ORACLE_HOME. export ORACLE_BASE=/opt/oracle10 export ORACLE_HOME=/opt/oracle10 export ORACLE_SID=DSSDB ORACLE_HOME=/opt/oracle10 ORA_OWNER=oracle if [ ! -f $ORACLE_HOME/bin/dbstart ] then echo "Oracle startup: cannot start" exit fi case "$1" in 'start') su $ORA_OWNER -c $ORACLE_HOME/bin/dbstart & su $ORA_OWNER -c "$ORACLE_HOME/bin/lsnrctl start" & ;; 'stop') su $ORA_OWNER -c "$ORACLE_HOME/bin/lsnrctl stop " & su $ORA_OWNER -c $ORACLE_HOME/bin/dbshut & ;; 'restart') su $ORA_OWNER -c "$ORACLE_HOME/bin/lsnrctl stop " & su $ORA_OWNER -c $ORACLE_HOME/bin/dbshut & sleep 15 su $ORA_OWNER -c $ORACLE_HOME/bin/dbstart & su $ORA_OWNER -c "$ORACLE_HOME/bin/lsnrctl start " & ;; esac |
0 Responses to “Oracle Startup Script”