眾所周知,在部署Grid Infrastructure的過程中使用,runcluvfy.sh腳本被用於驗證系統的軟硬件環境是否滿足軟件安裝的需求。過去一直沿用現成方法進行該項工作,很少去探究其中的含義,百度搜索也鮮見全面介紹,通過借鑒整合,故形成以下記錄,用以備忘。
一、什么是CVU
CVU是Cluster Verify Utility的縮寫。為了避免Grid Infrastructure安裝過程中的錯誤,Oracle 提供了一個校驗工具,即CVU。該工具的主要功能是檢查系統的硬件和軟件環境是否滿足安裝的要求。
CVU工具包括兩個腳本:runcluvfy.sh和cluvfy 。runcluvfy.sh腳本位於Grid Infrastructure的安裝介質中,它的功能是在安裝Grid Infrastructure之前對系統進行校驗。而cluvfy位於Grid Infrastructure軟件的HOME目錄下的bin目錄中,它的功能是在安裝Oracle 數據庫軟件或者創建集群數據庫之前,對系統進行校驗。
本文主要介紹runcluvfy.sh腳本的使用方法。
二、腳本的常見使用形式
./runcluvfy.sh stage -pre crsinst -n node1,node2 -verbose
./runcluvfy.sh stage -pre crsinst -n node1,node2 -fixup -verbose
語法說明:
-pre: 該選項主要檢查是否滿足安裝的需要。
-post:該選擇主要檢查安裝后組件是否正常。
-n:該選項用於指定節點列表。
-verbose:該選項用於輸出詳細的驗證信息。
-fixup:這是Oracle 11gR2中新增加的一個參數。利用這個參數,可以產生一個名為runfixup.sh的腳本。
runfixup.sh腳本中包含一系列的操作系統命令,利用這個腳本可以對操作系統進行一定的修改,使其滿足安裝條件。完成系統進行校驗之后,以root用戶的身份執行腳本runfixup.sh,就可以解決操作系統中一些尚不滿足安裝條件的情況。
三、如何獲取幫助信息
runcluvfy.sh這個腳本涉及的參數及含義眾多,如果能利用腳本提供的幫助信息絕對是非常有益的。對於如何獲取幫助信息這個問題,我之前也十分困惑,對如何選擇和使用一個參數常常不得要領。后來發現可以采取分而治之的辦法,一步一步來,脈絡就變得清晰很多。
./runcluvfy.sh -help
USAGE:
runcluvfy.sh [-help|-version]
runcluvfy.sh stage {-list|-help}
runcluvfy.sh stage {-pre|-post} <stage-name> <stage-specific options> [-verbose]
runcluvfy.sh comp {-list|-help}
runcluvfy.sh comp <component-name> <component-specific options> [-verbose]
通過上面的輸出可以看到,runcluvfy.sh有兩個主要的選項:stage和comp。更進一步地,通過list選項能獲取更多的內容:
./runcluvfy.sh stage -list
USAGE:
runcluvfy.sh stage {-pre|-post} <stage-name> <stage-specific options> [-verbose]
Valid Stages are:
-pre cfs : pre-check for CFS setup
-pre crsinst : pre-check for CRS installation
-pre acfscfg : pre-check for ACFS Configuration.
-pre dbinst : pre-check for database installation
-pre dbcfg : pre-check for database configuration
-pre hacfg : pre-check for HA configuration
-pre nodeadd : pre-check for node addition.
-post hwos : post-check for hardware and operating system
-post cfs : post-check for CFS setup
-post crsinst : post-check for CRS installation
-post acfscfg : post-check for ACFS Configuration.
-post hacfg : post-check for HA configuration
-post nodeadd : post-check for node addition.
-post nodedel : post-check for node deletion.
同樣地:
./runcluvfy.sh comp -list
USAGE:
runcluvfy.sh comp <component-name> <component-specific options> [-verbose]
Valid Components are:
nodereach : checks reachability between nodes
nodecon : checks node connectivity
cfs : checks CFS integrity
ssa : checks shared storage accessibility
space : checks space availability
sys : checks minimum system requirements
clu : checks cluster integrity
clumgr : checks cluster manager integrity
ocr : checks OCR integrity
olr : checks OLR integrity
ha : checks HA integrity
freespace : checks free space in CRS Home
crs : checks CRS integrity
nodeapp : checks node applications existence
admprv : checks administrative privileges
peer : compares properties with peers
software : checks software distribution
acfs : checks ACFS integrity
asm : checks ASM integrity
gpnp : checks GPnP integrity
gns : checks GNS integrity
scan : checks SCAN configuration
ohasd : checks OHASD integrity
clocksync : checks Clock Synchronization
vdisk : checks Voting Disk configuration and UDEV settings
healthcheck : checks mandatory requirements and/or best practice recommendations
dhcp : checks DHCP configuration
dns : checks DNS configuration
