Oracle RAC 啟動與關閉
Oracle RAC 啟動與關閉
一. 檢查共享裝置
一般情況下, 存放OCR 和 Voting Disk 的OCFS2 或者raw 都是自動啟動的。 如果他們沒有啟動,RAC 肯定是啟動不了的。
1.1 如果使用ocfs2的,檢查ocfs2 狀態
/etc/init.d/o2cb status
在掛載之前,/etc/init.d/o2cb status 顯示為Checking O2CB heartbeat: Not active。
在格式化和掛載檔案系統之前,應驗證 O2CB 在兩個節點上均聯機;O2CB 心跳當前沒有
活動,因為檔案系統還沒有掛載 。掛載之後就會變成active。
mount -t ocfs2 -o datavolume /dev/sdb1 /u02/oradata/orcl
1,2. 如果使用raw device.
[root@raw1 ~]# cd /dev/raw/
[root@raw1 raw]# ls
raw1 raw2
或者:
[root@raw1 init.d]# /etc/init.d/rawdevices status
/dev/raw/raw1: bound to major 8, minor 17
/dev/raw/raw2: bound to major 8, minor 18
1.3. 檢查ASM
/etc/init.d/oracleasm listdisks
二. 自動啟動RAC並檢查相關程式
RAC 在啟動的時候crs 等程式都是自動啟動的:
[root@rac1 init.d]# ls -l /etc/init.d/init.*
-r-xr-xr-x 1 root root 1951 Feb 26 22:38 /etc/init.d/init.crs
-r-xr-xr-x 1 root root 4714 Feb 26 22:38 /etc/init.d/init.crsd
-r-xr-xr-x 1 root root 35394 Feb 26 22:38 /etc/init.d/init.cssd
-r-xr-xr-x 1 root root 3190 Feb 26 22:38 /etc/init.d/init.evmd
我們要檢視一下crs 的狀態:
正常情況下, 程式都是online的:
[root@raw1 bin]# ./crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.raw.db application ONLINE ONLINE raw1
ora.raw.raw.cs application ONLINE ONLINE raw1
ora....aw1.srv application ONLINE ONLINE raw1
ora....aw2.srv application ONLINE ONLINE raw2
ora....w1.inst application ONLINE ONLINE raw1
ora....w2.inst application ONLINE ONLINE raw2
ora....SM1.asm application ONLINE ONLINE raw1
ora....W1.lsnr application ONLINE ONLINE raw1
ora.raw1.gsd application ONLINE ONLINE raw1
ora.raw1.ons application ONLINE ONLINE raw1
ora.raw1.vip application ONLINE ONLINE raw1
ora....SM2.asm application ONLINE ONLINE raw2
ora....W2.lsnr application ONLINE ONLINE raw2
ora.raw2.gsd application ONLINE ONLINE raw2
ora.raw2.ons application ONLINE ONLINE raw2
ora.raw2.vip application ONLINE ONLINE raw2
如果出現以下情況:
[root@rac2 bin]# ./crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.rac.db application ONLINE UNKNOWN rac1
ora....orcl.cs application ONLINE UNKNOWN rac1
ora....ac1.srv application OFFLINE OFFLINE
ora....ac2.srv application OFFLINE OFFLINE
ora....c1.inst application ONLINE UNKNOWN rac1
ora....c2.inst application ONLINE UNKNOWN rac2
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE UNKNOWN rac1
ora.rac1.gsd application ONLINE UNKNOWN rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE UNKNOWN rac2
ora.rac2.gsd application ONLINE UNKNOWN rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2
解決方法:
1. 用crs_stat 檢視程式全部資訊:
[root@rac2 bin]# ./crs_stat
NAME=ora.rac.db
TYPE=application
TARGET=ONLINE
STATE=ONLINE on rac2
NAME=ora.rac1.LISTENER_RAC1.lsnr
TYPE=application
TARGET=ONLINE
STATE=UNKNOWN on rac1
NAME=ora.rac1.gsd
TYPE=application
TARGET=ONLINE
STATE=UNKNOWN on rac1
NAME=ora.rac2.LISTENER_RAC2.lsnr
TYPE=application
TARGET=ONLINE
STATE=UNKNOWN on rac2
... ...
2. 對於offline 的程式,我們可以直接手動的啟動它
[root@rac2 bin]# ./crs_start ora.rac.orcl.rac1.srv
Attempting to start `ora.rac.orcl.rac1.srv` on member `rac1`
Start of `ora.rac.orcl.rac1.srv` on member `rac1` succeeded.
3. 對於UNKNOWN 的程式,我們可以先stop 它, 在start。
[root@rac2 bin]# ./crs_stop ora.rac2.gsd
Attempting to stop `ora.rac2.gsd` on member `rac2`
Stop of `ora.rac2.gsd` on member `rac2` succeeded.
[root@rac2 bin]# ./crs_start ora.rac2.gsd
Attempting to start `ora.rac2.gsd` on member `rac2`
Start of `ora.rac2.gsd` on member `rac2` succeeded.
4. 如果crs_stop不能結束,crs_start 不能啟動的程式,我們有2中方法來解決:
4.1)是用crs_stop -f 引數把crs中狀態是UNKNOWN的服務關掉,然後再用crs_start -f (加一個-f的引數)啟動所有的服務就可以。要分別在兩個節點上執行;
[oracle@rac2 ~]$ crs_start -f ora.ora9i.ora9i2.inst
Attempting to start `ora.ora9i.ora9i2.inst` on member `rac2`
Start of `ora.ora9i.ora9i2.inst` on member `rac2` succeeded.
[oracle@rac2 ~]$ crs_stop -f ora.ora9i.db
Attempting to stop `ora.ora9i.db` on member `rac2`
Stop of `ora.ora9i.db` on member `rac2` succeeded.
4.2)轉換到root使用者下用/etc/init.d/init.crs stop先禁用crs,然後再用/etc/init.d/init.crs start去啟用crs,啟用crs後會自動啟動crs的一系列服務,注意此種方法需要在兩臺節點上都執行;
5. 可以用命令一次啟動和關閉相關程式
[root@rac2 bin]# ./crs_stop -all
[root@rac2 bin]# ./crs_start -all
三. 手動啟動RAC
一般情況下每次節點啟動的時候,所有服務都會自動啟動,如果需要關閉或者啟動某個節點,如下所示
停止RAC:
emctl stop dbconsole
srvctl stop instance -d raw -i raw1
srvctl stop instance -d raw -i raw2
srvctl stop asm -n raw1
srvctl stop asm -n raw2
srvctl stop nodeapps -n raw1
srvctl stop nodeapps -n raw2
啟動RAC:
和上面的步驟正好相反即
srvctl start nodeapps -n raw1
srvctl start nodeapps -n raw2
srvctl start asm -n raw1
srvctl start asm -n raw2
srvctl start instance -d raw -i raw2
srvctl start instance -d orcl -i raw1
emctl start dbconsole
使用 SRVCTL 啟動/停止所有例項及其啟用的服務。
srvctl start database -d orcl
srvctl stop database -d orcl
注:CRS Resource 包括GSD(Global Serveice Daemon),ONS(Oracle Notification Service),VIP, Database, Instance 和 Service. 這些資源被分成2類:
GSD,ONS,VIP 和 Listener 屬於Noteapps類
Database,Instance 和Service 屬於 Database-Related Resource 類。
有關Oracle RAC 的概念,請參考我的blog:
RAC 的一些概念性和原理性的知識
http://blog.csdn.net/tianlesoftware/archive/2010/02/27/5331067.aspx
示例:
[root@raw1 bin]# ./crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.raw.db application ONLINE ONLINE raw1
ora.raw.raw.cs application ONLINE ONLINE raw1
ora....aw1.srv application ONLINE ONLINE raw1
ora....aw2.srv application ONLINE ONLINE raw2
ora....w1.inst application ONLINE ONLINE raw1
ora....w2.inst application ONLINE ONLINE raw2
ora....SM1.asm application ONLINE ONLINE raw1
ora....W1.lsnr application ONLINE ONLINE raw1
ora.raw1.gsd application ONLINE ONLINE raw1
ora.raw1.ons application ONLINE ONLINE raw1
ora.raw1.vip application ONLINE ONLINE raw1
ora....SM2.asm application ONLINE ONLINE raw2
ora....W2.lsnr application ONLINE ONLINE raw2
ora.raw2.gsd application ONLINE ONLINE raw2
ora.raw2.ons application ONLINE ONLINE raw2
ora.raw2.vip application ONLINE ONLINE raw2
[oracle@raw1 ~]$ emctl stop dbconsole
TZ set to PRC
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
Stopping Oracle Enterprise Manager 10g Database Control ...
... Stopped.
[oracle@raw1 ~]$ srvctl stop instance -d raw -i raw1
[oracle@raw1 ~]$ srvctl stop instance -d raw -i raw2
[oracle@raw1 ~]$ srvctl stop asm -n raw1
[oracle@raw1 ~]$ srvctl stop asm -n raw2
[oracle@raw1 ~]$ srvctl stop nodeapps -n raw1
[oracle@raw1 ~]$ srvctl stop nodeapps -n raw2
[oracle@raw1 bin]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.raw.db application OFFLINE OFFLINE
Ora.raw.raw.cs application OFFLINE OFFLINE
ora....aw1.srv application OFFLINE OFFLINE
ora....aw2.srv application OFFLINE OFFLINE
ora....w1.inst application OFFLINE OFFLINE
ora....w2.inst application OFFLINE OFFLINE
ora....SM1.asm application OFFLINE OFFLINE
ora....W1.lsnr application OFFLINE OFFLINE
ora.raw1.gsd application OFFLINE OFFLINE
ora.raw1.ons application OFFLINE OFFLINE
ora.raw1.vip application OFFLINE OFFLINE
ora....SM2.asm application OFFLINE OFFLINE
ora....W2.lsnr application OFFLINE OFFLINE
ora.raw2.gsd application OFFLINE OFFLINE
ora.raw2.ons application OFFLINE OFFLINE
ora.raw2.vip application OFFLINE OFFLINE
四. 在啟動的過程中最好檢測著crs、ASM和資料庫的日誌:
crs日誌:
[oracle@rac1 ~]$ tail -f /u01/app/oracle/product/10.2.0/crs_1/log/rac1/alertrac1.log
[oracle@rac2 ~]$ tail -f /u01/app/oracle/product/10.2.0/crs_1/log/rac2/alertrac2.log
ASM日誌:
[oracle@rac1 ~]$ tail -f /u01/app/oracle/admin/+ASM/bdump/alert_+ASM1.log
[oracle@rac2 ~]$ tail -f /u01/app/oracle/admin/+ASM/bdump/alert_+ASM2.log
資料庫日誌:
[oracle@rac1 ~]$ tail -f /u01/app/oracle/admin/ora9i/bdump/alert_ora9i1.log
[oracle@rac2 ~]$ tail -f /u01/app/oracle/admin/ora9i/bdump/alert_ora9i2.log
注:tail -f命令可用於監視另一個程式正在寫入的檔案的增長。
本文來自CSDN部落格,轉載請標明出處:http://blog.csdn.net/tianlesoftware/archive/2010/03/05/5349003.aspx
[@more@]來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/13879334/viewspace-1035172/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle 11gR2 RAC 叢集服務啟動與關閉總結Oracle
- Oracle11g RAC啟動關閉情況大概總結Oracle
- Oracle RAC自啟動Oracle
- Oracle RAC DRM介紹和關閉DRMOracle
- 啟動與關閉服務
- oracle資料庫的啟動關閉與各種服務Oracle資料庫
- Oracle RAC啟動失敗(DNS故障)OracleDNS
- Oracle RAC的自定義service自啟動Oracle
- Oracle RAC常見啟動失敗故障分析Oracle
- Oracle 11g關閉開啟AWROracle
- 3 啟動和關閉
- Oracle RAC啟動因CTSS導致的異常Oracle
- win10系統快速啟動怎麼關閉 關閉Windows快速啟動Win10Windows
- 9. 啟動、關閉tomcatTomcat
- 01啟動(關閉)套接字
- centos下nginx啟動、重啟、關閉CentOSNginx
- win10快速啟動怎麼關閉_win10如何關閉快速啟動Win10
- 【ASM】Oracle RAC css啟動報錯"Duplicate voting file found"ASMOracleCSS
- Oracle RAC啟動失敗-軟連結惹的禍Oracle
- windows10怎麼關閉快速啟動_windows10關閉快速啟動的方法Windows
- oracle RAC手動配置互信Oracle
- win10 自動重啟關閉方法_win10自動重啟怎麼關閉Win10
- 如何關閉win10快速啟動_win10系統快速啟動怎麼關閉Win10
- Oracle RAC 環境 引數檔案的啟動順序Oracle
- nginx關閉/重啟/啟動的操作方法Nginx
- golang程式優雅關閉與重啟Golang
- Oracle RAC簡介與要點Oracle
- MySQL啟動和關閉命令總結MySql
- Oracle RAC DG手動切換Oracle
- Oracle 12c RAC CSSD程式無法啟動real time模式OracleCSS模式
- ORA-29702複製RAC Oracle軟體啟動單例項Oracle單例
- Oracle 12.2 Heavy swapping 資料庫自動關閉OracleAPP資料庫
- Oracle資料庫歸檔模式的開啟和關閉Oracle資料庫模式
- oracle RACOracle
- win10啟動管理器關閉的方法_win10關閉啟動管理器的方法Win10
- win10開機自啟動程式關閉方法_win10怎麼關閉開機啟動項Win10
- ORACLE RAC開啟歸檔的正確姿勢與ORA-01126Oracle
- Android 書本開啟和關閉動畫Android動畫
- Linux下的MongoDB安裝&啟動&關閉LinuxMongoDB