Please see my other blog for Oracle EBusiness Suite Posts - EBMentors

Search This Blog

Note: All the posts are based on practical approach avoiding lengthy theory. All have been tested on some development servers. Please don’t test any post on production servers until you are sure.

Monday, March 05, 2012

CRSCTL Utility/Other Cluster Commands Reference (11g)

CRSCTL is an interface between you and Oracle Clusterware, parsing and calling Oracle Clusterware APIs for Oracle Clusterware objects.  You  can perform check, start, and stop operations on the cluster with CRSCTL. This utility is located in the Grid_home/bin directory.

Cluster Aware Commands
D:\app\11.2.0.3\grid\BIN>crsctl check cluster
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online

Others are below
crsctl start cluster

crsctl stop cluster

D:\app\11.2.0.3\grid\BIN>crsctl -help

D:\app\11.2.0.3\grid\BIN>crsctl start -help

D:\app\11.2.0.3\grid\BIN>crsctl check cluster -all
**************************************************************
or-11:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************
cl-or-12:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************

D:\app\11.2.0.3\grid\BIN>crsctl stat res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DBDATA.dg
               ONLINE  ONLINE       or-11
               ONLINE  ONLINE       or-12
ora.DBFLASH.dg
               ONLINE  ONLINE       or-11
               ONLINE  ONLINE       or-12
ora.LISTENER.lsnr
               ONLINE  ONLINE       or-11
               ONLINE  ONLINE       or-12
ora.asm
               ONLINE  ONLINE       or-11            Started
               ONLINE  ONLINE       or-12            Started
.....


D:\app\11.2.0.3\grid\BIN>crsctl check css [often used when Oracle Automatic Storage Management (Oracle ASM) is installed on the local server.]
CRS-4529: Cluster Synchronization Services is online

D:\app\11.2.0.3\grid\BIN>crsctl get hostname
or-11

User and group permissions for the specified resource.
D:\app\11.2.0.3\grid\BIN>crsctl getperm resource ora.oc4j
Name: ora.oc4j
owner:nt authority\system:rwx,pgrp::r-x,other::r--

Linux
[oracle@rac2 bin]$ ./crsctl getperm resource ora.oc4j
Name: ora.oc4j
owner:oracle:rwx,pgrp:oinstall:rwx,other::r--

Start many idle resources on a particular server in the cluster.
crsctl start resource myResource -n server1
D:\app\11.2.0.3\grid\BIN>crsctl start resource ora.LISTENER_SCAN3.lsnr -n or-12
CRS-2672: Attempting to start 'ora.LISTENER_SCAN3.lsnr' on 'or-12'
CRS-2676: Start of 'ora.LISTENER_SCAN3.lsnr' on 'or-12' succeeded 
 

Obtain the status and configuration information of many particular resources 
D:\app\11.2.0.3\grid\BIN>crsctl status resource ora.LISTENER_SCAN3.lsnr
NAME=ora.LISTENER_SCAN3.lsnr
TYPE=ora.scan_listener.type
TARGET=ONLINE
STATE=ONLINE on or-12

D:\app\11.2.0.3\grid\BIN>crsctl stop resource ora.LISTENER_SCAN3.lsnr 
-n or-12
CRS-2673: Attempting to stop 'ora.LISTENER_SCAN3.lsnr' on 'or-12'
CRS-2677: Stop of 'ora.LISTENER_SCAN3.lsnr' on 'or-12' succeeded
 
D:\app\11.2.0.3\grid\BIN>crsctl status res ora.LISTENER.lsnr
NAME=ora.LISTENER.lsnr
TYPE=ora.listener.type
TARGET=ONLINE                       , ONLINE
STATE=INTERMEDIATE on or-11, ONLINE on or-12


D:\app\11.2.0.3\grid\BIN>crsctl stop res ora.LISTENER.lsnr
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'or-12'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'or-11'
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'or-11' succeeded
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'or-12' succeeded

D:\app\11.2.0.3\grid\BIN>crsctl start res ora.LISTENER.lsnr
CRS-2672: Attempting to start 'ora.LISTENER.lsnr' on 'or-11'
CRS-2672: Attempting to start 'ora.LISTENER.lsnr' on 'or-12'
CRS-2676: Start of 'ora.LISTENER.lsnr' on 'or-12' succeeded
CRS-5020: Not all endpoints are registered for listener LISTENER
CRS-2676: Start of 'ora.LISTENER.lsnr' on 'or-11' succeeded 

 
Add crs administrator command to add a user to the list of cluster administrators
D:\app\11.2.0.3\grid\BIN>crsctl add crs administrator -u domainName\inam
D:\app\11.2.0.3\grid\BIN>crsctl add crs administrator -u inam
CRS-4674: Cannot add invalid user 'inam' to CRS Admin list.
CRS-4000: Command Add failed, or completed with errors.

 
Check the status of Oracle High Availability Services and the Oracle Clusterware stack on the local server
D:\app\11.2.0.3\grid\BIN>crsctl check crs
CRS-4638: Oracle High Availability Services is online
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
 
To initiate the check action inside the application-specific agent of a particular
resource. 
D:\app\11.2.0.3\grid\BIN>crsctl check resource myResource do not use this 
command for any resources with names that begin with ora because these resources 
are Oracle resources
 
To check the status of the Cluster Time Synchronization services 
D:\app\11.2.0.3\grid\BIN>crsctl check ctss
CRS-4700: The Cluster Time Synchronization Service is in Observer mode.
OR
CRS-4701: The Cluster Time Synchronization Service is in Active mode.
CRS-4702: Offset from the reference node (in msec): 100
 
Display Oracle High Availability Services automatic startup configuration
D:\app\11.2.0.3\grid\BIN>crsctl config crs
CRS-4622: Oracle High Availability Services autostart is enabled.
 
To remove a user from the Oracle Clusterware administrator list
crsctl delete crs administrator -u domainName\inam
 
To prevent the automatic startup of Oracle High Availability Services when the 
server boots crsctl disable crs This command only affects the local server, 
If you disable  Oracle High Availability Services automatic startup, you must use 
the crsctl start crs command to start Oracle High Availability Services 
 

 
 
Cluster Name Check
cemutlo -n
 
Resource Applications (CRS Utilities)
D:\app\11.2.0.3\grid\BIN>crs_stat  -ls (permission listing)

D:\app\11.2.0.3\grid\BIN>crs_stat  -t (tabular)

D:\app\11.2.0.3\grid\BIN>crs_stat  -p (parameters )
Nodes 
D:\app\11.2.0.3\grid\BIN>olsnodes -n 
 
Oracle Interfaces
D:\app\11.2.0.3\grid\BIN>oifcfg getif  

Linux 
[oracle@rac2 bin]$ ./oifcfg getif
eth0  132.35.21.0  global  public
eth1  10.10.10.0  global  cluster_interconnect

Cluster Configuration
D:\app\11.2.0.3\grid\BIN>clscfg -concepts
clscfg is used during installation, don't use until you are sure as it may 
corrupt CRS.
 

SRVCTL

D:\app\11.2.0.3\grid\BIN>srvctl status asm -n or-12
D:\app\11.2.0.3\grid\BIN>srvctl stop instance -d RACDB -i racdb1 -o abort 
D:\app\11.2.0.3\grid\BIN>srvctl start instance -d RACDB -i racdb1 
Services:
srvctl status service -d dbname
srvctl config service -d dbname
srvctl start service -d dbname -s servicename
srvctl stop service -d dbname -s servicename
srvctl relocate service -d dbname -s servicename -i instancename -t newinstancename [-f]
 
D:\app\11.2.0.3\grid\BIN>srvctl status nodeapps
VIP OR-11-VIP is enabled
VIP OR-11-VIP is running on node: or-11
VIP OR-12-VIP is enabled
VIP OR-12-VIP is running on node: or-12
Network is enabled
Network is running on node: or-11
Network is running on node: or-12
GSD is disabled
GSD is not running on node: or-11
GSD is not running on node: or-12
ONS is enabled
ONS daemon is running on node: or-11
ONS daemon is running on node: or-12

D:\app\11.2.0.3\grid\BIN>srvctl config database
dbrac
TESTRAC
 
D:\app\11.2.0.3\grid\BIN>srvctl config database -d dbrac -a
Database unique name: dbrac
Database name: dbrac
Oracle home: D:\app\Inam\product\11.2.0.3\dbhome_1
Oracle user: nt authority\system
Spfile: +DBDATA/dbrac/spfiledbrac.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: dbrac
Database instances: dbrac1,dbrac2
Disk Groups: DBDATA,DBFLASH
Mount point paths:
Services:
Type: RAC
Database is enabled
Database is administrator managed 

D:\app\11.2.0.3\grid\BIN>srvctl status asm
ASM is running on or-11,or-12

D:\app\11.2.0.3\grid\BIN>srvctl config asm -a
ASM home: D:\app\11.2.0.3\grid
ASM listener: LISTENER
ASM is enabled.

D:\app\11.2.0.3\grid\BIN>srvctl config listener -a
Name: LISTENER
Network: 1, Owner: nt authority\system
Home: 
  D:\app\11.2.0.3\grid on node(s) or-12,or-11
End points: TCP:1521
 
D:\app\11.2.0.3\grid\BIN>srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node or-11
SCAN VIP scan2 is enabled
SCAN VIP scan2 is running on node or-12
SCAN VIP scan3 is enabled
SCAN VIP scan3 is running on node or-12

D:\app\11.2.0.3\grid\BIN>srvctl config scan
SCAN name: crs-scan.domain.com, Network: 1/192.168.26.0/255.255.255.0/public
SCAN VIP name: scan1, IP: /crs-scan.domain.com/192.168.26.66
SCAN VIP name: scan2, IP: /crs-scan.domain.com/192.168.26.65
SCAN VIP name: scan3, IP: /crs-scan.domain.com.sa/192.168.26.64 
 
D:\app\11.2.0.3\grid\BIN>srvctl status vip -n or-11
VIP OR-11-VIP is enabled
VIP OR-11-VIP is running on node: or-11

D:\app\11.2.0.3\grid\BIN>srvctl config vip -n or-11
VIP exists: /OR-11-VIP/192.168.26.13/192.168.26.0/255.255.255.0/public, hosting node or-11
 
 
D:\app\11.2.0.3\grid\BIN>ocrdump -stdout > d:\temp\ocrdumpout.txt  -- cluster info
 
find out the number of nodes registered into the cluster 
olsnodes -n -i
 
 



No comments: