發(fā)文章
發(fā)文工具
撰寫(xiě)
網(wǎng)文摘手
文檔
視頻
思維導(dǎo)圖
隨筆
相冊(cè)
原創(chuàng)同步助手
其他工具
圖片轉(zhuǎn)文字
文件清理
AI助手
留言交流
使用dbstart 和dbshut 腳本來(lái)自動(dòng)化啟動(dòng)和關(guān)閉數(shù)據(jù)庫(kù):1. 登錄用戶(hù)root。2. 編輯你的平臺(tái)的oratab 文件。打開(kāi)文件/etc/oratab:文件里數(shù)據(jù)庫(kù)條目為以下格式:SID:ORACLE_HOME:{Y|N|W}
其中,Y 和N 表示是否腳本啟動(dòng)或關(guān)閉數(shù)據(jù)庫(kù)。對(duì)于想要實(shí)現(xiàn)自動(dòng)化關(guān)閉和啟動(dòng),首先確定數(shù)據(jù)庫(kù)的實(shí)例ID ,也就是第一個(gè)SID 所標(biāo)識(shí)的,然后修改最后的值為Y 。
3. 切換系統(tǒng)工作目錄到/etc/init.d
4. 創(chuàng)建文件dbora 文件,將拷貝以下代碼。
#! /bin/sh -x # # Change the value of ORACLE_HOME to specify the correct Oracle home # directory for your installation. ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1 # # Change the value of ORACLE to the login name of the # oracle owner at your site. # ORACLE=oracle PATH=${PATH}:$ORACLE_HOME/bin HOST=`hostname` PLATFORM=`uname` export ORACLE_HOME PATH # if [ ! "$2" = "ORA_DB" ] ; then if [ "$PLATFORM" = "HP-UX" ] ; then remsh $HOST -l $ORACLE -n "$0 $1 ORA_DB" exit else rsh $HOST -l $ORACLE $0 $1 ORA_DB exit fi fi # case $1 in 'start') if [ "$PLATFORM" = "Linux" ] ; then touch /var/lock/subsys/dbora fi $ORACLE_HOME/bin/dbstart $ORACLE_HOME & ;; 'stop') $ORACLE_HOME/bin/dbshut $ORACLE_HOME & ;; *) echo "usage: $0 {start|stop}" exit ;; esac # exit
5. 修改dbora 文件所屬組為OSDBA ,設(shè)置權(quán)限為750:# chgrp dba dbora# chmod 750 dbora
6. 創(chuàng)建dbora 文件的軟連接到合適的運(yùn)行級(jí)目錄里。# ln -s /etc/init.d/dbora /etc/rc.d/rc0.d/K01dbora# ln -s /etc/init.d/dbora /etc/rc.d/rc3.d/S99dbora# ln -s /etc/init.d/dbora /etc/rc.d/rc5.d/S99dbora
來(lái)自: 昵稱(chēng)10504424 > 《工作》
0條評(píng)論
發(fā)表
請(qǐng)遵守用戶(hù) 評(píng)論公約
Redhat Linux 上自動(dòng)啟動(dòng)和關(guān)閉Oracle
ORA_HOME=/u01/oracle/product/9.2.0ORA_OWNER=oracleLOG=$ORA_HOME/startup.log.then echo "starting Oracle Net listener" su - $ORA_OWNER -c $ORA_HOME/b...
詳解如何將Oracle安裝為L(zhǎng)inux服務(wù)
詳解如何將Oracle安裝為L(zhǎng)inux服務(wù)。/bin/bash # chkconfig: 345 80 10 # description: Startup Script for oracle Databases # /etc/rc.d/init.d/oracle export ORACLE_BASE=/u01/oracle exp...
Redhat AS4 下Oracle 自動(dòng)啟動(dòng)腳本
安裝oracle后首先用sqlplus啟動(dòng)下oracle,可以啟動(dòng)后,按照一下步驟實(shí)現(xiàn)開(kāi)機(jī)啟動(dòng)。在$ORACLE_HOME/bin中,有dbstart和dbshut這兩個(gè)腳本,可以使用這兩個(gè)oracle自帶的腳本實(shí)現(xiàn)oracle的開(kāi)機(jī)自啟動(dòng)。2)、...
在Linux上自動(dòng)啟動(dòng)和關(guān)閉Oracle數(shù)據(jù)庫(kù)(9i/10g/11g)
case "$1" in''start'')# Start the Oracle databases:# The following command assumes that the oracle login # will not prompt the user for any valuessu - $ORA_OWNER...
linux 啟動(dòng) Oracle 實(shí)例
linux 啟動(dòng) Oracle 實(shí)例。2.用dbstart和dbshut啟動(dòng)和關(guān)閉數(shù)據(jù)庫(kù)實(shí)例。ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net ListenerUsage: /u01/app/oracle/oracle/product/10.2.0/db_1/...
Linux下oracle數(shù)據(jù)庫(kù)的監(jiān)聽(tīng)自啟動(dòng)設(shè)置
Linux下oracle數(shù)據(jù)庫(kù)的監(jiān)聽(tīng)自啟動(dòng)設(shè)置。$ cd$ORACLE_HOME/bin./bin/bash# chkconfig: 345 99 10# description: Startup Script for Oracle Databases# /etc/rc.d/init.d/oradbstartexport ORACLE_BASE=...
linux服務(wù)器下oracle開(kāi)機(jī)自啟動(dòng)設(shè)置
linux服務(wù)器下oracle開(kāi)機(jī)自啟動(dòng)設(shè)置。export PATHSAVE_LLP=$LD_LIBRARY_PATH# First argument is used to bring up Oracle Net ListenerORACLE_HOME_LISTNER=$ORACLE_HOME ############此處原來(lái)是$1,...
CentOS6.0_X86_64 oracle 11g R2 開(kāi)機(jī)自動(dòng)啟動(dòng)
Linux 下Oracle11g 自動(dòng)隨系統(tǒng)啟動(dòng)
# The this to bring down Oracle Net ListenerORACLE_HOME_LISTNER=$1//需要將此處的 ORACLE_HOME_LISTNER=$1 修改為 ORACLE_HOME_LISTNER=$ORACLE_HOMEif [ !$ORACLE_HOME_LISTNER ] ;then echo &q...
微信掃碼,在手機(jī)上查看選中內(nèi)容