UNIX自動啟動oracle
1、編輯/etc/oratab,設定為Y
2、在/sbin/init.d/目錄下建立一個檔案,並命名為oracle,並授予它555許可權,更改它owner為bin:bin。
$ vi /sbin/init.d/oracle
#!/bin/sh
#
# /sbin/init.d/oracle
case "$1" in
start)
echo "Starting Oracle Databases: "
echo "----------------------------------------------------" >> /var/adm/syslog/oracle.log
date +"! %T %a %D : Starting Oracle Databases as part of system up." >> /var/adm/syslog/oracle.log
echo "----------------------------------------------------" >> /var/adm/syslog/oracle.log
/bin/su - oracle -c dbstart >> /var/adm/syslog/oracle.log
echo "Done."
echo "Starting Oracle Listeners: "
/bin/su - oracle -c "lsnrctl start" >> /var/adm/syslog/oracle.log
echo "Done."
echo ""
echo "----------------------------------------------------" >> /var/adm/syslog/oracle.log
date +"! %T %a %D : Finished." >> /var/adm/syslog/oracle.log
echo "----------------------------------------------------" >> /var/adm/syslog/oracle.log
/bin/touch /var/lock/subsys/oracle
;;
stop)
echo "Shutting Down Oracle Listeners: "
echo "----------------------------------------------------" >> /var/adm/syslog/oracle.log
date +"! %T %a %D : Shutting Down Oracle Databases as part of system down."
>>/var/adm/syslog/oracle.log
echo "----------------------------------------------------" >> /var/adm/syslog/oracle.log
/bin/su - oracle -c "lsnrctl stop" >> /var/adm/syslog/oracle.log
echo "Done."
rm -f /var/lock/subsys/oracle
echo "Shutting Down Oracle Databases: "
su - oracle -c dbshut >> /var/adm/syslog/oracle.log
echo "Done."
echo ""
echo "----------------------------------------------------" >> /var/adm/syslog/oracle.log
date +"! %T %a %D : Finished." >> /var/adm/syslog/oracle.log
echo "----------------------------------------------------" >> /var/adm/syslog/oracle.log
;;
restart)
echo "Restarting Oracle Databases: "
echo "----------------------------------------------------" >> /var/adm/syslog/oracle.log
date +"! %T %a %D : Restarting Oracle Databases as part of system up." >> /var/adm/syslog/oracle.log
echo "----------------------------------------------------" >> /var/adm/syslog/oracle.log
/bin/su - oracle -c dbstop >> /var/adm/syslog/oracle.log
/bin/su - oracle -c dbstart >> /var/adm/syslog/oracle.log
echo "Done."
echo "Restarting Oracle Listeners: "
/bin/su - oracle -c "lsnrctl stop" >> /var/adm/syslog/oracle.log
/bin/su - oracle -c "lsnrctl start" >> /var/adm/syslog/oracle.log
echo "Done."
echo ""
echo "----------------------------------------------------" >> /var/adm/syslog/oracle.log
date +"! %T %a %D : Finished." >> /var/adm/syslog/oracle.log
echo "----------------------------------------------------" >> /var/adm/syslog/oracle.log
/bin/touch /var/lock/subsys/oracle
;;
*)
echo "Usage: oracle {start|stop|restart}"
exit 1
esac
3、建立runlevel directories下的符號連結
ln -s /sbin/init.d/oracle /sbin/rc2.d/S99orastart
ln -s /sbin/init.d/oracle /sbin/rc3.d/S99orastart
ln -s /sbin/init.d/oracle /sbin/rc0.d/K01orastop
4、測試
#/sbin/init.d/oracle start
#/sbin/init.d/oracle stop
#/sbin/init.d/oracle restart
系統啟動日誌在 /etc/rc.log
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/720091/viewspace-1057977/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- UNIX下oracle啟動指令碼Oracle指令碼
- [HPUX] HP Unix server vg自動啟用UXServer
- oracle for linux 自動啟動OracleLinux
- 自動啟動ORACLE Script ServiceOracle
- linux oracle 自動啟動LinuxOracle
- Oracle RAC自啟動Oracle
- oracle 隨系統開啟,自動啟動Oracle
- windows開機自動啟動oracleWindowsOracle
- oracle instance and listener自動啟動Oracle
- 讓oracle自動啟動方法!(轉)Oracle
- oracle開機自啟動Oracle
- 開機自動啟動ORACLE ON LinuxOracleLinux
- 自動重新啟動oracle例項 for windowsOracleWindows
- linux下oracle的自動啟動LinuxOracle
- windows下oracle自動啟動指令碼WindowsOracle指令碼
- 4 配置Oracle資料庫自動啟動Oracle資料庫
- oracle資料庫開機自動啟動Oracle資料庫
- Linux下開機自動啟動OracleLinuxOracle
- Linux Oracle 隨系統自動啟動LinuxOracle
- 自動重新啟動oracle監聽程式 for windowsOracleWindows
- Oracle監聽啟動後自動關閉Oracle
- oracle自動啟動和關閉的方法Oracle
- linux 配置oracle+asm自動啟動LinuxOracleASM
- oracle配置開機自啟動Oracle
- Oracle 12c啟動時PDBs的自動開啟Oracle
- Oracle自動啟動和關閉的方法 (轉)Oracle
- RedHat54下設定Oracle自動啟動RedhatOracle
- linux 下oracle10g自動啟動LinuxOracle
- oracle在AIX下的自啟動OracleAI
- Linux下oracle庫自啟動LinuxOracle
- Solaris下設定Oracle自啟動Oracle
- centos 自動啟動指令碼和自啟動服務CentOS指令碼
- 【OEM】Oracle oem取消開機自動啟動(linux)OracleLinux
- [RAC] Oracle11g RAC禁止DB自動啟動Oracle
- Oracle TNSListener服務啟動後自動停止問題Oracle
- Oracle 最簡單的隨系統自動啟動Oracle
- 在Linux系統中讓ORACLE自動啟動LinuxOracle
- 設定ORACLE GRID CONTROL 自動啟動Oracle