How to find out the nodes in RAC cluster (or)
How to find out the master node in Oracle RAC?
There are several ways to find out which is the master node or all the nodes which are part of Oracle RAC cluster.
Use any one of the below.
i) oclumon manage -get master (in Oracle RAC 12c)
ii) select MASTER_NODE from v$ges_resource;
iv) check ocssd.log file and search for "master node number".
$ grep "master node number" /u01/app/crs/11.2.0.4/log/`hostname -s`/cssd/ocssd.log
Related Oracle Articles: cluster name of Oracle RAC cluster Oracle RAC Interview Questions Part3
olsnodes does not seem to be an accurate method to determine the master node.
ReplyDelete[grid@ora122rac02 ~]$
[grid@ora122rac02 ~]$ oclumon manage -get master
Master = ora122rac02
[grid@ora122rac02 ~]$
[grid@ora122rac02 ~]$ olsnodes
ora122rac01
ora122rac02
As for v$ges_resource, this shows resources for all nodes.
JKSTILL@p1 > l
1 select master_node, count(*)
2 --from v$ges_resource
3 from v$dlm_ress
4* group by master_node
JKSTILL@p1 > /
MASTER_NODE COUNT(*)--FROMV$GES_RESOURCE
----------- ----------------------------
1 2728
2 16730
JKSTILL@p1 >
Yes. olsnodes is the NOT the right option....olsnodes will display all nodes in the cluster in alphabetical order.
DeleteI found something difference where oclumon output is not up to mark. O/P of same command shows node2 is master node while taking manual backup of it was taking on node1 and even same in ocssd.trc i.e node 1 is mater node, below is O/P:
ReplyDelete[root@ol6-112-rac2 ol6-112-scan]# date
Thu Jan 31 17:01:31 IST 2019
[root@ol6-112-rac2 ol6-112-scan]# oclumon manage -get MASTER
Master = ol6-112-rac2
[root@ol6-112-rac2 ol6-112-scan]# date
Thu Jan 31 17:01:41 IST 2019
[root@ol6-112-rac2 ol6-112-scan]# ocrconfig -manualbackup
ol6-112-rac1 2019/01/31 17:01:51 /u01/app/12.1.0/grid/cdata/ol6-112-scan/backup_20190131_170151.ocr 811007039
ol6-112-rac2 2019/01/31 16:26:11 /u01/app/12.1.0/grid/cdata/ol6-112-scan/backup_20190131_162611.ocr 811007039
ol6-112-rac1 2019/01/31 14:59:53 /u01/app/12.1.0/grid/cdata/ol6-112-scan/backup_20190131_145953.ocr 811007039
ol6-112-rac1 2019/01/31 14:32:55 /u01/app/12.1.0/grid/cdata/ol6-112-scan/backup_20190131_143255.ocr 811007039
ol6-112-rac2 2019/01/31 14:19:12 /u01/app/12.1.0/grid/cdata/ol6-112-scan/backup_20190131_141912.ocr 811007039
[root@ol6-112-rac2 ol6-112-scan]# cat crsd.trc | grep 'MASTER NAME'
2019-01-31 16:53:35.919932 : CRSPE:1270863616: {2:31733:9} PE MASTER NAME: ol6-112-rac1
5. Normally the node which joins the cluster first is the master node,
ReplyDeletemeans the first node started in the cluster which will be the master node.