oracle数据库客户端连接11gR2 SCAN 报ORA-12545错误
oracle数据库客户端连接11gR2 SCAN 报ORA-12545错误
今天装好aix rac for 11gR2,用客户端连接配置好的scan 名,利用tnsping 服务名时能正常连接
然后sqlplus system/abcdefg@orcl 时报ORA-12545 目标主机不存在的错误
11gR2 版本默认会把local_listener参数配置上去,如以下格式
show parameter local_listener
local_listener
'(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=p550-vip)(PORT=1521))))'
host对应的是vip name,而不是vip 地址,这是因为在11gR2 dbca 创建数据库时自动添加上去的
而vip name在对应客户端无法解析这个主机名,才出现ORA-12545错误
两种解决方法:
1.database级别
把local_listenener参数改成vip地址即可
语法如下:
SQL> alter system set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=eyrac1fv.us.oracle.com)(PORT=1521))))' sid='b2no1';
Or
SQL> alter system set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=120.0.0.211)(PORT=1521))))' sid='b2no1';
And register with listener:
SQL> alter system register;
然后客户端连接正常
2.client级别
Per client setting:
Specify FQDN SCAN name in client tnsnames.ora and add all node VIP name/IP pairs to hosts file:
grep eyrac1fv /etc/hosts
120.0.0.211 eyrac1fv.us.oracle.com eyrac1fv
Or set search domain: in /etc/resolv.conf on Linux/Unix or "Append DNS suffixes" on Windows
Linux/Unix:
grep search /etc/resolv.conf
search us.oracle.com
Windows:
Network Connection => Property for Public Network => Internet Protocol (TCP/IP) => Advanced => DNS => Append these DNS suffices (in order)
可以参考metalink ID 970619.1 ,这个问题在11.2.0.2版本中修复。