當前位置:
首頁 >
Oracle 10g RAC 维护工具完全详解
發布時間:2024/1/8
33
豆豆
生活随笔
收集整理的這篇文章主要介紹了
Oracle 10g RAC 维护工具完全详解
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
節點層:olsnodes
網絡層:oifcfg
集群層:crsctl、ocrcheck、ocrdump、ocrconfig
應用層:srvctl、onsctl、crs_stat
一、olsnodes 的使用
[root@rac22 ~]# olsnodes -h
Usage: olsnodes [-n] [-p] [-i] [<node> | -l] [-g] [-v]
? ? ? ? where
? ? ? ? ? ? ? ? -n print node number with the node name
? ? ? ? ? ? ? ? -p print private interconnect name with the node name
? ? ? ? ? ? ? ? -i print virtual IP name with the node name
? ? ? ? ? ? ? ? <node> print information for the specified node
? ? ? ? ? ? ? ? -l print information for the local node?
? ? ? ? ? ? ? ? -g turn on logging?
? ? ? ? ? ? ? ? -v run in verbose mode?
-----------顯示每個節點的node id
[root@rac22 ~]# olsnodes -n?
rac11 ? 1
rac22 ? 2
[root@rac22 ~]# olsnodes -n rac22
rac22 ? 2
------------顯示節點用于 private interconnect 的網卡名稱及節點信息
[root@rac22 ~]# olsnodes -p
rac11 ? priv11
rac22 ? priv22
[root@rac22 ~]# olsnodes -p -n rac22
rac22 ? 2 ? ? ? priv22
------------顯示節點的 VIP
[root@rac22 ~]# olsnodes -n -p -i
rac11 ? 1 ? ? ? priv11 ?vip11
rac22 ? 2 ? ? ? priv22 ?vip22
[root@rac22 ~]# olsnodes -p -i -n rac22
rac22 ? 2 ? ? ? priv22 ?vip22
------------顯示詳細的node信息
[root@rac22 ~]# olsnodes -v
prlslms: Initializing LXL global
prlsndmain: Initializing CLSS context
prlsmemberlist: No of cluster members configured = 256
prlsmemberlist: Getting information for nodenum = 1
prlsmemberlist: node_name = rac11
prlsmemberlist: ctx->lsdata->node_num = 1
prls_printdata: Printing the node data
rac11
prlsmemberlist: Getting information for nodenum = 2
prlsmemberlist: node_name = rac22
prlsmemberlist: ctx->lsdata->node_num = 2
prls_printdata: Printing the node data
rac22
prlsndmain: olsnodes executed successfully
prlsndterm: Terminating LSF
二、oifcfg 命令的使用
[root@rac22 ~]# oifcfg
Name:
? ? ? ? oifcfg - Oracle Interface Configuration Tool.
Usage: ?oifcfg iflist [-p [-n]]
? ? ? ? oifcfg setif {-node <nodename> | -global} {<if_name>/<subnet>:<if_type>}...
? ? ? ? oifcfg getif [-node <nodename> | -global] [ -if <if_name>[/<subnet>] [-type <if_type>] ]
? ? ? ? oifcfg delif [-node <nodename> | -global] [<if_name>[/<subnet>]]
? ? ? ? oifcfg [-help]
? ? ? ? <nodename> - name of the host, as known to a communications network
? ? ? ? <if_name> ?- name by which the interface is configured in the system
? ? ? ? <subnet> ? - subnet address of the interface
? ? ? ? <if_type> ?- type of the interface { cluster_interconnect | public | storage }
--------iflist 顯示網口列表
[root@rac22 ~]# oifcfg iflist
eth0 ?192.168.10.0
eth1 ?10.10.10.0
[root@rac22 ~]# oifcfg iflist -p -n
eth0 ?192.168.10.0 ?PRIVATE ?255.255.255.0
eth1 ?10.10.10.0 ?PRIVATE ?255.255.255.0
--------gettif 可以獲得單個網口的信息
[root@rac22 ~]# oifcfg getif
eth0 ?192.168.10.0 ?global ?public
eth1 ?10.10.10.0 ?global ?cluster_interconnect
------ -node 查詢節點特定的信息,僅當節點有區別于global的配置時才會有結果顯示
[root@rac22 ~]# oifcfg getif -node rac11
[root@rac22 ~]# oifcfg getif -node rac22
------ -global 查詢節點的 global 類型設置
[root@rac22 ~]# oifcfg getif -global rac22
eth0 ?192.168.10.0 ?global ?public
eth1 ?10.10.10.0 ?global ?cluster_interconnect
[root@rac22 ~]# oifcfg getif -global rac11
eth0 ?192.168.10.0 ?global ?public
eth1 ?10.10.10.0 ?global ?cluster_interconnect
[root@rac22 ~]# oifcfg getif -global
eth0 ?192.168.10.0 ?global ?public
eth1 ?10.10.10.0 ?global ?cluster_interconnect
------ -type ?查看public 類型的網卡配置
[root@rac22 ~]# oifcfg getif -type public
eth0 ?192.168.10.0 ?global ?public
------ -type ?查看public 類型的網卡配置
[root@rac22 ~]# oifcfg getif -type cluster_interconnect
eth1 ?10.10.10.0 ?global ?cluster_interconnect
--------setif 配置單個網口
------ 通過 setif 添加向集群新的網卡
usage:oifcfg setif {-node <nodename> | -global} {<if_name>/<subnet>:<if_type>}...
其中 -global/node 必須指定
[root@rac22 ~]# oifcfg setif -global eth2/10.10.11.11:public
[root@rac22 ~]# oifcfg setif -node rac22 eth3/10.10.11.12:public
[root@rac22 ~]# oifcfg getif -global?
eth0 ?192.168.10.0 ?global ?public
eth1 ?10.10.10.0 ?global ?cluster_interconnect
eth2 ?10.10.11.11 ?global ?public
[root@rac22 ~]# oifcfg getif -node rac22
eth3 ?10.10.11.12 ?rac22 ?public
注意這里的添加網卡命令并不會校驗網卡是否真的存在,即使是沒有這兩個網卡,也是可以添加成功的,但是setif命令已經修改了相應的配置文件
并生效。
--------delif 刪除網口
------ 使用delif 刪除剛剛添加的不存在網卡
[root@rac22 ~]# oifcfg delif -global
[root@rac22 ~]# oifcfg delif -node rac22
上面的兩個命令會刪除所有的網卡設置不推薦使用,通常我們會特指相應的網卡進行刪除
[root@rac22 ~]# oifcfg delif -global eth2/10.10.11.11
[root@rac22 ~]# oifcfg delif -node rac22 /eth3/10.10.11.12
網絡故障及解決辦法:RAC 環境無法識別心跳網絡的故障
新裝 RAC 環境,數據庫啟動日志中發現:No cluster interconnect
首先查看初始化參數 cluster_interconnects 是否設置
SQL> show parameter cluster
NAME ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? TYPE ? ? ? ?VALUE
------------------------------------ ----------- ------------------------------
cluster_database ? ? ? ? ? ? ? ? ? ? boolean ? ? TRUE
cluster_database_instances ? ? ? ? ? integer ? ? 2
cluster_interconnects ? ? ? ? ? ? ? ?string
然后查看如下視圖:
SQL> col host_name for a20
SQL> select INSTANCE_NUMBER,INSTANCE_NAME,HOST_NAME,NAME_KSXPIA network_interface,IP_KSXPIA private_ip from x$ksxpia cross join v$instance where PUB_KSXPIA= 'N';
INSTANCE_NUMBER INSTANCE_NAME ? ?HOST_NAME ? ? ? ? ? ?NETWORK_INTERFA PRIVATE_IP
--------------- ---------------- -------------------- --------------- ----------------
? ? ? ? ? ? ? 2 PROD2 ? ? ? ? ? ?rac22 ? ? ? ? ? ? ? ?eth1 ? ? ? ? ? ?10.10.10.22
注意,這里是正常情況下查詢結果,如果是故障情況下,此查詢將無結果。
在用 oifcfg iflist -p -v
[oracle@rac22 ~]$ oifcfg ?iflist -p -n
eth0 ?192.168.10.0 ?PRIVATE ?255.255.255.0
eth1 ?10.10.10.0 ?PRIVATE ?255.255.255.0
如果上面的命令和連接查詢均查不到結果,則表示,cluster在安裝配置過程中,未將 cluster_interconnect 信息注冊到 OCR 中,要解決此問題
我們并不需要重新安裝和配置集群環境,只需使用 oifcfg 命令稍作配置即可
我們需要先停止數據庫
[root@rac11 ~]# srvctl stop database -d prod
然后使用 oifcfg setif 命令添加一個 cluster_interconnect 網卡(必須存在)即可
[root@rac11 ~]# oifcfg setif -global eth1/10.10.10.11:cluster_interconnect
然后查看添加結果:
[root@rac11 ~]# oifcfg getif -global
eth0 ?192.168.10.0 ?global ?public
eth1 ?10.10.10.0 ?global ?cluster_interconnect
最后重啟節點上的所有 CRS 資源(或服務),然后再重啟數據庫。
[root@rac11 ~]# crsctl stop crs
---------------- crsctl 命令的用法
集群層的命令包括 crsctl\ocrcheck\ocrdump\ocrconfig ,其中后三個都是針對 OCR 磁盤操作的命令
crsctl 可以用來查看 CRS 進程棧,每個CRS進程的狀態,管理 voting disk,跟蹤 CRS 進程等功能。
可以不帶任何參數查詢其用法:
[root@rac11 ~]# crsctl
Usage: crsctl check ?crs ? ? ? ? ?- checks the viability of the CRS stack
? ? ? ?crsctl check ?cssd ? ? ? ? - checks the viability of CSS
? ? ? ?crsctl check ?crsd ? ? ? ? - checks the viability of CRS
? ? ? ?crsctl check ?evmd ? ? ? ? - checks the viability of EVM
? ? ? ?crsctl set ? ?css <parameter> <value> - sets a parameter override
? ? ? ?crsctl get ? ?css <parameter> - gets the value of a CSS parameter
? ? ? ?crsctl unset ?css <parameter> - sets CSS parameter to its default
? ? ? ?crsctl query ?css votedisk ? ?- lists the voting disks used by CSS
? ? ? ?crsctl add ? ?css votedisk <path> - adds a new voting disk
? ? ? ?crsctl delete css votedisk <path> - removes a voting disk
? ? ? ?crsctl enable ?crs ? ?- enables startup for all CRS daemons
? ? ? ?crsctl disable crs ? ?- disables startup for all CRS daemons
? ? ? ?crsctl start crs ?- starts all CRS daemons.
? ? ? ?crsctl stop ?crs ?- stops all CRS daemons. Stops CRS resources in case of cluster.
? ? ? ?crsctl start resources ?- starts CRS resources.?
? ? ? ?crsctl stop resources ?- stops ?CRS resources.?
? ? ? ?crsctl debug statedump evm ?- dumps state info for evm objects
? ? ? ?crsctl debug statedump crs ?- dumps state info for crs objects
? ? ? ?crsctl debug statedump css ?- dumps state info for css objects
? ? ? ?crsctl debug log css [module:level]{,module:level} ...?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ?- Turns on debugging for CSS?
? ? ? ?crsctl debug trace css - dumps CSS in-memory tracing cache
? ? ? ?crsctl debug log crs [module:level]{,module:level} ...?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ?- Turns on debugging for CRS?
? ? ? ?crsctl debug trace crs - dumps CRS in-memory tracing cache
? ? ? ?crsctl debug log evm [module:level]{,module:level} ...?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ?- Turns on debugging for EVM
? ? ? ?crsctl debug trace evm - dumps EVM in-memory tracing cache
? ? ? ?crsctl debug log res <resname:level> turns on debugging for resources
? ? ? ?crsctl query crs softwareversion [<nodename>] - lists the version of CRS software installed
? ? ? ?crsctl query crs activeversion - lists the CRS software operating version
? ? ? ?crsctl lsmodules css - lists the CSS modules that can be used for debugging
? ? ? ?crsctl lsmodules crs - lists the CRS modules that can be used for debugging
? ? ? ?crsctl lsmodules evm - lists the EVM modules that can be used for debugging
?If necesary any of these commands can be run with additional tracing by
?adding a "trace" argument at the very front.
?Example: crsctl trace check css
?
------ 查看整個 CRS 棧狀態
?[root@rac11 ~]# crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy
------ 查看 CRS 棧中各個組件(cssd\crsd\evmd)的狀態
[root@rac11 ~]# crsctl check cssd
CSS appears healthy
[root@rac11 ~]# crsctl check crsd
CRS appears healthy
[root@rac11 ~]# crsctl check evmd
EVM appears healthy
------ 設置 CRS 棧是否自動啟動
? ? ? ?crsctl enable ?crs ? ?- enables startup for all CRS daemons
? ? ? ?crsctl disable crs ? ?- disables startup for all CRS daemons
? ? ? ?有時出于維護需要,可能要關閉 CRS 棧自動啟動
[root@rac11 ~]# crsctl disable crs
[root@rac11 ~]# crsctl enable crs
------ 啟動和停止 CRS 棧
在 Oracle 10.1 中必須重啟 clusterware,在 Oracle 10.2 以后的版本中可以通過如下命令進行啟動和關閉 CRS 棧的操作:
[root@rac11 ~]# crsctl stop crs
Stopping resources.
Successfully stopped CRS resources?
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued
------ 執行上述命令后的結果
[oracle@rac22 ~]$ crs_stat -t -v
Name ? ? ? ? ? Type ? ? ? ? ? R/RA ? F/FT ? Target ? ?State ? ? Host ? ? ? ?
----------------------------------------------------------------------
ora....D1.inst application ? ?0/5 ? ?0/0 ? ?ONLINE ? ?OFFLINE ? ? ? ? ? ? ??
ora....D2.inst application ? ?0/5 ? ?0/0 ? ?ONLINE ? ?ONLINE ? ?rac22 ? ? ??
ora.PROD.db ? ?application ? ?0/1 ? ?0/1 ? ?ONLINE ? ?ONLINE ? ?rac22 ? ? ??
ora....SM1.asm application ? ?0/5 ? ?0/0 ? ?ONLINE ? ?OFFLINE ? ? ? ? ? ? ??
ora....11.lsnr application ? ?0/5 ? ?0/0 ? ?ONLINE ? ?OFFLINE ? ? ? ? ? ? ??
ora.rac11.gsd ?application ? ?0/5 ? ?0/0 ? ?ONLINE ? ?OFFLINE ? ? ? ? ? ? ??
ora.rac11.ons ?application ? ?0/3 ? ?0/0 ? ?ONLINE ? ?OFFLINE ? ? ? ? ? ? ??
ora.rac11.vip ?application ? ?0/0 ? ?0/0 ? ?ONLINE ? ?OFFLINE ? ? ? ? ? ? ??
ora....SM2.asm application ? ?0/5 ? ?0/0 ? ?ONLINE ? ?ONLINE ? ?rac22 ? ? ??
ora....22.lsnr application ? ?0/5 ? ?0/0 ? ?ONLINE ? ?ONLINE ? ?rac22 ? ? ??
ora.rac22.gsd ?application ? ?0/5 ? ?0/0 ? ?ONLINE ? ?ONLINE ? ?rac22 ? ? ??
ora.rac22.ons ?application ? ?0/3 ? ?0/0 ? ?ONLINE ? ?ONLINE ? ?rac22 ? ? ??
ora.rac22.vip ?application ? ?0/0 ? ?0/0 ? ?ONLINE ? ?ONLINE ? ?rac22
注意在一個node上執行,只會停止該節點上的 CRS?
[root@rac11 ~]# crsctl start crs
Attempting to start CRS stack?
The CRS stack will be started shortly
------經crs_stat -t -v 觀察啟動過程會很慢,暫不清楚其具體過程
------ 查看 votedisk 磁盤的位置
[oracle@rac22 ~]$ crsctl query css votedisk
?0. ? ? 0 ? ?/dev/raw/raw2
located 1 votedisk(s).
------ 查看和修改 CRS 參數
使用 get 命令查看參數
[oracle@rac22 ~]$ crsctl get css misscount
60
使用 set 命令修改參數(慎用,必須以 root 用戶執行)
[root@rac11 ~]# crsctl set css misscount 100
Configuration parameter misscount is now set to 100.
[root@rac11 ~]# crsctl set css misscount 60
Configuration parameter misscount is now set to 60.
CRS 由 CRS\CSS\EVM 3 個服務組成,每個服務又由一系列的 module 組成, 可以使用 crsctl對每個module進行跟蹤,并把跟蹤內容記錄到日志中。
[root@rac11 ~]# crsctl lsmodules css
The following are the CSS modules ::?
? ? CSSD
? ? COMMCRS
? ? COMMNS
[root@rac11 ~]# crsctl lsmodules evm
The following are the EVM modules ::?
? ?EVMD
? ?EVMDMAIN
? ?EVMCOMM
? ?EVMEVT
? ?EVMAPP
? ?EVMAGENT
? ?CRSOCR
? ?CLUCLS
? ?CSSCLNT
? ?COMMCRS
? ?COMMNS
[root@rac11 ~]# crsctl lsmodules crs
The following are the CRS modules ::?
? ? CRSUI
? ? CRSCOMM
? ? CRSRTI
? ? CRSMAIN
? ? CRSPLACE
? ? CRSAPP
? ? CRSRES
? ? CRSCOMM
? ? CRSOCR
? ? CRSTIMER
? ? CRSEVT
? ? CRSD
? ? CLUCLS
? ? CSSCLNT
? ? COMMCRS
? ? COMMNS
以下以跟蹤 CSSD 模塊為例講述如何操作(必須以root用戶執行):
[root@rac11 ~]# crsctl debug log css "CSSD:1"
Configuration parameter trace is now set to 1.
Set CRSD Debug Module: CSSD ?Level: 1
查看跟蹤產生的日志信息:
[root@rac11 ~]# tail -f /u01/crs10.2.0/log/rac11/cssd/ocssd.log?
[ ? ?CSSD]2012-07-16 10:45:06.480 [100371360] >TRACE: ? clssgmClientConnectMsg: Connect from con(0xb6707fb8) proc(0xb6728e50) pid() proto(10:2:1:1)
[ ? ?CSSD]2012-07-16 10:45:57.613 [100371360] >TRACE: ? clssgmClientConnectMsg: Connect from con(0xb67269c0) proc(0xb6727af8) pid() proto(10:2:1:1)
[ ? ?CSSD]2012-07-16 10:46:58.567 [100371360] >TRACE: ? clssgmClientConnectMsg: Connect from con(0xb6707fb8) proc(0xb67087c0) pid() proto(10:2:1:1)
[ ? ?CSSD]2012-07-16 10:47:59.701 [100371360] >TRACE: ? clssgmClientConnectMsg: Connect from con(0xb6707fb8) proc(0xb6708848) pid() proto(10:2:1:1)
[ ? ?CSSD]2012-07-16 10:49:01.148 [100371360] >TRACE: ? clssgmClientConnectMsg: Connect from con(0xb6707fb8) proc(0xb6708848) pid() proto(10:2:1:1)
[ ? ?CSSD]2012-07-16 10:50:02.570 [100371360] >TRACE: ? clssgmClientConnectMsg: Connect from con(0xb6707fb8) proc(0xb6708848) pid() proto(10:2:1:1)
[ ? ?CSSD]2012-07-16 10:51:03.946 [100371360] >TRACE: ? clssgmClientConnectMsg: Connect from con(0xb6707fb8) proc(0xb6708848) pid() proto(10:2:1:1)
[ ? ?CSSD]2012-07-16 10:51:19.703 [40508320] >TRACE: ? clssscSetDebugLevel: The logging level is set to 1 ,the cache level is set to
------- 維護 votedisk
圖形化界面安裝 clusterware 過程中,配置 votedisk 時,如果選擇 external redundancy 策略,則只能選一個 votedisk
其實,即使選擇了該選項也可以使用crsctl 命令添加多塊 votedisk 盤,這些 votedisk 盤可以互為鏡像。
votedisk 采用多數可用算法,如果存在多個 votedisk ,則必須有一半以上的 votedisk 可用時集群才能正常工作。
例如,如果一個cluster配置了4個 votedisk ,當其中有一個votedisk 損壞時,集群能夠正常工作,但是當其中有兩個 votedisk 損壞時,
集群就無法工作了,會立即宕機。
votedisk 的添加原則:奇數個,操作前必須先停止數據庫、ASM、CRS Stack ,操作時必須加上 -force 參數。
------- 添加 votedisk 示例:
1、創建共享磁盤:
在Windows主機上進入Oracle Virtual Box 的安裝路徑:
VBoxManage createhd --filename G:\share2\share2.vdi --size 4000 --format VDI --variant Fixed
在G:\Shared2目錄下創建共享磁盤,大小為4g
將剛剛創建的共享磁盤添加到node1和node2虛擬主機
? ? ? 首先,關閉兩個節點主機node1和node2,然后執行以下兩條語句
? ? VBoxManage storageattach rac11 --storagectl "IDE 控制器" --port 1 --device 1 --type hdd --medium G:\share2\share3.vdi --mtype shareable
? ? VBoxManage storageattach rac22 --storagectl "IDE 控制器" --port 0 --device 1 --type hdd --medium G:\share2\share3.vdi --mtype shareable
? ? ? --storagectl "IDE 控制器" :在虛擬機看到的名稱,如果是英文版的,可能名稱不一樣
? ? ? ? ?--port 0 ?:第一個IDE接口
? ? ? ? ?--device 1 ?:IDE接口的輔盤,主盤為 0
啟用共享磁盤
? ? ? ?VBoxManage modifyhd G:\share2\share2.vdi --type shareable
2、當前 votedisk 的位置:
[root@rac22 ~]# crsctl query css votedisk
?0. ? ? 0 ? ?/dev/raw/raw2
located 1 votedisk(s).
3、停止所有節點上的 CRS
[root@rac11 ~]# crsctl stop crs
Stopping resources.
Successfully stopped CRS resources?
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
[root@rac11 ~]# crsctl check crs
Failure 1 contacting CSS daemon
Cannot communicate with CRS
Cannot communicate with EVM?
4、添加 votedisk (添加兩個使votedisk 個數為奇數)
[root@rac11 ~]# crsctl add css votedisk /dev/raw/raw5
Cluster is not in a ready state for online disk addition
即使是在 CRS 關閉后,也必須指定 -force 參數來添加或刪除 votedisk。且 -force 參數只有在 CRS 關閉時使用才安全。
[root@rac11 ~]# crsctl add css votedisk -force /dev/raw/raw5
Now formatting voting disk: /dev/raw/raw5
successful addition of votedisk /dev/raw/raw5.
[root@rac11 ~]# crsctl add css votedisk -force /dev/raw/raw6
Now formatting voting disk: /dev/raw/raw6
successful addition of votedisk /dev/raw/raw6.
5、查詢添加結果
[root@rac22 ~]# crsctl query css votedisk
?0. ? ? 0 ? ?/dev/raw/raw2
?1. ? ? 0 ? ?/dev/raw/raw5
?2. ? ? 0 ? ?/dev/raw/raw6
located 3 votedisk(s).
6、啟動 CRS
[root@rac22 ~]# crsctl start crs
Attempting to start CRS stack?
The CRS stack will be started shortly
[root@rac11 ~]# crsctl start crs
Attempting to start CRS stack?
The CRS stack will be started shortly
-------- 刪除 votedisk 示例:
1、查看 votedisk 路徑
[root@rac11 ~]# crsctl query css votedisk
?0. ? ? 0 ? ?/dev/raw/raw2
?1. ? ? 0 ? ?/dev/raw/raw5
?2. ? ? 0 ? ?/dev/raw/raw6
2、停止所有節點上的 crs
[root@rac11 ~]# crsctl stop crs
Stopping resources.
Successfully stopped CRS resources?
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
[root@rac22 ~]# crsctl stop crs
Stopping resources.
Successfully stopped CRS resources?
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
3、刪除 votedisk
[root@rac11 ~]# crsctl | grep votedisk
? ? ? ?crsctl query ?css votedisk ? ?- lists the voting disks used by CSS
? ? ? ?crsctl add ? ?css votedisk <path> - adds a new voting disk
? ? ? ?crsctl delete css votedisk <path> - removes a voting disk
[root@rac11 ~]# crsctl delete css votedisk /dev/raw/raw6 -force
successful deletion of votedisk /dev/raw/raw6.
4、查看是否刪除成功
[root@rac11 ~]# crsctl query css votedisk
?0. ? ? 0 ? ?/dev/raw/raw2
?1. ? ? 0 ? ?/dev/raw/raw5
located 2 votedisk(s).
---------- OCR 命令
OCR disk 是用于存放整個集群的配置信息共享存儲。在整個集群中只能有一個節點對 OCR DISK 進行寫操作,叫 Master Node。
所有節點在內存中都會保留一份OCR的副本,同時有一個 OCR process 從這個內存中讀取內容。OCR 內容發生改變時,由Master Node 的 OCR
process 負責同步到其他節點的 OCR process。
OCR 的內容非常重要,Oracle 每 4 個小時會對其做一次備份,并保留最近的3個備份以及前一天、前一周的最后一個備份,備份工作有 Master Node 的 CRSD
進程來完成。默認備份路徑為:$CRS_HOME/crs/cdata/cluster_name
OCR 維護相關的命令
--------ocrdump 的用法
ocrdump 可以按 ASCII 的方式打印輸出 OCR 的內容,但這個命令不能用作 OCR 的備份恢復,僅供閱讀 OCR 不供恢復 OCR。
[root@rac22 ~]# ocrdump -h
Name:
? ? ? ? ocrdump - Dump contents of Oracle Cluster Registry to a file.
Synopsis:
? ? ? ? ocrdump [<filename>|-stdout] [-backupfile <backupfilename>] [-keyname <keyname>] [-xml] [-noheader]
Description:
? ? ? ? Default filename is OCRDUMPFILE. Examples are:
? ? ? ? prompt> ocrdump
? ? ? ? writes cluster registry contents to OCRDUMPFILE in the current directory
? ? ? ? prompt> ocrdump MYFILE
? ? ? ? writes cluster registry contents to MYFILE in the current directory
? ? ? ? prompt> ocrdump -stdout -keyname SYSTEM
? ? ? ? writes the subtree of SYSTEM in the cluster registry to stdout
? ? ? ? prompt> ocrdump -stdout -xml
? ? ? ? writes cluster registry contents to stdout in xml format
Notes:
? ? ? ? The header information will be retrieved based on best effort basis.
? ? ? ? A log file will be created in
? ? ? ? $ORACLE_HOME/log/<hostname>/client/ocrdump_<pid>.log. Make sure
? ? ? ? you have file creation privileges in the above directory before
? ? ? ? running this tool.
-------- 將 SYSTEM.css 鍵的內容以 .xml 格式打印輸出到屏幕
OCR key 主要有三類:SYSTEM、DATABASE、CRS
[oracle@rac11 ~]$ ocrdump -stdout -keyname SYSTEM.css -xml | more
<OCRDUMP>
<TIMESTAMP>07/16/2012 10:12:34</TIMESTAMP>
<COMMAND>ocrdump -stdout -keyname SYSTEM.css -xml </COMMAND>
<KEY>
<NAME>SYSTEM.css</NAME>
<VALUE_TYPE>UNDEF</VALUE_TYPE>
<VALUE><![CDATA[]]></VALUE>
<USER_PERMISSION>PROCR_ALL_ACCESS</USER_PERMISSION>
<GROUP_PERMISSION>PROCR_READ</GROUP_PERMISSION>
<OTHER_PERMISSION>PROCR_READ</OTHER_PERMISSION>
<USER_NAME>root</USER_NAME>
<GROUP_NAME>root</GROUP_NAME>
..................................
..................................
該命令將在 $CRS_HOME/log/node_name/client目錄下產生日志文件,格式為 ocrdump_pid.ora,pid 為進程號
--------- 將 SYSTEM.css key 的內容以文件形式打印輸出
[root@rac11 client]# ocrdump '/home/oracle/ocrdump_test.log' -keyname SYSTEM.css -xml
---------------ocrcheck 命令
ocrcheck 命令用于檢查 OCR 內容的一致性:命令執行過程中會在此目錄下產生日志 $ORACLE_HOME/log/<hostname>/client/ocrcheck_<pid>.log?
ocrcheck 命令不需要參數
[oracle@rac11 ~]$ ocrcheck -h
Name:
? ? ? ? ocrcheck - Displays health of Oracle Cluster Registry.
Synopsis:
? ? ? ? ocrcheck?
Description:
? ? ? ? prompt> ocrcheck
? ? ? ? Displays current usage, location and health of the cluster registry
Notes:
? ? ? ? A log file will be created in
? ? ? ? $ORACLE_HOME/log/<hostname>/client/ocrcheck_<pid>.log. Please ensure
? ? ? ? you have file creation privileges in the above directory before
? ? ? ? running this tool.
如果 OCR 內容一致,則產生的輸出如下:
[root@rac22 ~]# ocrcheck
Status of Oracle Cluster Registry is as follows :
? ? ? ? ?Version ? ? ? ? ? ? ? ? ?: ? ? ? ? ?2
? ? ? ? ?Total space (kbytes) ? ? : ? ? 204712
? ? ? ? ?Used space (kbytes) ? ? ?: ? ? ? 3840
? ? ? ? ?Available space (kbytes) : ? ? 200872
? ? ? ? ?ID ? ? ? ? ? ? ? ? ? ? ? : 1788954814
? ? ? ? ?Device/File Name ? ? ? ? : /dev/raw/raw1
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Device/File integrity check succeeded
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Device/File not configured
? ? ? ? ?Cluster registry integrity check succeeded
如果不一致則產生如下輸出:
[root@rac22 ~]# ocrcheck
Status of Oracle Cluster Registry is as follows :
? ? ? ? ?Version ? ? ? ? ? ? ? ? ?: ? ? ? ? ?2
? ? ? ? ?Total space (kbytes) ? ? : ? ? 204712
? ? ? ? ?Used space (kbytes) ? ? ?: ? ? ? 3840
? ? ? ? ?Available space (kbytes) : ? ? 200872
? ? ? ? ?ID ? ? ? ? ? ? ? ? ? ? ? : 1788954814
? ? ? ? ?Device/File Name ? ? ? ? : /dev/raw/raw1
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Device/File need to be synchronized with the other device
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Device/File not configured
? ? ? ? ?Cluster registry integrity check succeeded
------------- ocrconfig 命令
ocrconfig 命令用于維護 OCR 磁盤。
在安裝 clusterware 過程中如果選擇 external redundancy ,則只能指定一個 OCR disk。但是 Oracle 允許且只允許配置兩個 OCR disk 互為
鏡像,以防止 OCR 磁盤發生單點故障。OCR 磁盤和 votedisk 不一樣,最多只能有兩個,一個為 Primary OCR 一個為 Mirror OCR。
[root@rac22 ~]# ocrconfig -h
Name:
? ? ? ? ocrconfig - Configuration tool for Oracle Cluster Registry.
Synopsis:
? ? ? ? ocrconfig [option]
? ? ? ? option:
? ? ? ? ? ? ? ? -export <filename> [-s online]
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? - Export cluster register contents to a file
? ? ? ? ? ? ? ? -import <filename> ? ? ? ? ? ? ? ? ?- Import cluster registry contents from a file
? ? ? ? ? ? ? ? -upgrade [<user> [<group>]]
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? - Upgrade cluster registry from previous version
? ? ? ? ? ? ? ? -downgrade [-version <version string>]
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? - Downgrade cluster registry to the specified version
? ? ? ? ? ? ? ? -backuploc <dirname> ? ? ? ? ? ? ? ?- Configure periodic backup location
? ? ? ? ? ? ? ? -showbackup ? ? ? ? ? ? ? ? ? ? ? ? - Show backup information
? ? ? ? ? ? ? ? -restore <filename> ? ? ? ? ? ? ? ? - Restore from physical backup
? ? ? ? ? ? ? ? -replace ocr|ocrmirror [<filename>] - Add/replace/remove a OCR device/file
? ? ? ? ? ? ? ? -overwrite ? ? ? ? ? ? ? ? ? ? ? ? ?- Overwrite OCR configuration on disk
? ? ? ? ? ? ? ? -repair ocr|ocrmirror <filename> ? ?- Repair local OCR configuration
? ? ? ? ? ? ? ? -help ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? - Print out this help information
Note:
? ? ? ? A log file will be created in
? ? ? ? $ORACLE_HOME/log/<hostname>/client/ocrconfig_<pid>.log. Please ensure
? ? ? ? you have file creation privileges in the above directory before
? ? ? ? running this tool.
---------使用 ocrconfig 查看自動備份
[root@rac22 ~]# ocrconfig -showbackup
---------修改 OCR 自動備份的位置
默認位置為:$OCR_HOME/crs/cdata/cluster_name/
[root@rac22 ~]# ocrconfig -backuploc /home/oracle/backup
---------使用導出、導入進行備份和恢復
Oracle建議在對集群做調整(增加、刪除節點)之前,對OCR進行備份,可以使用 export 備份到指定文件。如果做了 replace 或 restore 操作,Oracle
還建議使用 cluvfy compocr-n all 做一次全面的檢查。
1、首先關閉所有節點的 CRS
[root@rac22 ~]# crsctl stop crs
Stopping resources.
Successfully stopped CRS resources?
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
2、導出 OCR 的內容(必須以 root 權限)
[root@rac22 ocr_backup]# ocrconfig -export ocrexp.exp ?/home/oracle/ocr_backup/ocrexp.exp
3、重啟 CRS
[root@rac11 ~]# crsctl start crs
Attempting to start CRS stack?
The CRS stack will be started shortly
[root@rac22 ~]# crsctl start crs
Attempting to start CRS stack?
The CRS stack will be started shortly
4、檢查 CRS 狀態
[root@rac11 ~]# crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy
[root@rac22 ~]# crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy
5、破壞 OCR 內容
[root@rac11 ~]# dd if=/dev/zero of=/dev/raw/raw1 bs=1024 count=200
200+0 records in
200+0 records out
6、運行 cluvfy 工具檢查 OCR 一致性(失敗)
[root@rac11 ~]# /soft/clusterware/cluvfy/runcluvfy.sh comp ocr -n all
Verifying OCR integrity?
ERROR:?
User equivalence unavailable on all the nodes.
Verification cannot proceed.
Verification of OCR integrity was unsuccessful on all the nodes.?
7、使用ocrcheck 檢查 OCR 的一致性
[root@rac11 ~]# ocrcheck
PROT-601: Failed to initialize ocrcheck
8、使用 import 恢復 OCR 的內容
[root@rac11 ~]# ocrconfig -import /home/oracle/ocr_backup/ocrexp.exp?
PROT-19: Cannot proceed while clusterware is running. Shutdown clusterware first
先關閉 CRS,然后再執行 import 恢復
在本例中,因為是在打開 CRS 的時候破壞了 OCR,因此是無法成功關閉 CRS 的,關閉時會報錯。只能重啟系統,重啟后CRS將無法啟動這時
執行上述命令即可成功:
[root@rac11 ~]# ocrconfig -import /home/oracle/ocr_backup/ocrexp.exp
9、再次使用 ocrcheck 檢查一致性狀態(通過)
[root@rac11 ~]# ocrcheck
Status of Oracle Cluster Registry is as follows :
? ? ? ? ?Version ? ? ? ? ? ? ? ? ?: ? ? ? ? ?2
? ? ? ? ?Total space (kbytes) ? ? : ? ? 204712
? ? ? ? ?Used space (kbytes) ? ? ?: ? ? ? 3840
? ? ? ? ?Available space (kbytes) : ? ? 200872
? ? ? ? ?ID ? ? ? ? ? ? ? ? ? ? ? : ?825485411
? ? ? ? ?Device/File Name ? ? ? ? : /dev/raw/raw1
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Device/File integrity check succeeded
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Device/File not configured
? ? ? ? ?Cluster registry integrity check succeeded
10、使用cluvfy工具檢查(通過)。
[root@rac11 ~]# /soft/clusterware/cluvfy/runcluvfy.sh comp ocr -n all
Verifying OCR integrity?
ERROR:?
User equivalence unavailable on all the nodes.
Verification cannot proceed.
Verification of OCR integrity was unsuccessful on all the nodes.?
----------這里檢測的結果不成功,不知何因。
11、啟動 CRS
crsctl start crs
網絡層:oifcfg
集群層:crsctl、ocrcheck、ocrdump、ocrconfig
應用層:srvctl、onsctl、crs_stat
一、olsnodes 的使用
[root@rac22 ~]# olsnodes -h
Usage: olsnodes [-n] [-p] [-i] [<node> | -l] [-g] [-v]
? ? ? ? where
? ? ? ? ? ? ? ? -n print node number with the node name
? ? ? ? ? ? ? ? -p print private interconnect name with the node name
? ? ? ? ? ? ? ? -i print virtual IP name with the node name
? ? ? ? ? ? ? ? <node> print information for the specified node
? ? ? ? ? ? ? ? -l print information for the local node?
? ? ? ? ? ? ? ? -g turn on logging?
? ? ? ? ? ? ? ? -v run in verbose mode?
-----------顯示每個節點的node id
[root@rac22 ~]# olsnodes -n?
rac11 ? 1
rac22 ? 2
[root@rac22 ~]# olsnodes -n rac22
rac22 ? 2
------------顯示節點用于 private interconnect 的網卡名稱及節點信息
[root@rac22 ~]# olsnodes -p
rac11 ? priv11
rac22 ? priv22
[root@rac22 ~]# olsnodes -p -n rac22
rac22 ? 2 ? ? ? priv22
------------顯示節點的 VIP
[root@rac22 ~]# olsnodes -n -p -i
rac11 ? 1 ? ? ? priv11 ?vip11
rac22 ? 2 ? ? ? priv22 ?vip22
[root@rac22 ~]# olsnodes -p -i -n rac22
rac22 ? 2 ? ? ? priv22 ?vip22
------------顯示詳細的node信息
[root@rac22 ~]# olsnodes -v
prlslms: Initializing LXL global
prlsndmain: Initializing CLSS context
prlsmemberlist: No of cluster members configured = 256
prlsmemberlist: Getting information for nodenum = 1
prlsmemberlist: node_name = rac11
prlsmemberlist: ctx->lsdata->node_num = 1
prls_printdata: Printing the node data
rac11
prlsmemberlist: Getting information for nodenum = 2
prlsmemberlist: node_name = rac22
prlsmemberlist: ctx->lsdata->node_num = 2
prls_printdata: Printing the node data
rac22
prlsndmain: olsnodes executed successfully
prlsndterm: Terminating LSF
二、oifcfg 命令的使用
[root@rac22 ~]# oifcfg
Name:
? ? ? ? oifcfg - Oracle Interface Configuration Tool.
Usage: ?oifcfg iflist [-p [-n]]
? ? ? ? oifcfg setif {-node <nodename> | -global} {<if_name>/<subnet>:<if_type>}...
? ? ? ? oifcfg getif [-node <nodename> | -global] [ -if <if_name>[/<subnet>] [-type <if_type>] ]
? ? ? ? oifcfg delif [-node <nodename> | -global] [<if_name>[/<subnet>]]
? ? ? ? oifcfg [-help]
? ? ? ? <nodename> - name of the host, as known to a communications network
? ? ? ? <if_name> ?- name by which the interface is configured in the system
? ? ? ? <subnet> ? - subnet address of the interface
? ? ? ? <if_type> ?- type of the interface { cluster_interconnect | public | storage }
--------iflist 顯示網口列表
[root@rac22 ~]# oifcfg iflist
eth0 ?192.168.10.0
eth1 ?10.10.10.0
[root@rac22 ~]# oifcfg iflist -p -n
eth0 ?192.168.10.0 ?PRIVATE ?255.255.255.0
eth1 ?10.10.10.0 ?PRIVATE ?255.255.255.0
--------gettif 可以獲得單個網口的信息
[root@rac22 ~]# oifcfg getif
eth0 ?192.168.10.0 ?global ?public
eth1 ?10.10.10.0 ?global ?cluster_interconnect
------ -node 查詢節點特定的信息,僅當節點有區別于global的配置時才會有結果顯示
[root@rac22 ~]# oifcfg getif -node rac11
[root@rac22 ~]# oifcfg getif -node rac22
------ -global 查詢節點的 global 類型設置
[root@rac22 ~]# oifcfg getif -global rac22
eth0 ?192.168.10.0 ?global ?public
eth1 ?10.10.10.0 ?global ?cluster_interconnect
[root@rac22 ~]# oifcfg getif -global rac11
eth0 ?192.168.10.0 ?global ?public
eth1 ?10.10.10.0 ?global ?cluster_interconnect
[root@rac22 ~]# oifcfg getif -global
eth0 ?192.168.10.0 ?global ?public
eth1 ?10.10.10.0 ?global ?cluster_interconnect
------ -type ?查看public 類型的網卡配置
[root@rac22 ~]# oifcfg getif -type public
eth0 ?192.168.10.0 ?global ?public
------ -type ?查看public 類型的網卡配置
[root@rac22 ~]# oifcfg getif -type cluster_interconnect
eth1 ?10.10.10.0 ?global ?cluster_interconnect
--------setif 配置單個網口
------ 通過 setif 添加向集群新的網卡
usage:oifcfg setif {-node <nodename> | -global} {<if_name>/<subnet>:<if_type>}...
其中 -global/node 必須指定
[root@rac22 ~]# oifcfg setif -global eth2/10.10.11.11:public
[root@rac22 ~]# oifcfg setif -node rac22 eth3/10.10.11.12:public
[root@rac22 ~]# oifcfg getif -global?
eth0 ?192.168.10.0 ?global ?public
eth1 ?10.10.10.0 ?global ?cluster_interconnect
eth2 ?10.10.11.11 ?global ?public
[root@rac22 ~]# oifcfg getif -node rac22
eth3 ?10.10.11.12 ?rac22 ?public
注意這里的添加網卡命令并不會校驗網卡是否真的存在,即使是沒有這兩個網卡,也是可以添加成功的,但是setif命令已經修改了相應的配置文件
并生效。
--------delif 刪除網口
------ 使用delif 刪除剛剛添加的不存在網卡
[root@rac22 ~]# oifcfg delif -global
[root@rac22 ~]# oifcfg delif -node rac22
上面的兩個命令會刪除所有的網卡設置不推薦使用,通常我們會特指相應的網卡進行刪除
[root@rac22 ~]# oifcfg delif -global eth2/10.10.11.11
[root@rac22 ~]# oifcfg delif -node rac22 /eth3/10.10.11.12
網絡故障及解決辦法:RAC 環境無法識別心跳網絡的故障
新裝 RAC 環境,數據庫啟動日志中發現:No cluster interconnect
首先查看初始化參數 cluster_interconnects 是否設置
SQL> show parameter cluster
NAME ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? TYPE ? ? ? ?VALUE
------------------------------------ ----------- ------------------------------
cluster_database ? ? ? ? ? ? ? ? ? ? boolean ? ? TRUE
cluster_database_instances ? ? ? ? ? integer ? ? 2
cluster_interconnects ? ? ? ? ? ? ? ?string
然后查看如下視圖:
SQL> col host_name for a20
SQL> select INSTANCE_NUMBER,INSTANCE_NAME,HOST_NAME,NAME_KSXPIA network_interface,IP_KSXPIA private_ip from x$ksxpia cross join v$instance where PUB_KSXPIA= 'N';
INSTANCE_NUMBER INSTANCE_NAME ? ?HOST_NAME ? ? ? ? ? ?NETWORK_INTERFA PRIVATE_IP
--------------- ---------------- -------------------- --------------- ----------------
? ? ? ? ? ? ? 2 PROD2 ? ? ? ? ? ?rac22 ? ? ? ? ? ? ? ?eth1 ? ? ? ? ? ?10.10.10.22
注意,這里是正常情況下查詢結果,如果是故障情況下,此查詢將無結果。
在用 oifcfg iflist -p -v
[oracle@rac22 ~]$ oifcfg ?iflist -p -n
eth0 ?192.168.10.0 ?PRIVATE ?255.255.255.0
eth1 ?10.10.10.0 ?PRIVATE ?255.255.255.0
如果上面的命令和連接查詢均查不到結果,則表示,cluster在安裝配置過程中,未將 cluster_interconnect 信息注冊到 OCR 中,要解決此問題
我們并不需要重新安裝和配置集群環境,只需使用 oifcfg 命令稍作配置即可
我們需要先停止數據庫
[root@rac11 ~]# srvctl stop database -d prod
然后使用 oifcfg setif 命令添加一個 cluster_interconnect 網卡(必須存在)即可
[root@rac11 ~]# oifcfg setif -global eth1/10.10.10.11:cluster_interconnect
然后查看添加結果:
[root@rac11 ~]# oifcfg getif -global
eth0 ?192.168.10.0 ?global ?public
eth1 ?10.10.10.0 ?global ?cluster_interconnect
最后重啟節點上的所有 CRS 資源(或服務),然后再重啟數據庫。
[root@rac11 ~]# crsctl stop crs
---------------- crsctl 命令的用法
集群層的命令包括 crsctl\ocrcheck\ocrdump\ocrconfig ,其中后三個都是針對 OCR 磁盤操作的命令
crsctl 可以用來查看 CRS 進程棧,每個CRS進程的狀態,管理 voting disk,跟蹤 CRS 進程等功能。
可以不帶任何參數查詢其用法:
[root@rac11 ~]# crsctl
Usage: crsctl check ?crs ? ? ? ? ?- checks the viability of the CRS stack
? ? ? ?crsctl check ?cssd ? ? ? ? - checks the viability of CSS
? ? ? ?crsctl check ?crsd ? ? ? ? - checks the viability of CRS
? ? ? ?crsctl check ?evmd ? ? ? ? - checks the viability of EVM
? ? ? ?crsctl set ? ?css <parameter> <value> - sets a parameter override
? ? ? ?crsctl get ? ?css <parameter> - gets the value of a CSS parameter
? ? ? ?crsctl unset ?css <parameter> - sets CSS parameter to its default
? ? ? ?crsctl query ?css votedisk ? ?- lists the voting disks used by CSS
? ? ? ?crsctl add ? ?css votedisk <path> - adds a new voting disk
? ? ? ?crsctl delete css votedisk <path> - removes a voting disk
? ? ? ?crsctl enable ?crs ? ?- enables startup for all CRS daemons
? ? ? ?crsctl disable crs ? ?- disables startup for all CRS daemons
? ? ? ?crsctl start crs ?- starts all CRS daemons.
? ? ? ?crsctl stop ?crs ?- stops all CRS daemons. Stops CRS resources in case of cluster.
? ? ? ?crsctl start resources ?- starts CRS resources.?
? ? ? ?crsctl stop resources ?- stops ?CRS resources.?
? ? ? ?crsctl debug statedump evm ?- dumps state info for evm objects
? ? ? ?crsctl debug statedump crs ?- dumps state info for crs objects
? ? ? ?crsctl debug statedump css ?- dumps state info for css objects
? ? ? ?crsctl debug log css [module:level]{,module:level} ...?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ?- Turns on debugging for CSS?
? ? ? ?crsctl debug trace css - dumps CSS in-memory tracing cache
? ? ? ?crsctl debug log crs [module:level]{,module:level} ...?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ?- Turns on debugging for CRS?
? ? ? ?crsctl debug trace crs - dumps CRS in-memory tracing cache
? ? ? ?crsctl debug log evm [module:level]{,module:level} ...?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ?- Turns on debugging for EVM
? ? ? ?crsctl debug trace evm - dumps EVM in-memory tracing cache
? ? ? ?crsctl debug log res <resname:level> turns on debugging for resources
? ? ? ?crsctl query crs softwareversion [<nodename>] - lists the version of CRS software installed
? ? ? ?crsctl query crs activeversion - lists the CRS software operating version
? ? ? ?crsctl lsmodules css - lists the CSS modules that can be used for debugging
? ? ? ?crsctl lsmodules crs - lists the CRS modules that can be used for debugging
? ? ? ?crsctl lsmodules evm - lists the EVM modules that can be used for debugging
?If necesary any of these commands can be run with additional tracing by
?adding a "trace" argument at the very front.
?Example: crsctl trace check css
?
------ 查看整個 CRS 棧狀態
?[root@rac11 ~]# crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy
------ 查看 CRS 棧中各個組件(cssd\crsd\evmd)的狀態
[root@rac11 ~]# crsctl check cssd
CSS appears healthy
[root@rac11 ~]# crsctl check crsd
CRS appears healthy
[root@rac11 ~]# crsctl check evmd
EVM appears healthy
------ 設置 CRS 棧是否自動啟動
? ? ? ?crsctl enable ?crs ? ?- enables startup for all CRS daemons
? ? ? ?crsctl disable crs ? ?- disables startup for all CRS daemons
? ? ? ?有時出于維護需要,可能要關閉 CRS 棧自動啟動
[root@rac11 ~]# crsctl disable crs
[root@rac11 ~]# crsctl enable crs
------ 啟動和停止 CRS 棧
在 Oracle 10.1 中必須重啟 clusterware,在 Oracle 10.2 以后的版本中可以通過如下命令進行啟動和關閉 CRS 棧的操作:
[root@rac11 ~]# crsctl stop crs
Stopping resources.
Successfully stopped CRS resources?
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued
------ 執行上述命令后的結果
[oracle@rac22 ~]$ crs_stat -t -v
Name ? ? ? ? ? Type ? ? ? ? ? R/RA ? F/FT ? Target ? ?State ? ? Host ? ? ? ?
----------------------------------------------------------------------
ora....D1.inst application ? ?0/5 ? ?0/0 ? ?ONLINE ? ?OFFLINE ? ? ? ? ? ? ??
ora....D2.inst application ? ?0/5 ? ?0/0 ? ?ONLINE ? ?ONLINE ? ?rac22 ? ? ??
ora.PROD.db ? ?application ? ?0/1 ? ?0/1 ? ?ONLINE ? ?ONLINE ? ?rac22 ? ? ??
ora....SM1.asm application ? ?0/5 ? ?0/0 ? ?ONLINE ? ?OFFLINE ? ? ? ? ? ? ??
ora....11.lsnr application ? ?0/5 ? ?0/0 ? ?ONLINE ? ?OFFLINE ? ? ? ? ? ? ??
ora.rac11.gsd ?application ? ?0/5 ? ?0/0 ? ?ONLINE ? ?OFFLINE ? ? ? ? ? ? ??
ora.rac11.ons ?application ? ?0/3 ? ?0/0 ? ?ONLINE ? ?OFFLINE ? ? ? ? ? ? ??
ora.rac11.vip ?application ? ?0/0 ? ?0/0 ? ?ONLINE ? ?OFFLINE ? ? ? ? ? ? ??
ora....SM2.asm application ? ?0/5 ? ?0/0 ? ?ONLINE ? ?ONLINE ? ?rac22 ? ? ??
ora....22.lsnr application ? ?0/5 ? ?0/0 ? ?ONLINE ? ?ONLINE ? ?rac22 ? ? ??
ora.rac22.gsd ?application ? ?0/5 ? ?0/0 ? ?ONLINE ? ?ONLINE ? ?rac22 ? ? ??
ora.rac22.ons ?application ? ?0/3 ? ?0/0 ? ?ONLINE ? ?ONLINE ? ?rac22 ? ? ??
ora.rac22.vip ?application ? ?0/0 ? ?0/0 ? ?ONLINE ? ?ONLINE ? ?rac22
注意在一個node上執行,只會停止該節點上的 CRS?
[root@rac11 ~]# crsctl start crs
Attempting to start CRS stack?
The CRS stack will be started shortly
------經crs_stat -t -v 觀察啟動過程會很慢,暫不清楚其具體過程
------ 查看 votedisk 磁盤的位置
[oracle@rac22 ~]$ crsctl query css votedisk
?0. ? ? 0 ? ?/dev/raw/raw2
located 1 votedisk(s).
------ 查看和修改 CRS 參數
使用 get 命令查看參數
[oracle@rac22 ~]$ crsctl get css misscount
60
使用 set 命令修改參數(慎用,必須以 root 用戶執行)
[root@rac11 ~]# crsctl set css misscount 100
Configuration parameter misscount is now set to 100.
[root@rac11 ~]# crsctl set css misscount 60
Configuration parameter misscount is now set to 60.
CRS 由 CRS\CSS\EVM 3 個服務組成,每個服務又由一系列的 module 組成, 可以使用 crsctl對每個module進行跟蹤,并把跟蹤內容記錄到日志中。
[root@rac11 ~]# crsctl lsmodules css
The following are the CSS modules ::?
? ? CSSD
? ? COMMCRS
? ? COMMNS
[root@rac11 ~]# crsctl lsmodules evm
The following are the EVM modules ::?
? ?EVMD
? ?EVMDMAIN
? ?EVMCOMM
? ?EVMEVT
? ?EVMAPP
? ?EVMAGENT
? ?CRSOCR
? ?CLUCLS
? ?CSSCLNT
? ?COMMCRS
? ?COMMNS
[root@rac11 ~]# crsctl lsmodules crs
The following are the CRS modules ::?
? ? CRSUI
? ? CRSCOMM
? ? CRSRTI
? ? CRSMAIN
? ? CRSPLACE
? ? CRSAPP
? ? CRSRES
? ? CRSCOMM
? ? CRSOCR
? ? CRSTIMER
? ? CRSEVT
? ? CRSD
? ? CLUCLS
? ? CSSCLNT
? ? COMMCRS
? ? COMMNS
以下以跟蹤 CSSD 模塊為例講述如何操作(必須以root用戶執行):
[root@rac11 ~]# crsctl debug log css "CSSD:1"
Configuration parameter trace is now set to 1.
Set CRSD Debug Module: CSSD ?Level: 1
查看跟蹤產生的日志信息:
[root@rac11 ~]# tail -f /u01/crs10.2.0/log/rac11/cssd/ocssd.log?
[ ? ?CSSD]2012-07-16 10:45:06.480 [100371360] >TRACE: ? clssgmClientConnectMsg: Connect from con(0xb6707fb8) proc(0xb6728e50) pid() proto(10:2:1:1)
[ ? ?CSSD]2012-07-16 10:45:57.613 [100371360] >TRACE: ? clssgmClientConnectMsg: Connect from con(0xb67269c0) proc(0xb6727af8) pid() proto(10:2:1:1)
[ ? ?CSSD]2012-07-16 10:46:58.567 [100371360] >TRACE: ? clssgmClientConnectMsg: Connect from con(0xb6707fb8) proc(0xb67087c0) pid() proto(10:2:1:1)
[ ? ?CSSD]2012-07-16 10:47:59.701 [100371360] >TRACE: ? clssgmClientConnectMsg: Connect from con(0xb6707fb8) proc(0xb6708848) pid() proto(10:2:1:1)
[ ? ?CSSD]2012-07-16 10:49:01.148 [100371360] >TRACE: ? clssgmClientConnectMsg: Connect from con(0xb6707fb8) proc(0xb6708848) pid() proto(10:2:1:1)
[ ? ?CSSD]2012-07-16 10:50:02.570 [100371360] >TRACE: ? clssgmClientConnectMsg: Connect from con(0xb6707fb8) proc(0xb6708848) pid() proto(10:2:1:1)
[ ? ?CSSD]2012-07-16 10:51:03.946 [100371360] >TRACE: ? clssgmClientConnectMsg: Connect from con(0xb6707fb8) proc(0xb6708848) pid() proto(10:2:1:1)
[ ? ?CSSD]2012-07-16 10:51:19.703 [40508320] >TRACE: ? clssscSetDebugLevel: The logging level is set to 1 ,the cache level is set to
------- 維護 votedisk
圖形化界面安裝 clusterware 過程中,配置 votedisk 時,如果選擇 external redundancy 策略,則只能選一個 votedisk
其實,即使選擇了該選項也可以使用crsctl 命令添加多塊 votedisk 盤,這些 votedisk 盤可以互為鏡像。
votedisk 采用多數可用算法,如果存在多個 votedisk ,則必須有一半以上的 votedisk 可用時集群才能正常工作。
例如,如果一個cluster配置了4個 votedisk ,當其中有一個votedisk 損壞時,集群能夠正常工作,但是當其中有兩個 votedisk 損壞時,
集群就無法工作了,會立即宕機。
votedisk 的添加原則:奇數個,操作前必須先停止數據庫、ASM、CRS Stack ,操作時必須加上 -force 參數。
------- 添加 votedisk 示例:
1、創建共享磁盤:
在Windows主機上進入Oracle Virtual Box 的安裝路徑:
VBoxManage createhd --filename G:\share2\share2.vdi --size 4000 --format VDI --variant Fixed
在G:\Shared2目錄下創建共享磁盤,大小為4g
將剛剛創建的共享磁盤添加到node1和node2虛擬主機
? ? ? 首先,關閉兩個節點主機node1和node2,然后執行以下兩條語句
? ? VBoxManage storageattach rac11 --storagectl "IDE 控制器" --port 1 --device 1 --type hdd --medium G:\share2\share3.vdi --mtype shareable
? ? VBoxManage storageattach rac22 --storagectl "IDE 控制器" --port 0 --device 1 --type hdd --medium G:\share2\share3.vdi --mtype shareable
? ? ? --storagectl "IDE 控制器" :在虛擬機看到的名稱,如果是英文版的,可能名稱不一樣
? ? ? ? ?--port 0 ?:第一個IDE接口
? ? ? ? ?--device 1 ?:IDE接口的輔盤,主盤為 0
啟用共享磁盤
? ? ? ?VBoxManage modifyhd G:\share2\share2.vdi --type shareable
2、當前 votedisk 的位置:
[root@rac22 ~]# crsctl query css votedisk
?0. ? ? 0 ? ?/dev/raw/raw2
located 1 votedisk(s).
3、停止所有節點上的 CRS
[root@rac11 ~]# crsctl stop crs
Stopping resources.
Successfully stopped CRS resources?
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
[root@rac11 ~]# crsctl check crs
Failure 1 contacting CSS daemon
Cannot communicate with CRS
Cannot communicate with EVM?
4、添加 votedisk (添加兩個使votedisk 個數為奇數)
[root@rac11 ~]# crsctl add css votedisk /dev/raw/raw5
Cluster is not in a ready state for online disk addition
即使是在 CRS 關閉后,也必須指定 -force 參數來添加或刪除 votedisk。且 -force 參數只有在 CRS 關閉時使用才安全。
[root@rac11 ~]# crsctl add css votedisk -force /dev/raw/raw5
Now formatting voting disk: /dev/raw/raw5
successful addition of votedisk /dev/raw/raw5.
[root@rac11 ~]# crsctl add css votedisk -force /dev/raw/raw6
Now formatting voting disk: /dev/raw/raw6
successful addition of votedisk /dev/raw/raw6.
5、查詢添加結果
[root@rac22 ~]# crsctl query css votedisk
?0. ? ? 0 ? ?/dev/raw/raw2
?1. ? ? 0 ? ?/dev/raw/raw5
?2. ? ? 0 ? ?/dev/raw/raw6
located 3 votedisk(s).
6、啟動 CRS
[root@rac22 ~]# crsctl start crs
Attempting to start CRS stack?
The CRS stack will be started shortly
[root@rac11 ~]# crsctl start crs
Attempting to start CRS stack?
The CRS stack will be started shortly
-------- 刪除 votedisk 示例:
1、查看 votedisk 路徑
[root@rac11 ~]# crsctl query css votedisk
?0. ? ? 0 ? ?/dev/raw/raw2
?1. ? ? 0 ? ?/dev/raw/raw5
?2. ? ? 0 ? ?/dev/raw/raw6
2、停止所有節點上的 crs
[root@rac11 ~]# crsctl stop crs
Stopping resources.
Successfully stopped CRS resources?
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
[root@rac22 ~]# crsctl stop crs
Stopping resources.
Successfully stopped CRS resources?
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
3、刪除 votedisk
[root@rac11 ~]# crsctl | grep votedisk
? ? ? ?crsctl query ?css votedisk ? ?- lists the voting disks used by CSS
? ? ? ?crsctl add ? ?css votedisk <path> - adds a new voting disk
? ? ? ?crsctl delete css votedisk <path> - removes a voting disk
[root@rac11 ~]# crsctl delete css votedisk /dev/raw/raw6 -force
successful deletion of votedisk /dev/raw/raw6.
4、查看是否刪除成功
[root@rac11 ~]# crsctl query css votedisk
?0. ? ? 0 ? ?/dev/raw/raw2
?1. ? ? 0 ? ?/dev/raw/raw5
located 2 votedisk(s).
---------- OCR 命令
OCR disk 是用于存放整個集群的配置信息共享存儲。在整個集群中只能有一個節點對 OCR DISK 進行寫操作,叫 Master Node。
所有節點在內存中都會保留一份OCR的副本,同時有一個 OCR process 從這個內存中讀取內容。OCR 內容發生改變時,由Master Node 的 OCR
process 負責同步到其他節點的 OCR process。
OCR 的內容非常重要,Oracle 每 4 個小時會對其做一次備份,并保留最近的3個備份以及前一天、前一周的最后一個備份,備份工作有 Master Node 的 CRSD
進程來完成。默認備份路徑為:$CRS_HOME/crs/cdata/cluster_name
OCR 維護相關的命令
--------ocrdump 的用法
ocrdump 可以按 ASCII 的方式打印輸出 OCR 的內容,但這個命令不能用作 OCR 的備份恢復,僅供閱讀 OCR 不供恢復 OCR。
[root@rac22 ~]# ocrdump -h
Name:
? ? ? ? ocrdump - Dump contents of Oracle Cluster Registry to a file.
Synopsis:
? ? ? ? ocrdump [<filename>|-stdout] [-backupfile <backupfilename>] [-keyname <keyname>] [-xml] [-noheader]
Description:
? ? ? ? Default filename is OCRDUMPFILE. Examples are:
? ? ? ? prompt> ocrdump
? ? ? ? writes cluster registry contents to OCRDUMPFILE in the current directory
? ? ? ? prompt> ocrdump MYFILE
? ? ? ? writes cluster registry contents to MYFILE in the current directory
? ? ? ? prompt> ocrdump -stdout -keyname SYSTEM
? ? ? ? writes the subtree of SYSTEM in the cluster registry to stdout
? ? ? ? prompt> ocrdump -stdout -xml
? ? ? ? writes cluster registry contents to stdout in xml format
Notes:
? ? ? ? The header information will be retrieved based on best effort basis.
? ? ? ? A log file will be created in
? ? ? ? $ORACLE_HOME/log/<hostname>/client/ocrdump_<pid>.log. Make sure
? ? ? ? you have file creation privileges in the above directory before
? ? ? ? running this tool.
-------- 將 SYSTEM.css 鍵的內容以 .xml 格式打印輸出到屏幕
OCR key 主要有三類:SYSTEM、DATABASE、CRS
[oracle@rac11 ~]$ ocrdump -stdout -keyname SYSTEM.css -xml | more
<OCRDUMP>
<TIMESTAMP>07/16/2012 10:12:34</TIMESTAMP>
<COMMAND>ocrdump -stdout -keyname SYSTEM.css -xml </COMMAND>
<KEY>
<NAME>SYSTEM.css</NAME>
<VALUE_TYPE>UNDEF</VALUE_TYPE>
<VALUE><![CDATA[]]></VALUE>
<USER_PERMISSION>PROCR_ALL_ACCESS</USER_PERMISSION>
<GROUP_PERMISSION>PROCR_READ</GROUP_PERMISSION>
<OTHER_PERMISSION>PROCR_READ</OTHER_PERMISSION>
<USER_NAME>root</USER_NAME>
<GROUP_NAME>root</GROUP_NAME>
..................................
..................................
該命令將在 $CRS_HOME/log/node_name/client目錄下產生日志文件,格式為 ocrdump_pid.ora,pid 為進程號
--------- 將 SYSTEM.css key 的內容以文件形式打印輸出
[root@rac11 client]# ocrdump '/home/oracle/ocrdump_test.log' -keyname SYSTEM.css -xml
---------------ocrcheck 命令
ocrcheck 命令用于檢查 OCR 內容的一致性:命令執行過程中會在此目錄下產生日志 $ORACLE_HOME/log/<hostname>/client/ocrcheck_<pid>.log?
ocrcheck 命令不需要參數
[oracle@rac11 ~]$ ocrcheck -h
Name:
? ? ? ? ocrcheck - Displays health of Oracle Cluster Registry.
Synopsis:
? ? ? ? ocrcheck?
Description:
? ? ? ? prompt> ocrcheck
? ? ? ? Displays current usage, location and health of the cluster registry
Notes:
? ? ? ? A log file will be created in
? ? ? ? $ORACLE_HOME/log/<hostname>/client/ocrcheck_<pid>.log. Please ensure
? ? ? ? you have file creation privileges in the above directory before
? ? ? ? running this tool.
如果 OCR 內容一致,則產生的輸出如下:
[root@rac22 ~]# ocrcheck
Status of Oracle Cluster Registry is as follows :
? ? ? ? ?Version ? ? ? ? ? ? ? ? ?: ? ? ? ? ?2
? ? ? ? ?Total space (kbytes) ? ? : ? ? 204712
? ? ? ? ?Used space (kbytes) ? ? ?: ? ? ? 3840
? ? ? ? ?Available space (kbytes) : ? ? 200872
? ? ? ? ?ID ? ? ? ? ? ? ? ? ? ? ? : 1788954814
? ? ? ? ?Device/File Name ? ? ? ? : /dev/raw/raw1
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Device/File integrity check succeeded
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Device/File not configured
? ? ? ? ?Cluster registry integrity check succeeded
如果不一致則產生如下輸出:
[root@rac22 ~]# ocrcheck
Status of Oracle Cluster Registry is as follows :
? ? ? ? ?Version ? ? ? ? ? ? ? ? ?: ? ? ? ? ?2
? ? ? ? ?Total space (kbytes) ? ? : ? ? 204712
? ? ? ? ?Used space (kbytes) ? ? ?: ? ? ? 3840
? ? ? ? ?Available space (kbytes) : ? ? 200872
? ? ? ? ?ID ? ? ? ? ? ? ? ? ? ? ? : 1788954814
? ? ? ? ?Device/File Name ? ? ? ? : /dev/raw/raw1
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Device/File need to be synchronized with the other device
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Device/File not configured
? ? ? ? ?Cluster registry integrity check succeeded
------------- ocrconfig 命令
ocrconfig 命令用于維護 OCR 磁盤。
在安裝 clusterware 過程中如果選擇 external redundancy ,則只能指定一個 OCR disk。但是 Oracle 允許且只允許配置兩個 OCR disk 互為
鏡像,以防止 OCR 磁盤發生單點故障。OCR 磁盤和 votedisk 不一樣,最多只能有兩個,一個為 Primary OCR 一個為 Mirror OCR。
[root@rac22 ~]# ocrconfig -h
Name:
? ? ? ? ocrconfig - Configuration tool for Oracle Cluster Registry.
Synopsis:
? ? ? ? ocrconfig [option]
? ? ? ? option:
? ? ? ? ? ? ? ? -export <filename> [-s online]
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? - Export cluster register contents to a file
? ? ? ? ? ? ? ? -import <filename> ? ? ? ? ? ? ? ? ?- Import cluster registry contents from a file
? ? ? ? ? ? ? ? -upgrade [<user> [<group>]]
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? - Upgrade cluster registry from previous version
? ? ? ? ? ? ? ? -downgrade [-version <version string>]
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? - Downgrade cluster registry to the specified version
? ? ? ? ? ? ? ? -backuploc <dirname> ? ? ? ? ? ? ? ?- Configure periodic backup location
? ? ? ? ? ? ? ? -showbackup ? ? ? ? ? ? ? ? ? ? ? ? - Show backup information
? ? ? ? ? ? ? ? -restore <filename> ? ? ? ? ? ? ? ? - Restore from physical backup
? ? ? ? ? ? ? ? -replace ocr|ocrmirror [<filename>] - Add/replace/remove a OCR device/file
? ? ? ? ? ? ? ? -overwrite ? ? ? ? ? ? ? ? ? ? ? ? ?- Overwrite OCR configuration on disk
? ? ? ? ? ? ? ? -repair ocr|ocrmirror <filename> ? ?- Repair local OCR configuration
? ? ? ? ? ? ? ? -help ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? - Print out this help information
Note:
? ? ? ? A log file will be created in
? ? ? ? $ORACLE_HOME/log/<hostname>/client/ocrconfig_<pid>.log. Please ensure
? ? ? ? you have file creation privileges in the above directory before
? ? ? ? running this tool.
---------使用 ocrconfig 查看自動備份
[root@rac22 ~]# ocrconfig -showbackup
---------修改 OCR 自動備份的位置
默認位置為:$OCR_HOME/crs/cdata/cluster_name/
[root@rac22 ~]# ocrconfig -backuploc /home/oracle/backup
---------使用導出、導入進行備份和恢復
Oracle建議在對集群做調整(增加、刪除節點)之前,對OCR進行備份,可以使用 export 備份到指定文件。如果做了 replace 或 restore 操作,Oracle
還建議使用 cluvfy compocr-n all 做一次全面的檢查。
1、首先關閉所有節點的 CRS
[root@rac22 ~]# crsctl stop crs
Stopping resources.
Successfully stopped CRS resources?
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
2、導出 OCR 的內容(必須以 root 權限)
[root@rac22 ocr_backup]# ocrconfig -export ocrexp.exp ?/home/oracle/ocr_backup/ocrexp.exp
3、重啟 CRS
[root@rac11 ~]# crsctl start crs
Attempting to start CRS stack?
The CRS stack will be started shortly
[root@rac22 ~]# crsctl start crs
Attempting to start CRS stack?
The CRS stack will be started shortly
4、檢查 CRS 狀態
[root@rac11 ~]# crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy
[root@rac22 ~]# crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy
5、破壞 OCR 內容
[root@rac11 ~]# dd if=/dev/zero of=/dev/raw/raw1 bs=1024 count=200
200+0 records in
200+0 records out
6、運行 cluvfy 工具檢查 OCR 一致性(失敗)
[root@rac11 ~]# /soft/clusterware/cluvfy/runcluvfy.sh comp ocr -n all
Verifying OCR integrity?
ERROR:?
User equivalence unavailable on all the nodes.
Verification cannot proceed.
Verification of OCR integrity was unsuccessful on all the nodes.?
7、使用ocrcheck 檢查 OCR 的一致性
[root@rac11 ~]# ocrcheck
PROT-601: Failed to initialize ocrcheck
8、使用 import 恢復 OCR 的內容
[root@rac11 ~]# ocrconfig -import /home/oracle/ocr_backup/ocrexp.exp?
PROT-19: Cannot proceed while clusterware is running. Shutdown clusterware first
先關閉 CRS,然后再執行 import 恢復
在本例中,因為是在打開 CRS 的時候破壞了 OCR,因此是無法成功關閉 CRS 的,關閉時會報錯。只能重啟系統,重啟后CRS將無法啟動這時
執行上述命令即可成功:
[root@rac11 ~]# ocrconfig -import /home/oracle/ocr_backup/ocrexp.exp
9、再次使用 ocrcheck 檢查一致性狀態(通過)
[root@rac11 ~]# ocrcheck
Status of Oracle Cluster Registry is as follows :
? ? ? ? ?Version ? ? ? ? ? ? ? ? ?: ? ? ? ? ?2
? ? ? ? ?Total space (kbytes) ? ? : ? ? 204712
? ? ? ? ?Used space (kbytes) ? ? ?: ? ? ? 3840
? ? ? ? ?Available space (kbytes) : ? ? 200872
? ? ? ? ?ID ? ? ? ? ? ? ? ? ? ? ? : ?825485411
? ? ? ? ?Device/File Name ? ? ? ? : /dev/raw/raw1
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Device/File integrity check succeeded
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Device/File not configured
? ? ? ? ?Cluster registry integrity check succeeded
10、使用cluvfy工具檢查(通過)。
[root@rac11 ~]# /soft/clusterware/cluvfy/runcluvfy.sh comp ocr -n all
Verifying OCR integrity?
ERROR:?
User equivalence unavailable on all the nodes.
Verification cannot proceed.
Verification of OCR integrity was unsuccessful on all the nodes.?
----------這里檢測的結果不成功,不知何因。
11、啟動 CRS
crsctl start crs
crsctl check crs
如需轉載,請注明出處及原文鏈接
http://blog.csdn.net/xiangsir/article/details/8576849總結
以上是生活随笔為你收集整理的Oracle 10g RAC 维护工具完全详解的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 《有限元分析基础教程》(曾攀)笔记一-二
- 下一篇: java中IO流体系以及常用实现类