CentOS6.5下設定Oracle 11gR2 開機自動啟動

來源:互聯網
上載者:User

CentOS6.5下設定Oracle 11gR2 開機自動啟動

CentOS6.5下設定Oracle 11gR2 開機自動啟動

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

[root@ora11gr2 ~]# vim /etc/oratab 
mytest:/oracle/product/11.2.0/db_1:Y

2.oracle 使用者下修改:

[oracle@ora11gr2 ~]$cd $ORACLE_HOME/bin
[oracle@ora11gr2 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 使用者下修改:

[root@ora11gr2 ~]# cd /etc/rc.d/init.d/
[root@ora11gr2 init.d]# vi oracle

#!/bin/bash
# chkconfig: 345 99 10
# description: Startup Script for Oracle Databases
# /etc/init.d/oracle
export ORACLE_SID=oracle
# export ORACLE_HOME_LISTNER=/oracle/product/11.2.0/bin/
export ORACLE_BASE=/apps/oracle
export ORACLE_HOME=/oracle/product/11.2.0
export PATH=$PATH:$ORACLE_HOME/bin
case "$1" in
start)
su oracle -c $ORACLE_HOME/bin/dbstart
touch /var/lock/oracle
echo "OK"
;;
stop)
echo -n "Shutdown Oracle: "
su oracle -c $ORACLE_HOME/bin/dbshut
rm -f /var/lock/oracle
echo "OK"
;;
*)
echo "Usage: 'basename $0' start|stop"
exit 1
esac
exit 0

儲存!修改檔案許可權

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

[root@ora11gr2 ~]# chkconfig --add oracle11g
[root@ora11gr2 ~]# chkconfig oracle11g on

聯繫我們

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