oracle 11g服務自動啟動方法_第1頁
oracle 11g服務自動啟動方法_第2頁
oracle 11g服務自動啟動方法_第3頁
oracle 11g服務自動啟動方法_第4頁
全文預覽已結束

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

CentOSOracle11gR2設置開機自啟動方法CentOSLinux下,oracle數(shù)據(jù)庫安裝完成后,默認是不是隨機自動啟動的。我們可以手動調用dbstart命令啟動數(shù)據(jù)庫。所以,需要我們利用centos的service配置oracle自啟動服務。一、涉及修改文件.3.4.$ORACLE_HOME/bin/dbshut/etc/oratab/etc/rc.d/init.d/oracle11g(需要自己創(chuàng)建)二、步驟1、修改dbstart文件([root@localhostroot)文件位置:$ORACLE_HOME/bin/dbstartFirstargumentisusedtobringupOracleNetListenerORACLE_HOME_LISTNER=$1#將此處的ORACLE_HOME_LISTNER=$1修改為ORACLE_HOME_LISTNER=$ORACLE_HOME完成后可以手動運行dbstart文件,來測試是否可以正確啟動oracle11g用法:./dbstart$ORACLE_HOME就可以啟動oracle11g2、修改dbshut文件文件位置:$ORACLE_HOME/bin/dbshut#ThethistobringdownOracleNetListenerORACLE_HOME_LISTNER=$1#將此處的ORACLE_HOME_LISTNER=$1修改為ORACLE_HOME_LISTNER=$ORACLE_HOME3、修改oratab文件dbstart文件受/etc/oratab控制,dbstart文件只能啟動/etc/oratab文件中第三列為Y的SID。所以將需要啟動的oracle實例標志位改成Y,更改/etc/oratab方法。[root@localhost~]#vi/etc/oratab#ThisfileisusedbyORACLEutilities.Itiscreatedbyroot.shandupdatedbytheDatabaseConfigurationAssistantwhencreatingadatabase.Acolon,':',isusedasthefieldterminator.Anewlineterminatestheentry.Linesbeginningwithapoundsign,'#',arecomments.##Entriesareoftheform:#$ORACLE_SID:$ORACLE_HOME:<N|Y>:##Thefirstandsecondfieldsarethesystemidentifierandhome#directoryofthedatabaserespectively.Thethirdfiledindicates#tothedbstartutilitythatthedatabaseshould,"Y",orshouldnot,#"N",bebroughtupatsystemboottime.##Multipleentrieswiththesame$ORACLE_SIDarenotallowed.#/oracle/11g:Y#改變此處(由N改成Y)4、創(chuàng)建啟動Oraclellg的Init腳本先創(chuàng)建oraclellg文件,并修改權限:cd/etc/rc.d/init.d/touchoracle11gchmoda+xoracle11g然后,修改該文件內容如下:(可以復制后直接放入對應文件中)#!/bin/bash#whoami#root#chkconfig:3455149#description:startstheoracledabasedeamons6##ORACLE_HOME=/oracleORACLE_OWNER=oracleORACLE_DESC="Oracle11g"ORACLE_LOCK=/var/lock/subsys/oracle11g0 case"$1"in1 'start')echo-n\"Starting${ORACLE_DESC}:\"1 runuser-$ORACLE_OWNER-c'$ORACLE_HOME/bin/lsnrctlstart'runuser-$ORACLE_OWNER-c'$ORACLE_HOME/bin/dbstart'1 runuser-$ORACLE_OWNER-c'$ORACLE_HOME/bin/emctlstartdbconsole'touch${ORACLE_LOCK}1 echo;;1 'stop')echo-n"shuttingdown${ORACLE_DESC}:"1 runuser-$ORACLE_OWNER-c'$ORACLE_HOME/bin/lsnrctlstop'runuser-$ORACLE_OWNER-c'$ORACLE_HOME/bin/dbshut'1 rm-f${ORACLE_LOCK}echo

1;;'restart')1echo-n"restarting${ORACLE_DESC}:"$0stop2 $0startecho2;;*)2 echo"usage:$0{start|stop|restart}"exit12esacexit022222233333333完成后,執(zhí)行以下命令,執(zhí)行權限,這步比較關鍵,要引起注意,如果重啟后不能自動啟動890123456789012345675、oracle11g,即可能oracle用戶沒有權限執(zhí)行些腳本,用root用戶登錄,找到此文件,設置權限,讓oracleoracle11g,?6、加入系統(tǒng)服務列表中chkconfig--addoraclellgchkconfig--level345oraclellgon?7、完成后,重啟服務器,測試連接。打開瀏覽器,輸入:https://localhost:1158/emOracleEnterpriseManager-MozillaFiFileEditViewHistoryBookmarksTbokHelpOracleEnterpriseManager[刪 ■[■https://localh0st:ll5£FErTVmnsal^logorVlDqoriOC?ACL€^nterpri^Manager11gDatabaseControlLoginCoiV9ht

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論