日韩黑丝制服一区视频播放|日韩欧美人妻丝袜视频在线观看|九九影院一级蜜桃|亚洲中文在线导航|青草草视频在线观看|婷婷五月色伊人网站|日本一区二区在线|国产AV一二三四区毛片|正在播放久草视频|亚洲色图精品一区

分享

Oracle實(shí)驗(yàn)(四) - 開(kāi)機(jī)自動(dòng)啟動(dòng)腳本

 芥納須彌 2015-05-08


啟動(dòng)腳本代碼

復(fù)制代碼
#!/bin/bash
#
# /etc/init.d/oracledb
#
# Run-level Startup script for the Oracle Instance, Listener, and 
# Web Interface


export ORACLE_HOME=/your/oracle/home/goes/here
export ORACLE_SID=oraclesidgoeshere
export PATH=$PATH:$ORACLE_HOME/bin
ORA_OWNR="oracleownergoeshere"
# if the executables do not exist -- display error
if [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ]
then
echo "Oracle startup: cannot start"
exit 1
fi

# depending on parameter -- startup, shutdown, restart
# of the instance and listener or usage display

case "$1" in
start)
# Oracle listener and instance startup
echo -n "Starting Oracle: "
su $ORA_OWNR -c "$ORACLE_HOME/bin/lsnrctl start"
su $ORA_OWNR -c $ORACLE_HOME/bin/dbstart
touch /var/lock/oracle

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/lsnrctl stop"
su $ORA_OWNR -c $ORACLE_HOME/bin/dbshut
rm -f /var/lock/oracle

su $ORA_OWNR -c “$ORACLE_HOME/bin/emctl stop dbconsole”
echo "OK"
;;
reload|restart)
$0 stop
$0 start
;;
*)
echo "Usage: `basename $0` start|stop|restart|reload"
exit 1
esac
exit 0
復(fù)制代碼

//script中有兩行的引號(hào)有問(wèn)題.把引號(hào)改一下.就可以.

另原腳本中無(wú)isqlplus的啟動(dòng).可自行加入:

su $ORA_OWNR -c “$ORACLE_HOME/bin/isqlplusctl start”

su $ORA_OWNR -c “$ORACLE_HOME/bin/isqlplusctl stop”

如不加入從客戶端瀏覽器中無(wú)法訪問(wèn).也可以手動(dòng)啟動(dòng).

 

將這個(gè)文件放到指定的位置并讓它可執(zhí)行, 將它連接到所有的運(yùn)行級(jí):

#chmod 755 /etc/init.d/oracledb
#update-rc.d oracledb defaults 99

如果你希望在系統(tǒng)啟動(dòng)時(shí)啟動(dòng)你創(chuàng)建的所有數(shù)據(jù)庫(kù)實(shí)例,那么需要修改 /etc/oratab 文件. 下面是一個(gè)例子:

oracle:/opt/oracle/:N

修改為

oracle:/opt/oracle:Y

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買(mǎi)等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多