Solaris 10中Oracle 10gR2開機自啟動

來源:互聯網
上載者:User

Solaris 10中Oracle 10gR2開機自啟動

1.修改/var/opt/oracle/oratab檔案,後面的dbstart和dbshut依據這個檔案啟動資料庫:
 
orcl:/opt/oracle/product/10.2:Y
 
2.修改$ORACLE_HOME/bin/dbstart和$ORACLE_HOME/bin/dbshut檔案:
 
vi dbstart
 
#ORACLE_HOME_LISTNER=$1
 ORACLE_HOME_LISTNER=/opt/oracle/product/10.2
 export ORACLE_HOME_LISTNER
 
vi dbshut
 
#ORACLE_HOME_LISTNER=$1
 ORACLE_HOME_LISTNER=/opt/oracle/product/10.2
 export ORACLE_HOME_LISTNER
 
3.修改完畢後用看看oracle使用者能否執行這兩個檔案,我的dbshut沒問題,但是執行dbstart不行:

查看/opt/oracle/product/10.2/listener.log的許可權:


 
原來是oracle使用者沒有寫入listener的許可權,賦予相應許可權即可:
 chown oracle:dba /opt/oracle/product/10.2/listener.log
 執行後成功。
 
4.接下來在/etc/init.d下建立系統自動啟動和關機前自動關閉Oracle的指令檔,分別如下:
 
vi start_oracle.sh(開機後啟動oracle資料庫指令碼):
 
#!/usr/bin/bash
 #this script is used to start the oracle
 su - oracle -c " /opt/oracle/product/10.2/bin/dbstart"
 
chmod a+x /etc/init.d/start_oracle.sh
 
vi stop_oracle.sh(關機前停止oracle資料庫指令碼):
 
#!/usr/bin/bash
 #this script is used to stop the oracle
 su - oracle -c " /opt/oracle/product/10.2/bin/dbshut"
 
chmod a+x /etc/init.d/stop_oracle.sh

  • 1
  • 2
  • 下一頁

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.