ITPub博客

首页 > 数据库 > Oracle > 11gR2不能在client段通过scanip连接的解决办法

11gR2不能在client段通过scanip连接的解决办法

原创 Oracle 作者:warehouse 时间:2012-09-23 19:15:06 0 删除 编辑

通过vip连接没有问题,通过scanip配置tns以后tnsping可以,但是连接时报错

[@more@]

通过vip连接没有问题,通过scanip配置tns以后tnsping可以,但是连接时报错

tns配置如下:

SCANIP =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac-scan)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = racdb)
)
)

C:>tnsping scanip

TNS Ping Utility for 64-bit Windows: Version 11.2.0.1.0 - Production on 23-9月 -
2012 19:13:31

Copyright (c) 1997, 2010, Oracle. All rights reserved.

已使用的参数文件:
f:oracleproduct11.2.0client_1networkadminsqlnet.ora


已使用 TNSNAMES 适配器来解析别名
尝试连接 (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = rac-s
can)(PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = racdb))
)
OK (160 毫秒)

C:>sqlplus sys/system@scanip as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on 星期日 9月 23 19:16:03 2012

Copyright (c) 1982, 2010, Oracle. All rights reserved.

ERROR:
ORA-12545: 因目标主机或对象不存在, 连接失败


请输入用户名:
ERROR:
ORA-12560: TNS: 协议适配器错误


请输入用户名:
ERROR:
ORA-12560: TNS: 协议适配器错误


SP2-0157: 在 3 次尝试之后无法连接到 ORACLE, 退出 SQL*Plus

解决步骤:

1、在client段的hosts文件中增加scanip和主机的对应关系如下:

192.168.0.20 rac-scan

2、修改2个node的local_listener参数,把vip对应的主机名改成vip地址。

--======================================

SQL> show parameter listener

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
listener_networks string
local_listener string (DESCRIPTION=(ADDRESS_LIST=(AD
DRESS=(PROTOCOL=TCP)(HOST=rac2
-vip)(PORT=1521))))
remote_listener string rac-scan:1521
SQL> alter system set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.16)(PORT=1521))))' scope=both sid='racdb2';

System altered.

SQL> show parameter listener

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
listener_networks string
local_listener string (DESCRIPTION=(ADDRESS_LIST=(AD
DRESS=(PROTOCOL=TCP)(HOST=192.
168.0.16)(PORT=1521))))
remote_listener string rac-scan:1521
SQL>

--=======================================

C:>
C:>sqlplus sys/system@scanip as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on 星期日 9月 23 19:16:16 2012

Copyright (c) 1982, 2010, Oracle. All rights reserved.


连接到:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management a
nd Real Application Testing options

SQL>

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

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

注册时间:2007-12-07

  • 博文量
    716
  • 访问量
    5088950