Oracle11gR2 RAC 使用scan IP无法连接数据库(ORA-12545)问题解决

环境:
[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
192.168.0.101     rac1-priv
192.168.0.102     rac2-priv
# Virtual
192.168.2.111     rac1-vip
192.168.2.112     rac2-vip
# SCAN
192.168.2.200     rac-scan

现象:

在windows客户端sqlplus工具使用scan的IP无法连接,报错如下:

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, 2010, Oracle.  All rights reserved.

ERROR:
ORA-12545: Connect failed because target host or object does not exist

检查各组件状态,正常:
[grid@rac1 ~]$ crs_stat -t
Name           Type           Target    State     Host       
------------------------------------------------------------
ora.DATA.dg    ora....up.type ONLINE    ONLINE    rac1       
ora....ER.lsnr ora....er.type ONLINE    ONLINE    rac1       
ora....N1.lsnr ora....er.type ONLINE    ONLINE    rac1       
ora.asm        ora.asm.type   ONLINE    ONLINE    rac1       
ora.eons       ora.eons.type  ONLINE    ONLINE    rac1       
ora.gsd        ora.gsd.type   ONLINE    ONLINE    rac1       
ora....network ora....rk.type ONLINE    ONLINE    rac1       
ora.oc4j       ora.oc4j.type  ONLINE    ONLINE    rac2       
ora.ons        ora.ons.type   ONLINE    ONLINE    rac1       
ora.orcl.db    ora....se.type ONLINE    ONLINE    rac1       
ora....SM1.asm application    ONLINE    ONLINE    rac1       
ora....C1.lsnr application    ONLINE    ONLINE    rac1       
ora.rac1.gsd   application    ONLINE    ONLINE    rac1       
ora.rac1.ons   application    ONLINE    ONLINE    rac1       
ora.rac1.vip   ora....t1.type ONLINE    ONLINE    rac1       
ora....SM2.asm application    ONLINE    ONLINE    rac2       
ora....C2.lsnr application    ONLINE    ONLINE    rac2       
ora.rac2.gsd   application    ONLINE    ONLINE    rac2       
ora.rac2.ons   application    ONLINE    ONLINE    rac2       
ora.rac2.vip   ora....t1.type ONLINE    ONLINE    rac2       
ora.scan1.vip  ora....ip.type ONLINE    ONLINE    rac1

检查监听器状态,正常:
[grid@rac1 ~]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 17-MAY-2012 13:27:40

Copyright (c) 1991, 2009, 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, 2009, 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, 2009, 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

原因:
metalink说明: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.
因此只要把数据库实例参数local_listener内的host改为vip的IP地址即可

解决办法:
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;

随后使用windows客户端连接成功:
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, 2010, Oracle.  All rights reserved.

Connected to:
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

时间: 2024-10-15 12:15:04

Oracle11gR2 RAC 使用scan IP无法连接数据库(ORA-12545)问题解决的相关文章

Oracle11gR2 RAC 使用scan IP无法连接(ORA-12545)

Oracle11GR2 RAC使用scan IP无法连接到数据库,报错 ORA-12545: 因目标主机或对象不存在, 连接失败 现象: 在windows客户端sqlplus工具使用scan的IP无法连接,报错如下: C:Windowssystem32> sqlplus song/123456@10.10.23.3:11521/orcl SQL*Plus: Release 11.2.0.1.0 Production on Thu May 17 12:35:28 2012 Copyright (c

11g rac配置scan ip

如果是从10g转战11g rac就会发现很多不同之处,其中一个比较大的改变就是在11g中有了一个新特性scan,其实这是一个简称,完整的名称为:SCAN(Single Client Access Name),但是单纯根据简称理解为scan似乎也能说得通. 在10g中我们一般是这么配置tns的.racdb= (DESCRIPTION =   (ADDRESS= (PROTOCOL= TCP)(HOST=192.168.3.101)(PORT= 1521))   (ADDRESS= (PROTOCO

oracle数据库修改11.2 RAC 的 SCAN IP的例子

在某些情况下,由于是C/S架构,从以前的单机系统迁移到现在11.2的rac中,如果修改客户端ip地址工作量太大,而且也不现实,一般建议直接修改scan ip地址和以前一样,从而实现业务直接访问scan ip实现应用不用一个个单独配置.这里通过简单演示,实现修改scan ip的过程(网段不变),主要是把scan名字为scan-xff的ip地址从192.168.137.245修改为192.168.137.248 查看当前scan ip信息 [root-www.111cn.net@xff1 ~]# p

ORACLE11GR2 RAC DATABASE+STANDLONE DATAGUARD配置摘要

                                                  ORACLE11GR2 RAC DATABASE+STANDLONE STANDBY配置摘要 一.目标 为集群数据库配置DATAGUARD,同时实现SWITCH OVER,同时DATAGUARD端并没有使用ASM,其配置方法预计和单库区别不大,主要在于RMAN恢复RAC数据库到单库,同时DATAGUARD互联准备使用SCAN IP而非VIP. 整个安装过程注意数据文件目录的改变,为了避免不必要的麻

解决oracle客户端可以连接11g rac vip,但是不能连接scan ip问题

local不用动,remote_listern按我说的设置一下,应该就可以了! # Public Network - (eth0) 10.4.56.39    syquadb1 10.4.56.40    syquadb2 # Public Virtual IP (VIP) addresses - (eth1) 10.4.56.41    syquadb1-vip 10.4.56.42    syquadb2-vip # Private Interconnect - (bond0:eth2 et

【RAC】如何修改RAC SCAN IP

   在11gR2中,引入了SCAN(Single Client Access Name)的特性,该特性的好处在于,在数据库与客户端之间,添加了一层虚拟的服务层,就是所谓的scan ip以及scan ip listener,在客户端仅需要配置scan ip的tns信息,通过scan ip listener,连接后台集群数据库.这样,不论集群数据库是否有添加或者删除节点的操作,均不会对client产生影响.当有客户端应用程序使用SCAN ip访问数据库时,scan listener会将连接转发到l

RAC 11GR3双网段设置两套VIP SCAN IP以及LISTENER

------------------------------------------------------------- Bond设置[root@raca network-scripts]# more ifcfg-bond0 DEVICE=bond0BOOTPROTO=staticBROADCAST=172.16.14.111ONBOOT=yesIPADDR=172.16.14.111GATEWAY=172.16.14.254NETMASK=255.255.255.0TYPE=Ethernet

Oracle 11g RAC SCAN ip的原理及配置

SCAN概念:     先介绍一下什么叫SCAN,SCAN(Single Client Access Name)是Oracle从11g R2开始推出的,客户端可以通过SCAN特性负载均衡地连接到RAC数据库.所以在Oracle 11gR2 中,引入了SCAN(Single ClientAccess Name)的特性.SCAN是一个域名,可以解析至少1个IP,最多解析3个SCAN IP,客户端可以通过这个SCAN 名字来访问数据库,另外SCAN ip必须与public ip和VIP在一个子网. S

RAC8——scan ip的理解

SCAN概念 先介绍一下什么叫SCAN,SCAN(Single Client Access Name)是Oracle从11g R2开始推出的,客户端可以通过SCAN特性负载均衡地连接到RAC数据库.SCAN提供一个域名来访问RAC,域名可以解析1个到3个(注意,最多3个)SCAN IP,我们可以通过DNS或者GNS来解析实现.其中DNS大家都很熟悉,这里不多说.GNS(Grid Naming Service)则是Oracle 11g R2的新功能,可以通过DHCP服务为节点和SCAN分配VIP和