Tuesday, July 16, 2019

How to identify the Master Node in RAC

There are 3 possible ways

1. Identify the node which performs the backup of OCR 

$ ocrconfig -showbackup
node1     2017/06/17 21:32:42     +DATA_MGMT:/RAC01/OCRBACKUP/backup00.ocr.281.946935141     0
node1     2017/06/17 21:32:42     +DATA_MGMT:/RAC01/OCRBACKUP/day.ocr.282.946935163     0
node1     2017/06/17 21:32:42     +DATA_MGMT:/RAC01/OCRBACKUP/week.ocr.283.946935165     0
PROT-25: Manual backups for the Oracle Cluster Registry are not available

2. Check  crsd logs from various nodes.

cat crsd.trc |grep MASTER

2017-06-17 17:30:51.457 :  OCRMAS:2797573888: proath_master: SUCCESSFULLY CONNECTED TO THE MASTER
2017-06-17 17:30:51.457 :  OCRMAS:2797573888: th_master: NEW OCR MASTER IS 1
2017-06-17 17:30:52.095 :   CRSPE:2384393984: {2:12188:2} PE MASTER NAME: node1
2017-06-17 17:31:54.926 :  CRSOCR:2388596480: {2:12188:2} Registered PE standby with CSS. I AM A STANDBY MASTER.
2017-06-17 23:14:47.617 :  CRSOCR:2390697728: {2:12188:3229} Deregistered PE standby with CSS. I AM NO LONGER A STANDBY MASTER.
2017-06-17 23:21:50.596 :  OCRMAS:1748141824: proath_master: SUCCESSFULLY CONNECTED TO THE MASTER
2017-06-17 23:21:50.596 :  OCRMAS:1748141824: th_master: NEW OCR MASTER IS 1
2017-06-17 23:21:51.874 :   CRSPE:1121937152: {2:46838:2} PE MASTER NAME: node1
2017-06-17 23:22:15.020 :  CRSOCR:1130342144: {2:46838:2} Registered PE standby with CSS. I AM A STANDBY MASTER.

3.Check ocssd logs from various nodes.

cat ocssd.trc |grep MASTER

2017-06-17 17:30:54.010 :    CSSD:1971631872: clssgmOptagProcessGrockCreate: grock CLSN.ONSNETPROC.MASTER from node node1, number 1, with 1 attributes having size 20
2017-06-17 17:30:54.010 :    CSSD:1971631872: clssgmGenSetGrockAttr: grock CLSN.ONSNETPROC.MASTER, attribute MAXMBRNUM, type 7, length 4, value (512/512/0x200)
2017-06-17 17:30:54.010 :    CSSD:1971631872: clssgmGroupAttrPrint: Attributes for group CLSN.ONSNETPROC.MASTER, ID 32:2
2017-06-17 17:30:54.010 :    CSSD:1971631872: clssgmGroupAttrPrint: Attributes for group CLSN.ONSNETPROC.MASTER, ID 32:2
2017-06-17 17:30:54.010 :    CSSD:1971631872: clssgmsCreateMember: Created memberID 32:2:1 in group CLSN.ONSNETPROC.MASTER with event subscriptions 0x000000a1, flags 0x0 for clientID 1:76:18

What will happen if the Master Node is down.

very obious question, if the master node is down what will happen ? Does OCR will not be backed up?


When OCR master (crsd.bin process) stops or restarts for whatever reason, the crsd.bin on surviving node with lowest node number will become new OCR master.

Just to proof the same I restarted the Node1 which is my current master node and checked the logfile and did a Manual OCR backup too and you can see the result below


2017-06-18 00:17:15.398 :   CRSPE:1121937152: {2:46838:561} PE Role|State Update: old role [SLAVE] new [MASTER]; old state [Running] new [Configuring]
2017-06-18 00:17:15.398 :   CRSPE:1121937152: {2:46838:561} PE MASTER NAME: node2
2017-06-18 00:17:15.403 :  OCRMAS:1748141824: th_master:13: I AM THE NEW OCR MASTER at incar 7. Node Number 2
2017-06-18 00:17:15.407 :  OCRSRV:1128240896: proas_amiwriter: ctx is MASTER CHANGING/CONNECTING
2017-06-18 00:17:16.304 :   CRSPE:1121937152: {2:46838:561} PE Role|State Update: old role [MASTER] new [MASTER]; old state [Configuring] new [Starting]
2017-06-18 00:17:16.311 :   CRSPE:1121937152: {2:46838:561} PE Role|State Update: old role [MASTER] new [MASTER]; old state [Starting] new [Running]

lets do a Manual OCR backup and see whats Happening

[root@node1 oracle]# ocrconfig -manualbackup

node2     2017/06/18 00:23:47     +DATA_MGMT:/RAC01/OCRBACKUP/backup_20170618_002347.ocr.284.946945427     0


As you can see, although I executed the backup from node1, its node2 who took the backup


The easiest Way to Identify the Master Node in  Oracle 12c


and finially the easiest way. Works perfectly with 12c. Not Aware of about other versions

oclumon manage -get MASTER

No comments:

Post a Comment