The result of the Oracle 11g RAC crs_stat command shows that the crs_stat command in Oracle 11g RAC has many new resource types compared with the previous version. By default, the use of crs_stat-t to view resources is a large piece of data that looks really laborious. The author Paul Elbow and Enkitec provided us with a crsstat script to display all the resource types under Oracle 11g RAC in a clearer format. See the description below. 1. To install crsstat, we recommend that you use the root user or oracle user to install it in the/usr/local/bin directory. When the script is run for the first time, a crsstat will be generated in the installation directory. env file, which is used to describe the location information of crs before crsstat is installed, crs should be started, and the installation path of the crsstat script should have write permission source file download: http://up.2cto.com/2013/0723/20130723090838705.zip below is the installation steps
# Cd/usr/local/bin # unzip crsstat.v1.2.1.zip # mv crsstat. v1.2.2 crsstat # chmod 755 crsstat #. /crsstat # chmod 644 crsstat. env verification crsstat. whether the env file is correctly configured # more crsstat. env GRID_HOME =/u01/app/11.2.0/grid GRID_VER = 11.2
2. Demonstrate the usage of crsstat. The usage of crsstat is relatively simple. simply execute the crsstat command at the prompt. You can also use crsstat-h to output the help information of crsstat a and crsstat.
[grid@linux1 ~]$ crsstat -h Usage: crsstat [-h] [-c] [search term] -h => print this message -c => output the resources by cluster or local Examples: crsstat # show all resources crsstat listener # only show listener resources crsstat database # only show database resources crsstat -c listener # only show database resources sorted by cluster/local Output Contains the following fields: Resource Name Resource Type, which includes an identifier C-Cluster and L-Local Target State Current State Current Node (11gR2: or the last node in paraenthesis if the resource is Offline) Failure Count (11gR2 only) Restart Count (11gR2 only) State Details (11gR2 only)
B. Use crsstat to view cluster resources
# Display all resources [oracle @ linux1 bin] $ crsstat Resource Name Resource Type Target State Node fc rc State Details detail ---------------- ---------- ------------ --------------- -- ----------------- ora. ASM_DATA.dg diskgroup l online linux1 0 ora. ASM_DATA.dg diskgroup l online linux2 0 ora. FRA_DATA.dg diskgroup l online linux1 0 ora. FRA_DATA.dg diskgroup l online linux2 0 ora. LISTENER. lsnr Listener l online linux1 0 ora. LISTENER. lsnr Listener l online linux2 0 ora. LISTENER_SCAN1.lsnr SCAN Listener c online linux1 0 ora. LISTENER_SCAN2.lsnr SCAN Listener c online linux2 0 ora. OCR_VOTE.dg diskgroup l online linux1 0 ora. OCR_VOTE.dg diskgroup l online linux2 0 ora. asm asm l online linux1 0 Started ora. asm asm l online linux2 0 Started ora. eons l online linux1 0 ora. eons l online linux2 0 ora. gsd Gbl Svc Daemon l offline (linux1) 0 ora. gsd Gbl Svc Daemon l offline (linux2) 0 ora. linux1.vip Cluster vip c online linux1 0 ora. linux2.vip Cluster vip c online linux2 0 ora. mmbo. db database c online linux1 0 Open ora. mmbo. db database c online linux2 0 Open ora. mmbo11g. db database c online linux1 0 Open ora. net1.network Network (VIP) l online linux1 0 ora. net1.network Network (VIP) l online linux2 0 ora. enter the command line () 0 ora. ons Ora Notif Svc l online linux1 0 ora. ons Ora Notif Svc l online linux2 0 ora. registry. acfs registry l online linux1 0 ora. registry. acfs registry l online linux2 0 ora. scan1.vip scan vip c online linux1 0 ora. scan2.vip scan vip c online linux2 0
C. Other usage
# Displays service-related information. The service is not configured in the current rac environment, therefore, no [oracle @ linux1 bin] $ crsstat service Resource Name Resource Type Target State Node fc rc State Details detail ------------------ ---------- ------------ ------------- -- --------------- # display the database registered in the Cluster information [oracle @ linux1 bin] $ crsstat database Resource Name Resource Type Target State Node fc rc State Details ------------- --------------------------- ---------------- ---------- ------------ --------------- -- --------------- Ora. mmbo. db database c online linux1 0 Open ora. mmbo. db database c online linux2 0 Open ora. mmbo11g. db database c online linux1 0 Open # display listener information in the Cluster [oracle @ linux1 bin] $ crsstat lsnr Resource Name Resource Type Target State Node fc rc State Details ------------------------ ---------------- ---------- ------------ --------------- -- --------------- Ora. LISTENER. lsnr Listener l online linux1 0 ora. LISTENER. lsnr Listener l online linux2 0 ora. LISTENER_SCAN1.lsnr SCAN Listener c online linux1 0 ora. LISTENER_SCAN2.lsnr SCAN Listener c online linux2 0 # You can also use the grep command to filter [oracle @ linux1 bin] $ crsstat | grep-I offline ora. gsd Gbl Svc Daemon l offline (linux1) 0 ora. gsd Gbl Svc Daemon l offline (linux2) 0 ora. Enter c offline () 0 [grid @ linux1 ~] $ Crsstat-c listener Resource Name Resource Type Target State Node fc rc State Details ------------------------------------------ ---------------- ------------------------- -- --------------- Local Resources listener ora. LISTENER. lsnr Listener l online linux1 0 ora. LISTENER. lsnr Listener l online linux2 0 Cluster Resources ---------------------------------------------------------------------------------- ora. LISTENER_SCAN1.lsnr SCAN Listener c online linux1 0 ora. LISTENER_SCAN2.lsnr SCAN Listener c online linux2 0