Alfredo Krieg's DBA blog - Oracle ACE: CRSCTL command examples

Friday, April 12, 2013

CRSCTL command examples


CRSCTL is an interface between you and Oracle Clusterware, parsing and calling
Oracle Clusterware APIs for Oracle Clusterware objects.
Oracle Clusterware 11g release 2 (11.2) introduces cluster-aware commands with
which you can perform check, start, and stop operations on the cluster. You can run
these commands from any node in the cluster on another node in the cluster, or on all
nodes in the cluster, depending on the operation.
You can use CRSCTL commands to perform several operations on Oracle Clusterware,
such as:
■ Starting and stopping Oracle Clusterware resources
■ Enabling and disabling Oracle Clusterware daemons
■ Checking the health of the cluster
■ Managing resources that represent third-party applications
■ Debugging Oracle Clusterware components
■ Integrating Intelligent Platform Management Interface (IPMI) with Oracle Clusterware to provide failure isolation support and to ensure cluster integrity


Some examples:

$ crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora.DATA.dg    ora....up.type ONLINE    ONLINE    ol5-...rac1 
ora....ER.lsnr ora....er.type ONLINE    ONLINE    ol5-...rac1 
ora....N1.lsnr ora....er.type ONLINE    ONLINE    ol5-...rac1 
ora.asm        ora.asm.type   ONLINE    ONLINE    ol5-...rac1 
ora.eons       ora.eons.type  ONLINE    ONLINE    ol5-...rac1 
ora.gsd        ora.gsd.type   OFFLINE   OFFLINE               
ora....network ora....rk.type ONLINE    ONLINE    ol5-...rac1 
ora.oc4j       ora.oc4j.type  OFFLINE   OFFLINE               
ora....SM1.asm application    ONLINE    ONLINE    ol5-...rac1 
ora....C1.lsnr application    ONLINE    ONLINE    ol5-...rac1 
ora....ac1.gsd application    OFFLINE   OFFLINE               
ora....ac1.ons application    ONLINE    ONLINE    ol5-...rac1 
ora....ac1.vip ora....t1.type ONLINE    ONLINE    ol5-...rac1 
ora....SM2.asm application    ONLINE    ONLINE    ol5-...rac2 
ora....C2.lsnr application    ONLINE    ONLINE    ol5-...rac2 
ora....ac2.gsd application    OFFLINE   OFFLINE               
ora....ac2.ons application    ONLINE    ONLINE    ol5-...rac2 
ora....ac2.vip ora....t1.type ONLINE    ONLINE    ol5-...rac2 
ora.ons        ora.ons.type   ONLINE    ONLINE    ol5-...rac1 
ora.rac.db     ora....se.type ONLINE    ONLINE    ol5-...rac2 
ora....rts.svc ora....ce.type ONLINE    ONLINE    ol5-...rac1 
ora.scan1.vip  ora....ip.type ONLINE    ONLINE    ol5-...rac1 

CRS_STAT is deprecated in 11.2, below is the new command line to check the status of the resources:

$ crsctl status resource -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
               ONLINE  ONLINE       ol5-112-rac1                                 
               ONLINE  ONLINE       ol5-112-rac2                                 
ora.LISTENER.lsnr
               ONLINE  ONLINE       ol5-112-rac1                                 
               ONLINE  ONLINE       ol5-112-rac2                                 
ora.asm
               ONLINE  ONLINE       ol5-112-rac1             Started             
               ONLINE  ONLINE       ol5-112-rac2             Started             
ora.eons
               ONLINE  ONLINE       ol5-112-rac1                                 
               ONLINE  ONLINE       ol5-112-rac2                                 
ora.gsd
               OFFLINE OFFLINE      ol5-112-rac1                                 
               OFFLINE OFFLINE      ol5-112-rac2                                 
ora.net1.network
               ONLINE  ONLINE       ol5-112-rac1                                 
               ONLINE  ONLINE       ol5-112-rac2                                 
ora.ons
               ONLINE  ONLINE       ol5-112-rac1                                 
               ONLINE  ONLINE       ol5-112-rac2                                 
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       ol5-112-rac1                                 
ora.oc4j
      1        OFFLINE OFFLINE                                                   
ora.ol5-112-rac1.vip
      1        ONLINE  ONLINE       ol5-112-rac1                                 
ora.ol5-112-rac2.vip
      1        ONLINE  ONLINE       ol5-112-rac2                                 
ora.rac.db
      1        ONLINE  ONLINE       ol5-112-rac2             Open                
      2        ONLINE  ONLINE       ol5-112-rac1             Open                
ora.rac.reports.svc
      1        ONLINE  ONLINE       ol5-112-rac2                                 
ora.scan1.vip
      1        ONLINE  ONLINE       ol5-112-rac1       


In order to check the health of the cluster:

$ crsctl check cluster
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online


To stop all resources in the cluster:


$ crsctl stop resource -all
CRS-2500: Cannot stop resource 'ora.gsd' as it is not running
CRS-2500: Cannot stop resource 'ora.oc4j' as it is not running
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'ol5-112-rac1'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'ol5-112-rac2'
CRS-2673: Attempting to stop 'ora.eons' on 'ol5-112-rac2'
CRS-2673: Attempting to stop 'ora.eons' on 'ol5-112-rac1'
CRS-2789: Cannot stop resource 'ora.gsd' as it is not running on server 'ol5-112-rac1'
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'ol5-112-rac2'
CRS-2673: Attempting to stop 'ora.rac.db' on 'ol5-112-rac2'
CRS-2789: Cannot stop resource 'ora.gsd' as it is not running on server 'ol5-112-rac2'
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'ol5-112-rac1' succeeded
CRS-2673: Attempting to stop 'ora.ons' on 'ol5-112-rac1'
CRS-2673: Attempting to stop 'ora.LISTENER_SCAN1.lsnr' on 'ol5-112-rac1'
CRS-2673: Attempting to stop 'ora.rac.reports.svc' on 'ol5-112-rac1'
CRS-2677: Stop of 'ora.rac.reports.svc' on 'ol5-112-rac1' succeeded
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'ol5-112-rac1'
CRS-2673: Attempting to stop 'ora.rac.db' on 'ol5-112-rac1'
CRS-2673: Attempting to stop 'ora.ol5-112-rac1.vip' on 'ol5-112-rac1'
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'ol5-112-rac2' succeeded
CRS-2673: Attempting to stop 'ora.ons' on 'ol5-112-rac2'
CRS-2673: Attempting to stop 'ora.ol5-112-rac2.vip' on 'ol5-112-rac2'
CRS-2677: Stop of 'ora.ons' on 'ol5-112-rac1' succeeded
CRS-2789: Cannot stop resource 'ora.ons' as it is not running on server 'ol5-112-rac1'
CRS-2677: Stop of 'ora.ol5-112-rac1.vip' on 'ol5-112-rac1' succeeded
CRS-2677: Stop of 'ora.ol5-112-rac2.vip' on 'ol5-112-rac2' succeeded
CRS-2677: Stop of 'ora.LISTENER_SCAN1.lsnr' on 'ol5-112-rac1' succeeded
CRS-2673: Attempting to stop 'ora.scan1.vip' on 'ol5-112-rac1'
CRS-2677: Stop of 'ora.scan1.vip' on 'ol5-112-rac1' succeeded
CRS-2673: Attempting to stop 'ora.net1.network' on 'ol5-112-rac1'
CRS-2677: Stop of 'ora.net1.network' on 'ol5-112-rac1' succeeded
CRS-2677: Stop of 'ora.ons' on 'ol5-112-rac2' succeeded
CRS-2789: Cannot stop resource 'ora.ons' as it is not running on server 'ol5-112-rac2'
CRS-2673: Attempting to stop 'ora.net1.network' on 'ol5-112-rac2'
CRS-2677: Stop of 'ora.net1.network' on 'ol5-112-rac2' succeeded
CRS-2677: Stop of 'ora.eons' on 'ol5-112-rac2' succeeded
CRS-2677: Stop of 'ora.eons' on 'ol5-112-rac1' succeeded
CRS-2675: Stop of 'ora.DATA.dg' on 'ol5-112-rac2' failed
CRS-2675: Stop of 'ora.DATA.dg' on 'ol5-112-rac1' failed
CRS-2677: Stop of 'ora.rac.db' on 'ol5-112-rac2' succeeded
CRS-2677: Stop of 'ora.rac.db' on 'ol5-112-rac1' succeeded
CRS-4000: Command Stop failed, or completed with errors.


To start all resources registered in the cluster:

$ crsctl start resource -all
CRS-2501: Resource 'ora.gsd' is disabled
CRS-2501: Resource 'ora.oc4j' is disabled
CRS-2501: Resource 'ora.gsd' is disabled
CRS-2501: Resource 'ora.gsd' is disabled
CRS-2664: Resource 'ora.asm' is already running on 'ol5-112-rac1'
CRS-2672: Attempting to start 'ora.net1.network' on 'ol5-112-rac1'
CRS-2664: Resource 'ora.asm' is already running on 'ol5-112-rac2'
CRS-2672: Attempting to start 'ora.net1.network' on 'ol5-112-rac2'
CRS-2676: Start of 'ora.net1.network' on 'ol5-112-rac2' succeeded
CRS-2672: Attempting to start 'ora.ons' on 'ol5-112-rac2'
CRS-2676: Start of 'ora.net1.network' on 'ol5-112-rac1' succeeded
CRS-2672: Attempting to start 'ora.ons' on 'ol5-112-rac1'
CRS-2676: Start of 'ora.ons' on 'ol5-112-rac2' succeeded
CRS-2676: Start of 'ora.ons' on 'ol5-112-rac1' succeeded
CRS-2672: Attempting to start 'ora.eons' on 'ol5-112-rac1'
CRS-2672: Attempting to start 'ora.eons' on 'ol5-112-rac2'
CRS-2672: Attempting to start 'ora.ol5-112-rac2.vip' on 'ol5-112-rac2'
CRS-2672: Attempting to start 'ora.scan1.vip' on 'ol5-112-rac1'
CRS-2676: Start of 'ora.scan1.vip' on 'ol5-112-rac1' succeeded
CRS-2672: Attempting to start 'ora.LISTENER_SCAN1.lsnr' on 'ol5-112-rac1'
CRS-2676: Start of 'ora.LISTENER_SCAN1.lsnr' on 'ol5-112-rac1' succeeded
CRS-2676: Start of 'ora.ol5-112-rac2.vip' on 'ol5-112-rac2' succeeded
CRS-2672: Attempting to start 'ora.LISTENER.lsnr' on 'ol5-112-rac2'
CRS-2676: Start of 'ora.eons' on 'ol5-112-rac2' succeeded
CRS-2676: Start of 'ora.eons' on 'ol5-112-rac1' succeeded
CRS-2676: Start of 'ora.LISTENER.lsnr' on 'ol5-112-rac2' succeeded
CRS-2672: Attempting to start 'ora.rac.db' on 'ol5-112-rac2'
CRS-2676: Start of 'ora.rac.db' on 'ol5-112-rac2' succeeded
CRS-2672: Attempting to start 'ora.rac.reports.svc' on 'ol5-112-rac2'
CRS-2676: Start of 'ora.rac.reports.svc' on 'ol5-112-rac2' succeeded
CRS-5702: Resource 'ora.rac.reports.svc' is already running on 'ol5-112-rac2'
CRS-4000: Command Start failed, or completed with errors.

Thanks

Labels:

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home