如何获得rac环境中的主节点(how to identify master node in rac)

This blog discusses the changes in alert log location and name for Oracle 12.1.0.2 standard cluster, specifically focusing on the move of alert log to $ORACLE_BASE/diag/crs/host01/crs/trace directory and the renaming from alert<hostname>.log to alert.log.

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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

 

 

 

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值