RAC TNS-1184和1185错误解决

本文介绍了解决Oracle RAC环境中服务注册失败的问题,包括两种常见错误TNS-01184和TNS-01185的出现原因及解决方案,通过正确配置LOCAL_LISTENER和REMOTE_LISTENER参数解决问题。

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

原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。 http://929044991.blog.51cto.com/1758347/1296926

第一种情况

APPLIES TO:

Oracle Net Services - Version 10.1.0.2 to 11.2.0.3 [Release 10.1 to 11.2]
Information in this document applies to any platform.
Checked for relevance on 8-jul-2013.

Oracle Net and RAC from 10.1 onwards.


SYMPTOMS

In a RAC environment the lsnrctl services shows the remote instance in blocked state. The listener.log shows following errors:

TNS-01184: Listener rejected registration or update of service handler "string"
TNS-01185: Registration attempted from a remote node



CAUSE

TNS-01184: Listener rejected registration or update of service handler "string"
Cause: Received registration or update information could not be processed because it was invalid, or an internal error occurred.

TNS-01185: Registration attempted from a remote node
Cause: It was determined that the registering instance is not located on the same node as the listener. It is required that the instance be collocated with the listener for this type of service registration.

This error indicates that the LOCAL_LISTENER and REMOTE_LISTENER database parameters are not configured correctly in the database instances.

SOLUTION

Configure LOCAL_LISTENER and REMOTE_LISTENER correctly. Please ensure that LOCAL_LISTENER parameter specifies only local listeners and use REMOTE_LISTENER parameter to specify remote listeners in your database instance.

1. Example TNSNAMES.ORA entries for two node cluster, Node1 & Node2
Two Local listener entries, followed by remote listener entry

LISTENER_LOCAL1=
(ADDRESS = (PROTOCOL = TCP)(HOST = Node1-vip)(PORT = 1521))

LISTENER_LOCAL2 =
(ADDRESS = (PROTOCOL = TCP)(HOST = Node2-vip)(PORT = 1521))


LISTENERS_REMOTE =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = Node1-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = Node2-vip)(PORT = 1521))
)


2. Then in sqlplus

sqlplus /nolog
SQL> connect / as sysdba
SQL> alter system set LOCAL_LISTENER='LISTENER_LOCAL1' scope=both sid='Instance1';
SQL> alter system set LOCAL_LISTENER='LISTENER_LOCAL2' scope=both sid='Instance2';
SQL> alter system set REMOTE_LISTENER='LISTENERS_REMOTE' scope=both;


——————————————

第二种情况

SYMPTOMS


Following errors are seen in the listener.log file at an interval of one minute apart:

01-APR-2010 11:40:29 * service_register * ses * 1184
TNS-01184: Listener rejected registration or update of service handler "DEDICATED"
TNS-01185: Registration attempted from a remote node
01-APR-2010 11:40:29 * service_died * ses * 12537


Checking the listener status shows that no services are blocked and that all services are registered correctly and in status READY:

lsnrctl status list_ses

LSNRCTL for HPUX: Version 10.2.0.4.0 - Production on 31-MAR-2010 18:05:26

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=172.16.122.185)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias list_ses
Version TNSLSNR for HPUX: Version 10.2.0.4.0 - Production
Start Date 31-MAR-2010 18:02:11
Uptime 0 days 0 hr. 3 min. 15 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /opt/oracle/ses/Ora102/network/admin/listener.ora
Listener Log File /opt/oracle/ses/Ora102/network/log/list_ses.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.16.122.185)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.16.121.185)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=extproc_ses)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "ses" has 2 instance(s).
Instance "ses", status UNKNOWN, has 1 handler(s) for this service...
Instance "ses", status READY, has 1 handler(s) for this service...
Service "sesXDB" has 1 instance(s).
Instance "ses", status READY, has 1 handler(s) for this service...
Service "ses_XPT" has 1 instance(s).
Instance "ses", status READY, has 1 handler(s) for this service...
The command completed successfully


A level 16 listener trace will reveal the following message AFTER the foreign registration packet arrives:

2013-03-27 16:47:56.748963 : nsglgrDoRegister:error - locality check failed for bequeath handler



CAUSE


The instance's setting for LOCAL_LISTENER must be pointed to an address that is local to the instance. It cannot be set to point to a listener address that is remote.

The TNS-01185 error verifies that the registering instance is not located on the same node as the listener and hence the registration of the service with this listener is failing.


SOLUTION

Looks like these failed registrations are coming from another instance running on a remote host.
Please check (and correct) the LOCAL_LISTENER initialization parameter for any remote instances so that they are not configured to point to a LOCAL_LISTENER setting that corresponds to a remote address. Please ensure that LOCAL_LISTENER parameter specifies only local listeners and use the REMOTE_LISTENER parameter to specify remote listeners in your database instances.

<think>好的,我现在需要解决用户在Oracle 19c RAC单节点数据库启动时遇到的ORA-12560 TNS协议适配器错误。首先,我得回忆一下ORA-12560错误的常见原因处理方法。这个错误通常与TNS监听器配置、环境变量设置或者实例状态有关。不过用户是在RAC环境中,而且是单节点启动,可能需要考虑RAC特有的配置问题。 首先,用户提到的是单节点启动,可能需要确认是否正确的设置了ORACLE_SID环境变量。在RAC环境中,每个节点通常有唯一的实例名,比如加上节点号的后缀。如果用户没有正确设置ORACLE_SID到当前节点的实例名,可能会导致无法连接到实例,从而引发ORA-12560。这时候需要检查.bash_profile或者对应的shell配置文件,确认ORACLE_SID是否正确。例如,节点1的实例可能是ORCL1,而不是ORCL。 其次,检查监听器状态。在RAC环境中,每个节点都有自己的监听器,或者可能使用SCAN监听器。用户需要确认监听器是否在运行,使用lsnrctl status命令查看监听状态。如果监听器没有启动,或者没有正确注册实例,可能导致连接问题。此外,TNSNAMES.ORA文件中的配置是否正确,特别是服务名实例名的对应关系是否正确,需要核实。比如,是否使用了正确的服务名或者SID。 另外,数据库实例是否真的已经启动。有时候用户可能认为实例已经启动,但实际上可能由于参数文件错误、存储问题等导致实例未能成功启动。使用ps -ef | grep pmon命令检查PMON进程是否存在,确认实例是否在运行。如果实例未启动,需要查看alert日志文件,找到具体的启动错误原因。 还有,检查sqlnet.ora文件中的配置,特别是ADR设置或者认证方式是否有问题。例如,SQLNET.AUTHENTICATION_SERVICES参数是否设置为NONE或者包含了合适的认证方式,比如ALL或者NTS(在Windows上)。不过用户的环境是Linux,可能需要不同的设置。 此外,在RAC环境中,可能需要检查集群资源的状态。使用crsctl status resource -t命令查看数据库资源是否在线。如果资源未在预期节点上运行,可能需要手动启动资源或者检查集群配置问题。 用户提供的引用[1][2]中提到了一些目录创建参数设置的样例。比如,在引用[2]中提到了备库目录的创建,以及集群相关参数需要去掉。这可能意味着在单节点启动时,某些原本适用于集群的参数可能被错误保留,导致实例无法正确启动。因此需要检查参数文件(spfile或pfile)中的参数是否正确,特别是与集群相关的参数如CLUSTER_DATABASE是否被设置为FALSE,或者是否去掉了与RAC相关的参数。 另外,用户的问题可能涉及到TNS配置是否正确。例如,在tnsnames.ora中是否配置了正确的服务名、主机名端口。例如,是否指向了本地监听器的地址(比如LISTENER_NODE1),或者SCAN监听器的地址。如果配置的是SCAN监听器,但当前节点监听器未运行,可能导致连接问题。 总结一下,可能的解决步骤包括: 1. 检查ORACLE_SID环境变量是否正确设置。 2. 确认监听器状态,并确保实例已注册到监听器。 3. 检查实例是否真正启动,查看alert日志。 4. 检查参数文件中的集群相关参数是否正确。 5. 验证TNSNAMES.ORALISTENER.ORA的配置是否正确。 6. 确保sqlnet.ora中没有不合适的配置。 7. 检查集群资源状态,必要时重启资源。 在逐步排查这些可能性后,应该能找到问题的根源并解决ORA-12560错误。</think>### Oracle 19c RAC单节点启动ORA-12560错误解决方案 #### 1. 检查环境变量配置 - **确认`ORACLE_SID`是否正确** 在RAC环境中,每个节点的实例名通常带有节点编号(如`ORCL1`、`ORCL2`)。执行以下命令检查: ```bash echo $ORACLE_SID ``` 若未正确设置,需在用户配置文件(如`.bash_profile`)中修正,例如: ```bash export ORACLE_SID=ORCL1 ``` 修改后执行`source ~/.bash_profile`生效。 - **验证`ORACLE_HOME`路径** 确保`ORACLE_HOME`指向正确的RAC安装目录: ```bash echo $ORACLE_HOME ``` #### 2. 检查监听器状态 - **查看本地监听器是否运行** 执行以下命令检查监听状态: ```bash lsnrctl status LISTENER_NODE1 # 替换为实际监听器名称 ``` 若未启动,执行`lsnrctl start LISTENER_NODE1`。 - **确认实例注册状态** 在监听器状态输出中检查实例是否显示为`READY`。若未注册,手动注册: ```sql ALTER SYSTEM REGISTER; ``` #### 3. 检查数据库实例状态 - **确认实例是否已启动** 通过进程检查: ```bash ps -ef | grep pmon ``` 若无相关进程,尝试启动实例: ```sql sqlplus / as sysdba SQL> STARTUP ``` - **查看告警日志定位问题** 检查`$ORACLE_BASE/diag/rdbms/<db_name>/<instance_name>/trace/alert_<instance_name>.log`,分析启动失败的具体原因(如参数错误、存储权限问题)[^2]。 #### 4. 验证参数文件配置 - **检查`CLUSTER_DATABASE`参数** 单节点启动时需确保参数`CLUSTER_DATABASE=FALSE`,若需临时启动单实例,可通过以下方式修改: ```sql CREATE pfile='/tmp/pfile.ora' FROM spfile; -- 修改pfile.ora中CLUSTER_DATABASE=FALSE,删除集群相关参数 SQL> STARTUP PFILE='/tmp/pfile.ora'; ``` - **移除冗余集群参数** 确保参数文件中未包含`CLUSTER_NODES`、`REMOTE_LISTENER`等集群专用参数。 #### 5. 检查网络配置 - **验证`tnsnames.ora`配置** 检查连接描述符是否指向正确的主机端口,例如: ```tnsnames ORCL1 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = node1-vip)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SID = ORCL1) ) ) ``` - **确认`listener.ora`配置** 确保监听器配置包含实例的静态注册(仅限未自动注册时): ```listener.ora SID_LIST_LISTENER_NODE1 = (SID_LIST = (SID_DESC = (GLOBAL_DBNAME = ORCL) (ORACLE_HOME = /u01/app/oracle/product/19c/dbhome_1) (SID_NAME = ORCL1) ) ) ``` #### 6. 检查集群资源状态 - **查看数据库资源状态** 使用`crsctl`检查资源是否在线: ```bash crsctl status resource -t ``` 若数据库资源未运行,尝试启动: ```bash srvctl start database -d ORCL -node node1 ``` #### 7. 其他可能原因 - **检查`sqlnet.ora`配置** 确保未设置`SQLNET.AUTHENTICATION_SERVICES=NONE`导致认证失败。 - **权限问题** 确认`/u01/app/oracle/admin`等目录权限为`oracle:oinstall`[^2]。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值