What is the advantage of crsctl and srvctl commands in oracle clusteware ?
Amen Answered question 05/09/2022
crsctl is a command-line tool for managing oracle clusterware and it enables us to check, start, and stop operations of the clusterware from any node.
Below are some of the crsctl command operations:
crsctl backup - back up voting disk for CSS crsctl check - check a service, resource, or other entity crsctl config - output autostart configuration crsctl debug - obtain or modify debug state crsctl delete - delete a resource, type, or other entity crsctl disable - disable autostart crsctl discover - discover DHCP server crsctl enable - enable autostart crsctl modify - modify a resource, type, or other entity crsctl query - query service state crsctl pin - pin the nodes in the nodelist crsctl relocate - relocate a resource, server, or other entity crsctl replace - replace the location of voting files crsctl start - start a resource, server, or other entity crsctl status - get status of a resource or other entity crsctl stop - stop a resource, server, or other entity
Example:
--To check the current status of all the resources grid@dbsrv:~$ crsctl status res -t --To start the Clusterware stack on all servers in the cluster or on one or more named server in the cluster: grid@dbsrv:~$ crsctl start cluster –all grid@dbsrv:~$ crsctl start cluster –n dbhost1 --To start the Oracle High Availability Services daemon (OHASD) grid@dbsrv:~$ crsctl start crs --To check the cluster status grid@dbsrv:~$ crsctl check cluster -all dbsrv: CRS-4537: Cluster Ready Services is online CRS-4529: Cluster Synchronization Services is online CRS-4533: Event Manager is online --To check the CRS status grid@dbsrv:~$ 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 check the OHASD status grid@dbsrv:~$ crsctl check has CRS-4638: Oracle High Availability Services is online
And srvctl is a utility that manages oracle resources managed by the oracle clusterware. The operations include enable, disable, start, stop, relocate, status, add, remove, modify, getenv, setenv, unsetenv, config, convert,and upgrade.
Example:
--To check the status of all clusters grid@dbsrv:~$ srvctl status database -db proddb Instance proddb1 is running on node proddb1 Instance proddb2 is not running on node proddb2 --To stop all cluster nodes grid@dbsrv:~$ srvctl stop database -db proddb --To start the entire cluster grid@dbsrv:~$ srvctl start database -db proddb --To start instance 1 of the cluster grid@dbsrv:~$ srvctl start instance -i proddb1 -d proddb --To start instance 2 of the cluster grid@dbsrv:~$ srvctl start instance -i proddb2 -d proddb -- To stop instance 1 of the cluster grid@dbsrv:~$ srvctl stop instance -i proddb1 -d prodb2 --To check the SCAN configuration of the cluster grid@dbsrv:~$ srvctl config scan SCAN name: abc.com, Network: 1 Subnet IPv4: 10.02.10.0/255.255.255.0/net0, static Subnet IPv6: SCAN 0 IPv4 VIP: 10.02.10.44 SCAN VIP is enabled. SCAN VIP is individually enabled on nodes: SCAN VIP is individually disabled on nodes: SCAN 1 IPv4 VIP: 10.02.40.45 SCAN VIP is enabled. SCAN VIP is individually enabled on nodes: SCAN VIP is individually disabled on nodes: SCAN 2 IPv4 VIP: 10.02.10.46 SCAN VIP is enabled. SCAN VIP is individually enabled on nodes: SCAN VIP is individually disabled on nodes --To check the node VIP status on dbsrv1 grid@dbsrv1:~$ srvctl status vip -n dbsrv1 VIP dbsrv1-vip.abc.com is enabled VIP dbsrv1-vip.abc.com is running on node: dbsrv1 --To check the node apps on dbsrv1 grid@dbsrv1:~$ srvctl status nodeapps -n dbsrv1 VIP dbsrv1-vip.abc.com is enabled VIP dbsrv1-vip.abc.com is running on node: dbsrv1 Network is enabled Network is running on node: dbsrv1 ONS is enabled ONS daemon is running on node: dbsrv1
Amen Changed status to publish 05/09/2022