【正文】
then echo Oracle startup: cannot start exit 1fi depending on parameter startup, shutdown, restart of the instance and listener or usage displaycase $1 in start) Oracle listener and instance startup echo n Starting Oracle: su $ORA_OWNR c $ORACLE_HOME/bin/dbstart touch /var/lock/oracle su $ORA_OWNR c $ORACLE_HOME/bin/isqlplusctrl start su $ORA_OWNR c $ORACLE_HOME/bin/emctl start dbconsole echo OK 。 stop) Oracle listener and instance shutdown echo n Shutdown Oracle: su $ORA_OWNR c $ORACLE_HOME/bin/emctl stop dbconsole su $ORA_OWNR c $ORACLE_HOME/bin/isqlplusctrl stop su $ORA_OWNR c $ORACLE_HOME/bin/dbshut su $ORA_OWNR c $ORACLE_HOME/bin/lsnrctl stop rm f /var/lock/oracle echo OK 。 reload|restart) $0 stop $0 start 。 *) echo Usage: `basename $0` start|stop|restart|reload exit 1esacexit 0腳本2:(只啟動(dòng)數(shù)據(jù)庫(kù)和監(jiān)聽(tīng))!/bin/bash chkconfig: 345 99 10 description: Startup Script for oracle Databases /etc/export ORACLE_BASE=/home/oracleexport ORACLE_HOME=/home/oracle/10Gexport ORACLE_SID=orclexport PATH=$PATH:$ORACLE_HOME/bincase $1 instart)su oracle c $ORACLE_HOME/bin/dbstarttouch /var/lock/oracleecho OK。stop)echo n Shutdown oracle: su oracle c $ORACLE_HOME/bin/dbshutrm f /var/lock/oracleecho OK。*)echo Usage: 39。basename $039。 start|stopexit 1esacexit 0上面兩個(gè)腳本如果export ORACLE_BASE=/home/oracleexport ORACLE_HOME=/home/oracle/10G和你所安裝的oracle路徑不相同,請(qǐng)參考修改就是,然后chown /etc/chmod 775 /etc//sbin/chkconfig add dbstart/sbin/chkconfig list dbstart運(yùn)行結(jié)果:dbstart 0:關(guān)閉 1:關(guān)閉 2:關(guān)閉 3:啟用 4:啟用 5:啟用 6:關(guān)閉可以/sbin/service dbstart start看看是否能啟動(dòng)然后重啟主機(jī),測(cè)試下oracle所有服務(wù)是否啟動(dòng)具體做法是測(cè)試三個(gè)網(wǎng)頁(yè)地址、sqlplus登錄下等。21 / 21