错误描述,RAC安装完成后,客户端有一定几率链接失败,报错如下:
ERROR:
ORA-12545: 因目标主机或对象不存在,连接失败
ORA-12545: 因目标主机或对象不存在,连接失败
环境中安装RAC Database时候忘记了先配置netca。
故注册下LOCAL_LISTENER
如下:
代码
1 1,在node1,node2上分别编辑服务器端tnsname.ora (注意,是服务器端的)
2 将下面部分
3 LISTENERS_TEST =
4 (ADDRESS_LIST =
5 (ADDRESS = (PROTOCOL = TCP)(HOST = node1-vip)(PORT = 1521))
6 (ADDRESS = (PROTOCOL = TCP)(HOST = node2-vip)(PORT = 1521))
7 )
8 改为:
9 LISTENERS_TEST =
10 (ADDRESS_LIST =
11 (ADDRESS = (PROTOCOL = TCP)(HOST = 201.150.14.19)(PORT = 1521))
12 (ADDRESS = (PROTOCOL = TCP)(HOST = 201.150.14.20)(PORT = 1521))
13 )
14 也就是将vip主机名改为ip地址
15
16 2.在node1上增加以下部分
17 LOCAL_LISTENER =
18 (ADDRESS_LIST =
19 (ADDRESS = (PROTOCOL = TCP)(HOST = 201.150.14.9)(PORT = 1521))
20 )
21
22 3.在node2上增加以下部分
23 LOCAL_LISTENER =
24 (ADDRESS_LIST =
25 (ADDRESS = (PROTOCOL = TCP)(HOST = 201.150.14.10)(PORT = 1521))
26 )
27
28 4,用system用户登录
29 执行
30 alter system set local_listener='LOCAL_LISTENER' scope=both;
31
32 5 重启所有实例 所有监听.
2 将下面部分
3 LISTENERS_TEST =
4 (ADDRESS_LIST =
5 (ADDRESS = (PROTOCOL = TCP)(HOST = node1-vip)(PORT = 1521))
6 (ADDRESS = (PROTOCOL = TCP)(HOST = node2-vip)(PORT = 1521))
7 )
8 改为:
9 LISTENERS_TEST =
10 (ADDRESS_LIST =
11 (ADDRESS = (PROTOCOL = TCP)(HOST = 201.150.14.19)(PORT = 1521))
12 (ADDRESS = (PROTOCOL = TCP)(HOST = 201.150.14.20)(PORT = 1521))
13 )
14 也就是将vip主机名改为ip地址
15
16 2.在node1上增加以下部分
17 LOCAL_LISTENER =
18 (ADDRESS_LIST =
19 (ADDRESS = (PROTOCOL = TCP)(HOST = 201.150.14.9)(PORT = 1521))
20 )
21
22 3.在node2上增加以下部分
23 LOCAL_LISTENER =
24 (ADDRESS_LIST =
25 (ADDRESS = (PROTOCOL = TCP)(HOST = 201.150.14.10)(PORT = 1521))
26 )
27
28 4,用system用户登录
29 执行
30 alter system set local_listener='LOCAL_LISTENER' scope=both;
31
32 5 重启所有实例 所有监听.
还有一种办法是客户端修改hosts,把vip的命名解析加进去。但是不推荐。
以上主要解决Oracle bug:可以参考metalink 文档ID: 364855.1