连接到RAC数据库的时候经常会出现ORA-12545错误,在METALINK上查询了一下,是Oracle的一个小bug。
Oracle在文档Note:364855.1:RAC Connection Redirected To Wrong Host/IP ORA-12545中进行了相关的描述。
并给出了解决方法:修改数据库中的初始化参数LOCAL_LISTENER:
SQL> CONN SYS@RAC1 AS SYSDBA输入口令: ****已连接。
SQL> ALTER SYSTEM SET LOCAL_LISTENER = ‘(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.111.11)(PORT = 1521))' SID = 'RAC1';
系统已更改。
SQL> CONN SYS@RAC2 AS SYSDBA输入口令: ****已连接。
SQL> ALTER SYSTEM SET LOCAL_LISTENER = '(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.111.12)(PORT = 1521))'
3 SID = 'RAC2';
系统已更改。
设置之后,再次尝试连接数据库:
修改之后,没有再次出现同样的错误。
METALINK:364855.1
找到解决方法:
Symptoms
When we try to connect to a RAC service name we sometimes get redirected by the first node's listener to the public address/hostname of the second node instead of its VIP address. An ORA-12545 error may be generated if that public hostname is not configured in DNS.
We were expecting the connection to eventually be redirected to the VIP of the other node.
Cause
The Database on one RAC node remote registers with the wrong local IP address to the listener on the other RAC node (e.g. the public IP address instead of the wanted VIP address).
The PMON process handles database registration to the local and remote listeners. For remote listeners registration PMON will have to find out what is the IP address of the local system in order to present it to the remote listener as database contact address.
In the default Oracle configuration, for hosts which have more than one IP address configured on the network interfaces, it is undefined which IP address will be selected for remote registration.
Solution
Modify the local_listener database parameter to point to the local VIP address. For the parameter value use either an alias name which contains in the DESCRIPTION field only the VIP address or use an explicit connection statement like the following:
alter system set LOCAL_LISTENER="(ADDRESS=(PROTOCOL=TCP)(HOST=)(PORT=1521))" scope=both sid='instance_name';
记得一定要是双引号
Where "instance_name" is the unique instance name. Issue this statement for all instances in the cluster. The LOCAL_LISTENER database parameter will give PMON a hint in respect of which IP address it should use for remote registration with other nodes' listener(s).
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/7214331/viewspace-673238/
,如需转载,请注明出处,否则将追究法律责任。