Oracle11gR2RAC using scanIP cannot connect to database (ORA-12545) Problem solved
Oracle 11gR2 RAC cannot connect to database (ORA-12545) Problem solved using scan IP
Environment:
[Grid @ rac1 ~] $ Cat/etc/hosts
# Do not remove the following line, or various programs
# That require network functionality will fail.
127.0.0.1 localhost. localdomain localhost
: 1 localhost6.localdomain6 localhost6
# Public
192.168.2.101 rac1
192.168.2.102 rac2
# Private
The 192.168.0.101 rac1-priv
192.168.0.102 rac2-priv
# Virtual
192.168.2.111 rac1-vip
Rac2-vip 192.168.2.112
# SCAN
192.168.2.200 rac-scan
Symptom:
The SQL plus tool on the windows client cannot be connected using the scan IP address. The following error is returned:
C: \ Users \ WJW> sqlplus system/qweasd@192.168.2.200: 1521/orcl
SQL * Plus: Release 11.2.0.1.0 Production on Thu May 17 12:35:28 2012
Copyright (c) 1982,201 0, Oracle. All rights reserved.
ERROR:
ORA-12545: Connect failed because target host or object does not exist
Check the status of each component, which is normal:
[Grid @ rac1 ~] $ Crs_stat-t
Name Type Target State Host
------------------------------------------------------------
Ora. DATA. dg ora... up. type ONLINE rac1
Ora... ER. lsnr ora... er. type ONLINE rac1
Ora... N1.lsnr ora... er. type ONLINE rac1
Ora. asm ora. asm. type ONLINE rac1
Ora. eons ora. eons. type ONLINE rac1
Ora. gsd ora. gsd. type ONLINE rac1
Ora... network ora... rk. type ONLINE rac1
Ora. Solaris ora. productname. type ONLINE rac2
Ora. ons ora. ons. type ONLINE rac1
Ora. orcl. db ora... se. type ONLINE rac1
Ora... SM1.asm application ONLINE rac1
Ora... C1.lsnr application ONLINE rac1
Ora. rac1.gsd application ONLINE rac1
Ora. rac1.ons application ONLINE rac1
Ora. rac1.vip ora... t1.type ONLINE rac1
Ora... SM2.asm application ONLINE rac2
Ora... C2.lsnr application ONLINE rac2
Ora. rac2.gsd application ONLINE rac2
Ora. rac2.ons application ONLINE rac2
Ora. rac2.vip ora... t1.type ONLINE rac2
Ora. scan1.vip ora... ip. type ONLINE rac1
Check the listener status. Normal:
[Grid @ rac1 ~] $ Lsnrctl status
LSNRCTL for Linux: Version 11.2.0.1.0-Production on 17-MAY-2012 13:27:40
Copyright (c) 1991,200 9, Oracle. All rights reserved.
Connecting to (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC) (KEY = LISTENER )))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0-Production
Start Date 17-MAY-2012 12:19:51
Uptime 0 days 1 hr. 7 min. 50 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File/u01/app/grid/network/admin/listener. ora
Listener Log File/u01/app/oracle/diag/tnslsnr/rac1/listener/alert/log. xml
Listening Endpoints Summary...
(DESCRIPTION = (ADDRESS = (PROTOCOL = ipc) (KEY = LISTENER )))
(DESCRIPTION = (ADDRESS = (PROTOCOL = tcp) (HOST = 192.168.2.101) (PORT = 1521 )))
(DESCRIPTION = (ADDRESS = (PROTOCOL = tcp) (HOST = 192.168.2.111) (PORT = 1521 )))
Services Summary...
Service "+ ASM" has 1 instance (s ).
Instance "+ ASM1", status READY, has 1 handler (s) for this service...
Service "orcl" has 1 instance (s ).
Instance "orcl1", status READY, has 1 handler (s) for this service...
Service "orclXDB" has 1 instance (s ).
Instance "orcl1", status READY, has 1 handler (s) for this service...
The command completed successfully
[Grid @ rac2 ~] $ Lsnrctl status
LSNRCTL for Linux: Version 11.2.0.1.0-Production on 17-MAY-2012 13:28:23
Copyright (c) 1991,200 9, Oracle. All rights reserved.
Connecting to (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC) (KEY = LISTENER )))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0-Production
Start Date 17-MAY-2012 12:19:51
Uptime 0 days 1 hr. 8 min. 32 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File/u01/app/grid/network/admin/listener. ora
Listener Log File/u01/app/oracle/diag/tnslsnr/rac2/listener/alert/log. xml
Listening Endpoints Summary...
(DESCRIPTION = (ADDRESS = (PROTOCOL = ipc) (KEY = LISTENER )))
(DESCRIPTION = (ADDRESS = (PROTOCOL = tcp) (HOST = 192.168.2.112) (PORT = 1521 )))
(DESCRIPTION = (ADDRESS = (PROTOCOL = tcp) (HOST = 192.168.2.102) (PORT = 1521 )))
Services Summary...
Service "+ ASM" has 1 instance (s ).
Instance "+ ASM2", status READY, has 1 handler (s) for this service...
Service "orcl" has 1 instance (s ).
Instance "orcl2", status READY, has 1 handler (s) for this service...
Service "orclXDB" has 1 instance (s ).
Instance "orcl2", status READY, has 1 handler (s) for this service...
The command completed successfully
[Grid @ rac1 ~] $ Lsnrctl status listener_scan1
LSNRCTL for Linux: Version 11.2.0.1.0-Production on 17-MAY-2012 13:29:09
Copyright (c) 1991,200 9, Oracle. All rights reserved.
Connecting to (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC) (KEY = LISTENER_SCAN1 )))
STATUS of the LISTENER
------------------------
Alias LISTENER_SCAN1
Version TNSLSNR for Linux: Version 11.2.0.1.0-Production
Start Date 17-MAY-2012 12:21:31
Uptime 0 days 1 hr. 7 min. 37 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File/u01/app/grid/network/admin/listener. ora
Listener Log File/u01/app/grid/log/diag/tnslsnr/rac1/listener_scan1/alert/log. xml
Listening Endpoints Summary...
(DESCRIPTION = (ADDRESS = (PROTOCOL = ipc) (KEY = LISTENER_SCAN1 )))
(DESCRIPTION = (ADDRESS = (PROTOCOL = tcp) (HOST = 192.168.2.200) (PORT = 1521 )))
Services Summary...
Service "orcl" has 2 instance (s ).
Instance "orcl1", status READY, has 1 handler (s) for this service...
Instance "orcl2", status READY, has 1 handler (s) for this service...
Service "orclXDB" has 2 instance (s ).
Instance "orcl1", status READY, has 1 handler (s) for this service...
Instance "orcl2", status READY, has 1 handler (s) for this service...
The command completed successfully
Cause:
Metalink Description: Client is able to resolve all Fully Qualified Domain Name (FQDN) SCAN and VIP name but not short ones (without domain name) as its in different domain;
Even though FQDN names were specified during Grid Infrastructure setup, due to bug 9150053 by default DBCA set database parameter local_listener to short node VIP name
While database is created.
Therefore, you only need to change the host in the database instance parameter local_listener to the vip IP address.
Solution:
Rac1:
SQL> show parameter local_listener
NAME TYPE VALUE
-----------------------------------------------------------------------------
Local_listener string (DESCRIPTION = (ADDRESS_LIST = (AD
DRESS = (PROTOCOL = TCP) (HOST = rac1
-Vip) (PORT = 1521 ))))
SQL> alter system set local_listener = '(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.2.111) (PORT = 1521 )))) 'scope = both sid = 'orcl1 ';
SQL> alter system register;
Rac2:
SQL> show parameter local_listener
NAME TYPE VALUE
-----------------------------------------------------------------------------
Local_listener string (DESCRIPTION = (ADDRESS_LIST = (AD
DRESS = (PROTOCOL = TCP) (HOST = rac2
-Vip) (PORT = 1521 ))))
SQL> alter system set local_listener = '(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.2.112) (PORT = 1521 )))) 'scope = both sid = 'orcl2 ';
SQL> alter system register;
Then the windows client is connected successfully:
C: \ Users \ WJW> sqlplus system/qweasd@192.168.2.200: 1521/orcl
SQL * Plus: Release 11.2.0.1.0 Production on Thu May 17 13:14:39 2012
Copyright (c) 1982,201 0, Oracle. All rights reserved.
Connected:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options