Oracle 10g 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://space.itpub.net/28673746/viewspace-758726
示例:
[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.
http://raw1:1158/em/console/aboutApplication
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命令可用於監視另一個程式正在寫入的檔案的增長。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28673746/viewspace-758727/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【NETWORK】Oracle RAC 心跳地址配置說明Oracle
- oracle常用維護查詢Oracle
- Oracle 10g RAC故障處理Oracle 10g
- 【ORACLE】Oracle常用SQL及重點功能說明OracleSQL
- 【PDB】Oracle pdb維護常用sql命令OracleSQL
- Oracle 10g RAC 資料儲存更換Oracle 10g
- AIX 5.3 Install Oracle 10g RAC 錯誤集錦AIOracle 10g
- imutable.js常用增刪改查操作說明JS
- Oracle Latch 說明Oracle
- 10g RAC on AIXAI
- git 操作說明Git
- rac叢集日常維護命令
- winscp操作說明,winscp操作說明的詳細解讀
- oracle orapwd使用說明Oracle
- 【ROWID】Oracle rowid說明Oracle
- Oracle 19C RAC實施方案詳細說明-常見問題07Oracle
- Oracle OGG日常維護Oracle
- 4.4 停止和重新啟動Oracle Restart進行維護操作OracleREST
- Mysql常用的維護 SQLMySql
- Oracle RAC日常運維-ASM磁碟擴容Oracle運維ASM
- Oracle運維指令碼-巡檢(RAC版)Oracle運維指令碼
- Oracle RAC日常運維-DATA磁碟組故障Oracle運維
- 『與善仁』Appium基礎 — 26、常用手機操作的API說明APPAPI
- linux常用核心引數說明Linux
- Oracle Table建立引數說明Oracle
- Oracle 官方文件 結構說明Oracle
- 10. Oracle常用高可用方案——10.2. RACOracle
- Oracle DG運維常用SQLOracle運維SQL
- Oracle 常用運維命令整理Oracle運維
- 資料庫常用維護命令資料庫
- ORACLE LOB大欄位維護Oracle
- ORACLE user profile配置/管理/維護Oracle
- Swagger2常用註解說明Swagger
- RedisTemplate常用集合使用說明-opsForZSet(六)Redis
- RedisTemplate常用集合使用說明-boundSetOps(九)Redis
- RU 和 RUR oracle補丁說明Oracle
- 雙棧維護頭尾操作
- oracle RACOracle
- Docker 使用者操作使用說明Docker