Liunx環境下oracle 自動跟隨系統啟動
在windows 環境下安裝完oracle 資料庫,每次啟動系統時,oracle會自動啟動。但是在liunx平臺下需要手動啟動oracle 例項。
為了讓oracle資料資料庫自動隨作業系統啟動,需要手動配置,下面給大家介紹下詳細的配置步驟。
1.修改Oracle系統配置檔案:/etc/oratab
Oracle 安裝後$ORACLE_HOME/bin路徑下有自帶的dbstart(啟動資料庫)和dbshut(關閉資料庫)兩個指令碼。
root使用者下執行
[root@pxboracle]# vi /etc/oratab
在檔案下新增一行
devdb:/u01/oracle/product/11.2.0/db_1:Y
devdb 是例項名,:/u01/oracle/product/11.2.0/db_1是oracle安裝home路徑,後面新增 Y 即可!
#
# This file is used by ORACLE utilities. It is created by root.sh
# and updated by the Database Configuration Assistant when creating
# a database.
# A colon, ':', is used as the field terminator. A new line terminates
# the entry. Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
# $ORACLE_SID:$ORACLE_HOME:
#
# The first and second fields are the system identifier and home
# directory of the database respectively. The third filed indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
devdb:/u01/oracle/product/11.2.0/db_1:Y
2. 在 /etc/rc.d/init.d/ 目錄下,建立oracle服務指令碼檔案,並將如下內容放入指令碼中:
[root@pxboracle]# vi oracle
#!/bin/bash
# See how we were called.
case "$1" in
start)
su - oracle -c "lsnrctl start" >>/var/startdb.log
su - oracle -c "dbstart" >>/var/startdb.log
;;
stop)
su - oracle -c "dbshut" >>/var/stopdb.log
su - oracle -c "lsnrctl stop" >>/var/stopdb.log
;;
esac
exit 0
3. 修改剛才新建立的oracle檔案許可權
[root@pxboracle]# chmod 755 /etc/rc.d/init.d/oracle
4.建立連結,建立啟動與關閉介面的連線(S打頭的是啟動程式,K打頭的是關閉程式)
liunx圖形介面啟動的檔案在rc5.d目錄下
linux圖形介面下的自啟動在rc5.d
[root@pxboracle]# ln -s /etc/rc.d/init.d/oracle /etc/rc.d/rc5.d/S99oracle
需要在關機或重啟機器之前停止資料庫
linux圖形介面下的關閉服務連結
[root@pxboracle]# ln -s /etc/rc.d/init.d/oracle /etc/rc.d/rc5.d/K99oracle
liunx非圖形介面啟動的檔案在rc3.d目錄下
linux文字介面下的自啟動在rc3.d
[root@pxboracle]# ln -s /etc/rc.d/init.d/oracle /etc/rc.d/rc3.d/S99oracle
需要在關機或重啟機器之前停止資料庫
linux文字介面下的關閉服務連結
[root@pxboracle]# ln -s /etc/rc.d/init.d/oracle /etc/rc.d/rc3.d/K99oracle
上面的“S99oracle”和“K99oracle”檔案也都要設定為可執行檔案
[root@pxboracle]# chmod 777 /etc/rc.d/rc5.d/S99oracle
[root@pxboracle]# chmod 777 /etc/rc.d/rc5.d/K99oracle
[root@pxboracle]# chmod 777 /etc/rc.d/rc3.d/S99oracle
[root@pxboracle]# chmod 777 /etc/rc.d/rc3.d/K99oracle
4. 新增oracle自動啟動到服務中
[root@pxboracle]#chkconfig --add oracle
[root@pxboracle]#chkconfig --list oracle
5. 先使用如下方法測試下
[root@pxboracle]# service oracle start //啟動oracle
[root@pxboracle]# service oracle stop //關閉oracle
[root@pxboracle]# service oracle restart //重啟oracle
6. 重啟系統
[root@pxboracle]#reboot
7.至此完成linux啟動時自動啟動oracle,如何檢查是否成功.
1、檢視日誌檔案/var/startdb.log,記錄啟動過程。
[root@pxboracle]#su - oracle 切換到oracle 使用者下
[oracle@pxboracle]#set ORACLE_SID=devdb
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/12798004/viewspace-1143970/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle 隨系統開啟,自動啟動Oracle
- Linux Oracle 隨系統自動啟動LinuxOracle
- linux環境下ORACLE自啟動LinuxOracle
- Linux 下 Oracle隨系統自動啟動和關閉LinuxOracle
- Oracle 最簡單的隨系統自動啟動Oracle
- 3.1.5.8 隨系統啟動自動啟動資料庫資料庫
- CentOS下jar包隨系統啟動CentOSJAR
- WINDOWS環境下ORACLE啟動的問題WindowsOracle
- ORACLE RAC環境下節點自動重啟問題總結Oracle
- Linux下Oracle隨機自動啟動指令碼設定LinuxOracle隨機指令碼
- CentOS SVN 環境搭建配置跟自動部署CentOS
- ORACLE開啟自動跟蹤SQL 功能。OracleSQL
- Oracle Restart環境下的開機啟動指令碼OracleREST指令碼
- 在Linux系統中讓ORACLE自動啟動LinuxOracle
- [Oracle]設定Oracle隨Linux系統開機啟動OracleLinux
- linux下oracle的自動啟動LinuxOracle
- windows下oracle自動啟動指令碼WindowsOracle指令碼
- 配置Oracle資料庫和監聽隨Linux系統自啟動(轉)Oracle資料庫Linux
- 【AUTO】配置Oracle資料庫和監聽隨Linux系統自啟動Oracle資料庫Linux
- oracle 11gR2 grid 叢集資源設定跟隨叢集自動啟動Oracle
- 隨系統啟動關閉的oracle資料庫Oracle資料庫
- Windows環境下Redis啟動多例項WindowsRedis
- AIX sshd不隨系統啟動AI
- oracle10G隨linux自啟動OracleLinux
- Linux下開機自動啟動OracleLinuxOracle
- oracle在AIX下的自啟動OracleAI
- Linux下oracle庫自啟動LinuxOracle
- Solaris下設定Oracle自啟動Oracle
- Windows環境啟動RocketMQWindowsMQ
- RedHat54下設定Oracle自動啟動RedhatOracle
- linux 下oracle10g自動啟動LinuxOracle
- Android系統啟動自動開啟mtklogAndroid
- UNIX自動啟動oracleOracle
- K8S搭建自動化部署環境 Jenkins下載、安裝和啟動K8SJenkins
- 由AIX系統故障導致系統重啟,使Oracle資料庫自動啟動例項AIOracle資料庫
- 在linux環境下啟動時開啟numlock(轉)Linux
- Linux下設定Oracle自啟動LinuxOracle
- Linux 下oracle自啟動指令碼LinuxOracle指令碼