RAC ORA_12545错误
用VMware在Linux下搭建好RAC,客户端连接到数据库报ORA_12545错误:一次成功,一次失败
原因:
This error happens when you enable server side load balancing but the client does not have domain address / DNS search function setup (or valid /etc/hosts file) so it cannot translate a hostname to a proper IP address.
使用默认端口1521会产生这个错误(没有测试过)
通过修改客户端的tnsnames.ora和C:\WINDOWS\system32\drivers\etc\hosts文件解决
在tnsnames.ora中添加下面的内容
RAC =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.182.15.101)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.182.15.102)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = RAC.WORLD)
)
)
注:HOST为VIP
在hosts中添加下面的内容
10.182.15.101 rac1-vip.localdomain rac1.localdomain
10.182.15.102 rac2-vip.localdomain rac2.localdomain
注: rac1-vip.localdomain为VIP对应的hostname; rac1.localdomain为hostname命令的执行结果
通过修改初始化参数local_listener解决
[oracle@rac1 ~]$ sqlplus sys@rac1 as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Apr 14 10:13:26 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Enter password:
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL> select instance_name from v$instance;
INSTANCE_NAME
----------------
RAC1
SQL> alter system set local_listener = '(ADDRESS = (PROTOCOL = TCP)(HOST = 10.182.15.101)(PORT = 1521))' SID='RAC1';
System altered.
[oracle@rac2 ~]$ sqlplus sys@rac2 as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Apr 14 10:26:45 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Enter password:
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL> select instance_name from v$instance;
INSTANCE_NAME
----------------
RAC2
SQL> alter system set local_listener = '(ADDRESS = (PROTOCOL = TCP)(HOST = 10.182.15.102)(PORT = 1521))' SID='RAC2';
System altered.
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7419833/viewspace-588949/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/7419833/viewspace-588949/