Linux中設定oracle例項和asm同時隨機自動啟動
編輯/etc/oratab檔案,使其包括asm例項和oracle例項的自動啟動行(紅色部分)
[oracle@oracle 10.1]$ cat /etc/oratab # # 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. # # orcl:/oracle/app/10.1:Y +ASM:/oracle/app/10.1:Y |
在$ORACLE_HOME/bin目錄中新建startdb.sh,其內容如下:
[@more@][oracle@oracle 10.1]$ cat $ORACLE_HOME/bin/startdb.sh su - oracle -c 'sh /oracle/app/10.1/bin/dbstart' |
修改$ORACLE_HOME/bin/startdb.sh檔案的許可權,使其對oracle使用者可執行
[oracle@oracle 10.1]$ ls -l $ORACLE_HOME/bin/startdb.sh -rwxrwxrwx 1 oracle oinstall 49 Dec 20 09:56 /oracle/app/10.1/bin/startdb.sh |
修改/etc/inittab檔案,增加asm和startdb.sh指令碼的自動呼叫(紅色的行)
[oracle@oracle 10.1]$ cat /etc/inittab # # inittab This file describes how the INIT process should set up # the system in a certain run-level. # # Author: Miquel van Smoorenburg, # Modified for RHS Linux by Marc Ewing and Donnie Barnes # # Default runlevel. The runlevels used by RHS are: # 0 - halt (Do NOT set initdefault to this) # 1 - Single user mode # 2 - Multiuser, without NFS (The same as 3, if you do not have networking) # 3 - Full multiuser mode # 4 - unused # 5 - X11 # 6 - reboot (Do NOT set initdefault to this) # id:5:initdefault: # System initialization. si::sysinit:/etc/rc.d/rc.sysinit l0:0:wait:/etc/rc.d/rc 0 l1:1:wait:/etc/rc.d/rc 1 l2:2:wait:/etc/rc.d/rc 2 l3:3:wait:/etc/rc.d/rc 3 l4:4:wait:/etc/rc.d/rc 4 l5:5:wait:/etc/rc.d/rc 5 l6:6:wait:/etc/rc.d/rc 6 # Trap CTRL-ALT-DELETE ca::ctrlaltdel:/sbin/shutdown -t3 -r now # When our UPS tells us power has failed, assume we have a few minutes # of power left. Schedule a shutdown for 2 minutes from now. # This does, of course, assume you have powerd installed and your # UPS connected and working correctly. pf::powerfail:/sbin/shutdown -f -h +2 "Power Failure; System Shutting Down" # If power was restored before the shutdown kicked in, cancel it. pr:12345:powerokwait:/sbin/shutdown -c "Power Restored; Shutdown Cancelled" # Run gettys in standard runlevels 1:2345:respawn:/sbin/mingetty tty1 2:2345:respawn:/sbin/mingetty tty2 3:2345:respawn:/sbin/mingetty tty3 4:2345:respawn:/sbin/mingetty tty4 5:2345:respawn:/sbin/mingetty tty5 6:2345:respawn:/sbin/mingetty tty6 # Run xdm in runlevel 5 x:5:respawn:/etc/X11/prefdm -nodaemon h1:35:respawn:/etc/init.d/init.cssd run >/dev/null 2>&1 h2:35:wait:/oracle/app/10.1/bin/startdb.sh >/tmp/stdb.out 2>&1 |
重啟Linux主機,檢視$ORACLE_HOME/startup.log檔案,發現資料庫已經啟動成功
[oracle@oracle 10.1]$ cat $ORACLE_HOME/startup.log Failure 1 contacting CSS daemon logger: Waiting for Oracle CSS service to be available before starting logger: ASM instance +ASM. Wait 1. Failure 1 contacting CSS daemon logger: Waiting for Oracle CSS service to be available before starting logger: ASM instance +ASM. Wait 2. Failure 1 contacting CSS daemon logger: Waiting for Oracle CSS service to be available before starting logger: ASM instance +ASM. Wait 3. CSS appears healthy /oracle/app/10.1/bin/dbstart: Starting up database "+ASM" Sun Dec 20 10:04:19 CST 2009 SQL*Plus: Release 10.2.0.1.0 - Production on Sun Dec 20 10:04:20 2009 Copyright (c) 1982, 2005, Oracle. All rights reserved. SQL> Connected to an idle instance. SQL> ASM instance started Total System Global Area 79691776 bytes Fixed Size 1217812 bytes Variable Size 53308140 bytes ASM Cache 25165824 bytes ASM diskgroups mounted SQL> Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options /oracle/app/10.1/bin/dbstart: ASM instance "+ASM" warm started. /oracle/app/10.1/bin/dbstart: Starting up database "orcl" Sun Dec 20 10:04:37 CST 2009 SQL*Plus: Release 10.2.0.1.0 - Production on Sun Dec 20 10:04:37 2009 Copyright (c) 1982, 2005, Oracle. All rights reserved. SQL> Connected to an idle instance. SQL> ORACLE instance started. Total System Global Area 167772160 bytes Fixed Size 1218292 bytes Variable Size 75499788 bytes Database Buffers 83886080 bytes Redo Buffers 7168000 bytes Database mounted. Database opened. SQL> Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options /oracle/app/10.1/bin/dbstart: Database instance "orcl" warm started. |
--end--
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/22049049/viewspace-1029840/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Linux下Oracle隨機自動啟動指令碼設定LinuxOracle隨機指令碼
- 啟動CRS單例項、設定自動啟動單例
- [Oracle]設定Oracle隨Linux系統開機啟動OracleLinux
- linux下單例項資料庫開機自啟動設定Linux單例資料庫
- linux 中oracle開機啟動設定LinuxOracle
- 自動重新啟動oracle例項 for windowsOracleWindows
- linux 配置oracle+asm自動啟動LinuxOracleASM
- Linux平臺Oracle開機自啟動設定LinuxOracle
- ASM CRS 例項啟動和關閉ASM
- Linux下設定Oracle自啟動LinuxOracle
- postgresql隨機啟動設定SQL隨機
- Oracle單例項+ASM啟動與關閉Oracle單例ASM
- Linux Oracle 隨系統自動啟動LinuxOracle
- linux自動automatic啟動停止多個oracle例項LinuxOracle
- 配置Oracle單例項隨機啟動(11gR2)Oracle單例隨機
- 啟動ASM 例項報錯ASM
- Linux 下 Oracle隨系統自動啟動和關閉LinuxOracle
- RedHat(Linux) Oracle資料庫設定開機自啟動RedhatLinuxOracle資料庫
- 開機自動啟動ORACLE ON LinuxOracleLinux
- 2 Day DBA-管理Oracle例項-關閉和啟動Oracle例項-使用OEMDC關閉和啟動Oracle例項Oracle
- windows下啟動服務時不啟動oracle例項WindowsOracle
- 設定開機自啟動nginx和httpdNginxhttpd
- Oracle之 服務啟動&停止指令碼與開機自啟動(單例項)Oracle指令碼單例
- 設定Oracle資料庫開機自啟動Oracle資料庫
- openoffice啟動和自動啟動設定(centos)CentOS
- Flex ASM自動重定位ASM例項測試FlexASM
- oracle10G隨linux自啟動OracleLinux
- Oracle 10g RAC 系統 OS啟動時CRS及例項自動啟動指令碼Oracle 10g指令碼
- oracle 隨系統開啟,自動啟動Oracle
- Linux下開機自動啟動OracleLinuxOracle
- Window中Oracle服務啟動時並不啟動例項的兩種方法Oracle
- Solaris下設定Oracle自啟動Oracle
- Oracle例項的啟動和關閉Oracle
- TongWeb在Linux下設定開機自啟動WebLinux
- Linux Redis 服務設定開機自啟動LinuxRedis
- Linux MySQL 服務設定開機自啟動LinuxMySql
- oracle 12c RAC安裝,例項不能多節點同時啟動Oracle
- RedHat54下設定Oracle自動啟動RedhatOracle