如何獲得rac環境中的主節點(how to identify master node in rac)

1.通過執行ocrconfig -showbackup獲得

 

在節點1上執行
[oracle@dbrac1 ~]$ ocrconfig -showbackup

dbrac1     2012/01/04 10:00:03     /opt/oracle/product/crs/cdata/crs

dbrac1     2012/01/04 06:00:03     /opt/oracle/product/crs/cdata/crs

dbrac1     2012/01/04 02:00:03     /opt/oracle/product/crs/cdata/crs

dbrac1     2012/01/02 10:00:02     /opt/oracle/product/crs/cdata/crs

dbrac1     2011/12/25 01:59:53     /opt/oracle/product/crs/cdata/crs

在節點2上執行
[oracle@dbrac2 ~]$ ocrconfig -showbackup

dbrac1     2012/01/04 10:00:03     /opt/oracle/product/crs/cdata/crs

dbrac1     2012/01/04 06:00:03     /opt/oracle/product/crs/cdata/crs

dbrac1     2012/01/04 02:00:03     /opt/oracle/product/crs/cdata/crs

dbrac1     2012/01/02 10:00:02     /opt/oracle/product/crs/cdata/crs

dbrac1     2011/12/25 01:59:53     /opt/oracle/product/crs/cdata/crs


2. 還可以通過下面的語句獲得

 

 

 

 

$cat $ORA_CRS_HOME/log/`hostname`/cssd/ocssd* |grep master
or
$ for x in `ls -tr $ORA_CRS_HOME/log/`hostname`/cssd/ocssd* `; do grep -i "master node" $x ; done | tail -1

 

 

 

 

 

****************************************************另一種方法*************************************************************

 

Oracle 12.1.0.2c Standard Cluster: New Location / Name For Alert Log

 

In my last post, I had presumed there is a bug since I discovered an empty clusterware alert log in its conventional location i.e.  $ORACLE_HOME/log/<hostname>in 12.1.0.2 standard cluster.

 

 

 

[grid@host01 ~]$ crsctl query crs activeversion;
Oracle Clusterware active version on the cluster is [12.1.0.2.0]

[root@host01 host01]# ls -l /u01/app/12.1.0/grid/log/host01/alerthost01.log

-rw-rw-r– 1 grid oinstall 0 Jun 15 14:10 /u01/app/12.1.0/grid/log/host01/alerthost01.log


But as commented by Ricardo Portillo Proni,  in 12c,  the location of alert log has been changed to $ORACLE_BASE/diag/crs/<hostname>/crs/trace/

 

 

 

Hence, I could successfully  the alert log on node host01 in directory  $ORACLE_BASE/diag/crs/host01/crs/trace/

[grid@host01 trace]$ ls -l $ORACLE_BASE/diag/crs/host01/crs/trace/alert*

-rw-rw—- 1 root oinstall 812316 Aug 11 10:22 /u01/app/grid/diag/crs/host01/crs/trace/alert.log

 

Another noticeable thing is that name of clusterware alert log has been changed to alert.log as compared to alert<hostname>.log in 11g.

 

 

 

 

I would like to mention that I have verified the above only in12.1.0.2 standard cluster.

 

In 12.1.0.1 flex cluster though, the location and name of  alert log location is same as in 11g i.e. $ORACLE_HOME/log/host01

 

[root@host01 host01]# crsctl query crs activeversion
Oracle Clusterware active version on the cluster is [12.1.0.1.0]

[root@host01 host01]# ls -l $ORACLE_HOME/log/host01/alert*
-rw-rw-r-- 1 grid oinstall 497364 Aug 11 11:00 /u01/app/12.1.0/grid/log/host01/alerthost01.log

 

 

 

 

 

Conclusion:

12.1.0.2 standard cluster

 

  • Name of alert log : alert.log
  • location of alert log: $ORACLE_BASE/diag/crs/host01/crs/trace

 

 

12.1.0.1 flex cluster

  • Name of alert log : alert<hostname>.log
  • location of alert log: $ORACLE_HOME/log/host01

Hope it helps!

Pls refer to comments for further information.

 

 

 

References:

Oracle RAC 12c (12.1.0.2) Operational Best Practices (Oracle Presentation)

———————————————————————————————————————–

Related Links :

Home

12c RAC Index

Oracle 12.1.0.2 Standard Cluster: Empty Alert Log

 

 

 

 

 

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章