如何获得rac环境中的主节点
1个回答
展开全部
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
在节点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
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询