Managing Resources

Always use crsctl or srvctl to start/stop cluster resources

Using crsctl :
[root@grac41 bin]# crsctl stop resource  ora.LISTENER.lsnr  -n grac41
[root@grac41 bin]# crsctl start resource  ora.LISTENER.lsnr  -n grac41
[grid@grac41 ~]$  my_crs_stat | egrep 'LISTENER.ls|STATE_DETAILS|-----'
NAME                           TARGET     STATE           SERVER       STATE_DETAILS   
-------------------------      ---------- ----------      ------------ ------------------
ora.LISTENER.lsnr              ONLINE     ONLINE          grac41  

[root@grac41 bin]#  lsnrctl status listener
..
Service "grac4" has 1 instance(s).
  Instance "grac41", status READY, has 1 handler(s) for this service...
--> listener is working 

Using srvctl 
[grid@grac41 ~]$ srvctl stop listener  -n  grac41 -l LISTENER
[grid@grac41 ~]$ srvctl start listener  -n  grac41 -l LISTENER
[grid@grac41 ~]$  !my
my_crs_stat | egrep 'LISTENER.ls|STATE_DETAILS|-----'
NAME                           TARGET     STATE           SERVER       STATE_DETAILS   
-------------------------      ---------- ----------      ------------ ------------------
ora.LISTENER.lsnr              ONLINE     ONLINE          grac41 

Using lnsrctl 
[grid@grac41 ~]$ srvctl start listener  -n  grac41 -l LISTENER
[root@grac41 bin]#  lsnrctl status listener
..
Service "grac4" has 1 instance(s).
  Instance "grac41", status READY, has 1 handler(s) for this service...
[root@grac41 bin]# lsnrctl stop LISTENER
[grid@grac41 ~]$  my_crs_stat | egrep 'LISTENER.ls|STATE_DETAILS|-----'
NAME                           TARGET     STATE           SERVER       STATE_DETAILS   
-------------------------      ---------- ----------      ------------ ------------------
ora.LISTENER.lsnr              OFFLINE    OFFLINE         grac41  

[root@grac41 bin]#  lsnrctl start LISTENER
[grid@grac41 ~]$  my_crs_stat | egrep 'LISTENER.ls|STATE_DETAILS|-----'
NAME                           TARGET     STATE           SERVER       STATE_DETAILS   
-------------------------      ---------- ----------      ------------ ------------------
ora.LISTENER.lsnr              OFFLINE    OFFLINE         grac41  
--> Listener remain OFFLINE 

[root@grac41 bin]#  lsnrctl status LISTENER
--> No services where registered !

Oracle always recommend the use of the SRVCTL due to the fact that the SRVCTL does more, i.e. SRVCTL will 
perform a dependency analysis and will inform about cluster related problem if they exist, in a better way 
than the SQLPLUS which may just say that the instance is not starting. The SRVCTL command will try to start 
dependent resources (like the  vip/ons/listeners) in case they are not running.

The SRVCTL utility always do some kind of pre-start of the instances such as updating the
OCR information instead of waiting for the check script of the instance resource to detect this
instance startup and update the OCR.

Leave a Reply

Your email address will not be published. Required fields are marked *