PHP code: #!/bin/sh # 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=/oracle/product/10.1 ORA_OWNER=oracle LOG=$ORA_HOME/startup.log touch $LOG chmod a+r $LOG 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 # # su - $ORA_OWNER -c $ORA_HOME/bin/dbstart & # ;; # # '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 & # ;; # #esac case $1 in 'start') echo "$0: starting up" >> $LOG date >> $LOG # Start Oracle Net if [ -f $ORA_HOME/bin/lsnrctl ] ; then echo "starting Oracle Net listener" su - $ORA_OWNER -c '/oracle/product/10.1/bin/lsnrctl start LISTENER1'>> $LOG 2>&1 & fi echo "starting Oracle databases" su - $ORA_OWNER -c $ORA_HOME/bin/dbstart >> $LOG 2>&1 ;; 'stop') echo "$0: shutting down" >> $LOG date >> $LOG # Stop Oracle Net if [ -f $ORA_HOME/bin/lsnrctl ] ; then echo "stopping Oracle Net listener" su - $ORA_OWNER -c '/oracle/product/10.1/bin/lsnrctl stop LISTENER1'>> $LOG 2>&1 fi echo "stopping Oracle databases" su - $ORA_OWNER -c $ORA_HOME/bin/dbshut >> $LOG 2>&1 ;; *) echo "usage: $0 {start|stop}" exit ;; esac # exit
#!/bin/sh # 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=/oracle/product/10.1 ORA_OWNER=oracle LOG=$ORA_HOME/startup.log touch $LOG chmod a+r $LOG 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 # # su - $ORA_OWNER -c $ORA_HOME/bin/dbstart & # ;; # # '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 & # ;; # #esac case $1 in 'start') echo "$0: starting up" >> $LOG date >> $LOG # Start Oracle Net if [ -f $ORA_HOME/bin/lsnrctl ] ; then echo "starting Oracle Net listener" su - $ORA_OWNER -c '/oracle/product/10.1/bin/lsnrctl start LISTENER1'>> $LOG 2>&1 & fi echo "starting Oracle databases" su - $ORA_OWNER -c $ORA_HOME/bin/dbstart >> $LOG 2>&1 ;; 'stop') echo "$0: shutting down" >> $LOG date >> $LOG # Stop Oracle Net if [ -f $ORA_HOME/bin/lsnrctl ] ; then echo "stopping Oracle Net listener" su - $ORA_OWNER -c '/oracle/product/10.1/bin/lsnrctl stop LISTENER1'>> $LOG 2>&1 fi echo "stopping Oracle databases" su - $ORA_OWNER -c $ORA_HOME/bin/dbshut >> $LOG 2>&1 ;; *) echo "usage: $0 {start|stop}" exit ;; esac # exit