1. 程式人生 > >Linux自動重啟oracle實類監聽

Linux自動重啟oracle實類監聽

如何在Linux啟動時自動啟動Oracle監聽和例項

首先要解決上面的問題,才能繼續喲!

第一步:修改/etc/oratab檔案,命令如下:

[oracle@oracle11g ~]$ vi /etc/oratab

找到:accp:/u01/oracle:N   修改為: accp:/u01/oracle:Y

第二步:把lsnrctl start和dbstart新增到rc.local檔案中,命令如下:

[oracle@oracle11g ~]$ vi /etc/rc.d/rc.local

新增

su oracle -lc "/u01/oracle/bin/lsnrctl start"

su oracle -lc  /u01/oracle/bin/dbstart

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
#this oracle/product/12
su oracle -lc "/usr/local/oracle/product3/10201/bin/lsnrctl start"
#this oracle/product/12
su oracle -lc /usr/local/oracle/product3/10201/bin/dbstart
上面是我的檔案內容
我沒有用命令,我是直接用ssh把檔案下載到本地開啟編輯新增的,注意修改後儲存在上傳到對應的目錄,特別注意就是儘量把修改的檔案的許可權設定成最大,這樣才會生效。