ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 转帖---SUN系列RAC之五:解决监听UNKNOWN问题,并注册监听

转帖---SUN系列RAC之五:解决监听UNKNOWN问题,并注册监听

原创 Linux操作系统 作者:andyxu 时间:2009-12-08 09:40:59 0 删除 编辑

在上一部分遇到节点2监听状态为UNKNOWN问题。

进行了好一番折腾,依据D17276GC20第9章内容,先使用crs_profile,在crs_register搞不定,又使用/etc/init.d/init.crs stop | start还是搞不定,等等。

无奈,搜索Metalink发现一段描述,很隐蔽:

How can I register the listener with Oracle Clusterware in RAC 10g Release 2?
NetCA is the only tool that configures listener and you should be always using it. It will register the listener with Oracle Clusterware. There are no other supported alternatives.

看来使用crs_register无法注册监听(10.2.0.1),先执行crs_stop -all,再启用Netca重新配置监听,完成之后配置写入OCR。
使用crs_stat -t 看到两个节点的VIP和LSNR都已经起来了。

于是,crs_start -all。

Finish!

下面贴出折腾得过程。前车之鉴,在10.2.0.1中如果你也遇到监听UNKNOWN问题,直接使用Netca吧。


4 在所有节点上启动CRS
[root@rac1 bin]# ./crsctl start crs
Attempting to start CRS stack
The CRS stack will be started shortly
[root@rac1 bin]#

[root@rac2 bin]# ./crsctl start crs
Attempting to start CRS stack
The CRS stack will be started shortly
[root@rac2 bin]#

rac1-> crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.devdb.db application ONLINE ONLINE rac2
ora....b1.inst application ONLINE ONLINE rac1
ora....b2.inst application ONLINE ONLINE rac2
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE UNKNOWN rac2
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2
rac1->

注意到node2上的监听状态为UNKNOWN,需要处理一下:
ora....C2.lsnr application ONLINE UNKNOWN rac2
rac1-> crs_stop -f ora.rac2.LISTENER_RAC2.lsnr
Attempting to stop `ora.rac2.LISTENER_RAC2.lsnr` on member `rac2`
Stop of `ora.rac2.LISTENER_RAC2.lsnr` on member `rac2` succeeded.
rac1->
rac1-> crs_start -f ora.rac2.LISTENER_RAC2.lsnr
Attempting to start `ora.rac2.LISTENER_RAC2.lsnr` on member `rac2`
`ora.rac2.LISTENER_RAC2.lsnr` on member `rac2` has experienced an unrecoverable failure.
Human intervention required to resume its availability.
CRS-0215: Could not start resource 'ora.rac2.LISTENER_RAC2.lsnr'.

rac1->

看来需要彻底重启CRS服务:
[root@rac1 bin]# /etc/init.d/init.crs stop
Shutting down Oracle Cluster Ready Services (CRS):
Stopping resources.
Successfully stopped CRS resources
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
Shutdown has begun. The daemons should exit soon.
[root@rac1 bin]#

[root@rac2 bin]# /etc/init.d/init.crs stop
Shutting down Oracle Cluster Ready Services (CRS):
Stopping resources.
Successfully stopped CRS resources
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
Shutdown has begun. The daemons should exit soon.
[root@rac2 bin]#

[root@rac1 bin]# /etc/init.d/init.crs start
Startup will be queued to init within 90 seconds.
[root@rac1 bin]#

[root@rac2 bin]# /etc/init.d/init.crs start
Startup will be queued to init within 90 seconds.
[root@rac2 bin]#

rac1-> crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.devdb.db application ONLINE ONLINE rac2
ora....b1.inst application ONLINE ONLINE rac1
ora....b2.inst application ONLINE ONLINE rac2
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE UNKNOWN rac2
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2
rac1->

相当顽固,ora....C2.lsnr的State仍是UNKNOWN!不知是否运行,通过命令查看一下:
rac1-> srvctl status nodeapps -n rac2
VIP is running on node: rac2
GSD is running on node: rac2
Listener is not running on node: rac2
ONS daemon is running on node: rac2
rac1->

rac2-> crs_stop -all
Attempting to stop `ora.rac1.gsd` on member `rac1`
Attempting to stop `ora.rac1.ons` on member `rac1`
Stop of `ora.rac1.gsd` on member `rac1` succeeded.
Attempting to stop `ora.rac2.gsd` on member `rac2`
Stop of `ora.rac1.ons` on member `rac1` succeeded.
Attempting to stop `ora.rac2.ons` on member `rac2`
Stop of `ora.rac2.gsd` on member `rac2` succeeded.
Attempting to stop `ora.devdb.db` on member `rac2`
Stop of `ora.rac2.ons` on member `rac2` succeeded.
Stop of `ora.devdb.db` on member `rac2` succeeded.
Attempting to stop `ora.rac1.LISTENER_RAC1.lsnr` on member `rac1`
`ora.devdb.devdb2.inst` is already OFFLINE.
Attempting to stop `ora.rac2.ASM2.asm` on member `rac2`
Stop of `ora.rac1.LISTENER_RAC1.lsnr` on member `rac1` succeeded.
`ora.devdb.devdb1.inst` is already OFFLINE.
Attempting to stop `ora.rac1.ASM1.asm` on member `rac1`
Stop of `ora.rac1.ASM1.asm` on member `rac1` succeeded.
Stop of `ora.rac2.ASM2.asm` on member `rac2` succeeded.
Attempting to stop `ora.rac1.vip` on member `rac1`
Stop of `ora.rac1.vip` on member `rac1` succeeded.
Attempting to stop `ora.rac2.LISTENER_RAC2.lsnr` on member `rac2`
`ora.rac2.LISTENER_RAC2.lsnr` on member `rac2` has experienced an unrecoverable failure.
--这里说,节点2上的监听遇到了一个不可恢复的失败!可能是使用逻辑备份还原OCR造成的!
Human intervention required to resume its availability.
Attempting to stop `ora.rac2.vip` on member `rac2`
Stop of `ora.rac2.vip` on member `rac2` succeeded.
CRS-0216: Could not stop resource 'ora.devdb.devdb1.inst'.

CRS-0216: Could not stop resource 'ora.devdb.devdb2.inst'.

CRS-0216: Could not stop resource 'ora.rac2.vip'.

rac2->
rac2-> crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.devdb.db application OFFLINE OFFLINE
ora....b1.inst application OFFLINE OFFLINE
ora....b2.inst application OFFLINE OFFLINE
ora....SM1.asm application OFFLINE OFFLINE
ora....C1.lsnr application OFFLINE OFFLINE
ora.rac1.gsd application OFFLINE OFFLINE
ora.rac1.ons application OFFLINE OFFLINE
ora.rac1.vip application OFFLINE OFFLINE
ora....SM2.asm application OFFLINE OFFLINE
ora....C2.lsnr application OFFLINE UNKNOWN rac2
ora.rac2.gsd application OFFLINE OFFLINE
ora.rac2.ons application OFFLINE OFFLINE
ora.rac2.vip application OFFLINE OFFLINE
rac2->
rac2->
rac2-> crs_stop -f ora.rac2.LISTENER_RAC2.lsnr
Attempting to stop `ora.rac2.LISTENER_RAC2.lsnr` on member `rac2`
Stop of `ora.rac2.LISTENER_RAC2.lsnr` on member `rac2` succeeded.
rac2->
rac2-> crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.devdb.db application OFFLINE OFFLINE
ora....b1.inst application OFFLINE OFFLINE
ora....b2.inst application OFFLINE OFFLINE
ora....SM1.asm application OFFLINE OFFLINE
ora....C1.lsnr application OFFLINE OFFLINE
ora.rac1.gsd application OFFLINE OFFLINE
ora.rac1.ons application OFFLINE OFFLINE
ora.rac1.vip application OFFLINE OFFLINE
ora....SM2.asm application OFFLINE OFFLINE
ora....C2.lsnr application OFFLINE OFFLINE
ora.rac2.gsd application OFFLINE OFFLINE
ora.rac2.ons application OFFLINE OFFLINE
ora.rac2.vip application OFFLINE OFFLINE
rac2->

干净的重启:
rac2-> crs_start -all
Attempting to start `ora.rac1.vip` on member `rac1`
Attempting to start `ora.rac2.vip` on member `rac2`
Start of `ora.rac1.vip` on member `rac1` succeeded.
Start of `ora.rac2.vip` on member `rac2` succeeded.
Attempting to start `ora.rac1.ASM1.asm` on member `rac1`
Attempting to start `ora.rac2.ASM2.asm` on member `rac2`
Start of `ora.rac1.ASM1.asm` on member `rac1` succeeded.
Attempting to start `ora.devdb.devdb1.inst` on member `rac1`
Start of `ora.rac2.ASM2.asm` on member `rac2` succeeded.
Attempting to start `ora.devdb.devdb2.inst` on member `rac2`
Start of `ora.devdb.devdb1.inst` on member `rac1` succeeded.
Attempting to start `ora.rac1.LISTENER_RAC1.lsnr` on member `rac1`
Start of `ora.devdb.devdb2.inst` on member `rac2` succeeded.
Start of `ora.rac1.LISTENER_RAC1.lsnr` on member `rac1` succeeded.
Attempting to start `ora.rac2.LISTENER_RAC2.lsnr` on member `rac2`
`ora.rac2.LISTENER_RAC2.lsnr` on member `rac2` has experienced an unrecoverable failure.
Human intervention required to resume its availability.
CRS-1002: Resource 'ora.rac1.ons' is already running on member 'rac1'

CRS-1002: Resource 'ora.rac2.ons' is already running on member 'rac2'

Attempting to start `ora.rac1.gsd` on member `rac1`
Attempting to start `ora.rac2.gsd` on member `rac2`
Attempting to start `ora.devdb.db` on member `rac2`
Start of `ora.rac1.gsd` on member `rac1` succeeded.
Start of `ora.rac2.gsd` on member `rac2` succeeded.
Start of `ora.devdb.db` on member `rac2` succeeded.
CRS-0223: Resource 'ora.rac1.ons' has placement error.

CRS-0215: Could not start resource 'ora.rac2.LISTENER_RAC2.lsnr'.

CRS-0223: Resource 'ora.rac2.ons' has placement error.

rac2->
rac2-> crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.devdb.db application ONLINE ONLINE rac2
ora....b1.inst application ONLINE ONLINE rac1
ora....b2.inst application ONLINE ONLINE rac2
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE UNKNOWN rac2
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2
rac2->

看来rac2的监听的确在执行OCR逻辑还原的时候搞坏了。。。。
监听启动异常:
rac2-> lsnrctl start

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 08-MAR-2009 12:07:54

Copyright (c) 1991, 2005, Oracle. All rights reserved.

Starting /u01/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rac2.mycorpdomain.com)(PORT=1521)))

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 08-MAR-2009 12:07:54
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rac2.mycorpdomain.com)(PORT=1521)))
The listener supports no services
The command completed successfully
rac2->

根据资源依赖性,依次stop资源:
crs_stop ora.devdb.devdb2.inst
crs_stop ora.rac2.ASM2.asm
crs_stop -f ora.rac2.LISTENER_RAC2.lsnr
删除OCR中的监听项,重新添加:
crs_unregister ora.rac2.LISTENER_RAC2.lsnr
crs_register ora.rac2.LISTENER_RAC2.lsnr
rac1-> crs_unregister ora.rac2.LISTENER_RAC2.lsnr
rac1-> crs_register ora.rac2.LISTENER_RAC2.lsnr
CRS-0211: Resource 'ora.rac2.LISTENER_RAC2.lsnr' has already been registered.

rac1->
rac2-> crs_profile -create ora.rac2.LISTENER_RAC2.lsnr -t application -dir /u01/app/oracle/product/10.2.0/crs_1/crs/public/ora.rac2.LISTENER_RAC2.lsnr.cap -a

/u01/app/oracle/product/10.2.0/db_1/bin/racgwrap -d "CRS application for listener on node" -h rac2 -r ora.rac2.vip -p restricted -o

as=1,ci=600,ft=0,fi=0,ra=5,fd=0,st=600,ap=0,ut=7d,rt=0,pt=0
rac2->
rac2-> crs_register ora.rac2.LISTENER_RAC2.lsnr
NAME field must be set
rac2->
奇怪,crs_register怎么会注册不上监听。查询Metalink RAC FAQ,得到:
How can I register the listener with Oracle Clusterware in RAC 10g Release 2?
NetCA is the only tool that configures listener and you should be always using it. It will register the listener with Oracle Clusterware. There are no other

supported alternatives.

crs_stop -all之后,启用netca配置监听!

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/110321/viewspace-621909/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2009-06-26

  • 博文量
    167
  • 访问量
    293269