centos 下配置oracle11gR2開機自啟

來源:互聯網
上載者:User

標籤:kconfig   開機自啟動   test   mod   case   off   測試   list   儲存   

這裡使用的環境是 CentOS 6.6 ,並且已經裝好了oracle11gR2

oracle啟動分為兩個步驟:

1.啟動監聽

2.啟動服務

1.root 使用者下修改ORATAB(將N該為Y):

[[email protected] ~]# vim /etc/oratab mytest:/oracle/product/11.2.0/db_1:Y

2.切換到oracle使用者修改:

[[email protected] ~]$cd $ORACLE_HOME/bin[[email protected] bin]$ vim dbstart

找到 ORACLE_HOME_LISTNER=$1  這行, 修改成:
ORACLE_HOME_LISTNER=/oracle/product/11.2.0/
或者直接修改成:
ORACLE_HOME_LISTNER=$ORACLE_HOME

同樣道理修改 dbshut

測試回合 dbshut, dbstart 看能否啟動oracle 服務及listener服務

 

3.root 使用者下修改:

[[email protected] ~]# cd /etc/rc.d/init.d/
[[email protected] init.d]# vi oracle

#!/bin/bash# chkconfig: 345 99 10# description: Startup Script for Oracle Databases# /etc/init.d/oracleexport ORACLE_SID=oracle# export ORACLE_HOME_LISTNER=/oracle/product/11.2.0/bin/export ORACLE_BASE=/apps/oracleexport ORACLE_HOME=/oracle/product/11.2.0export 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: ‘basename $0‘ start|stop"exit 1esacexit 0

儲存並修改檔案許可權

chmod 755 /etc/rc.d/init.d/oracle

可以做如下如下測試:

[[email protected] init.d]# service oracle startProcessing Database instance "orcl": log file /u01/app/product/11.2.0/db_1/startup.logOK
[[email protected] init.d]# service oracle stopShutdown Oracle: Processing Database instance "orcl": log file /u01/app/product/11.2.0/db_1/shutdown.logOK

4. 設定oracle為開機自啟動

[[email protected] init.d]# chkconfig oracle on[[email protected] init.d]# chkconfig --list oracleoracle             0:off    1:off    2:on    3:on    4:on    5:on    6:off

 

centos 下配置oracle11gR2開機自啟

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.