热门标签 | HotTags
当前位置:  开发笔记 > 数据库 > 正文

Oracle11gR2RAC使用scanIP无法连接数据库(ORA-12545)问题解决

Oracle11gR2RAC使用scanIP无法连接数据库(ORA-12545)问题解决

Oracle 11gR2 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

linux

推荐阅读
  • Redis 教程01 —— 如何安装 Redis
    本文介绍了 Redis,这是一个由 Salvatore Sanfilippo 开发的键值存储系统。Redis 是一款开源且高性能的数据库,支持多种数据结构存储,并提供了丰富的功能和特性。 ... [详细]
  • ThinkPHP 文件缓存组件详解与应用
    本文深入探讨了ThinkPHP框架中的文件缓存类实现,提供了详细的代码示例和使用说明,旨在帮助开发者更好地理解和利用这一功能来优化应用程序性能。 ... [详细]
  • SonarQube配置与使用指南
    本文档详细介绍了SonarQube的配置方法及使用流程,包括环境准备、样本分析、数据库配置、项目属性文件解析以及插件安装等内容,适用于具有Linux基础操作能力的用户。 ... [详细]
  • 本文档整理了公司内部常用的网站链接和重要资源路径,包括部门周报、内控报销系统、邮件服务等,同时提供了相关数据库的登录信息。 ... [详细]
  • 利用Excel VBA调用Linux命令及Bash脚本
    Excel VBA不仅能够处理日常办公任务,还具备调用外部命令行或Bash脚本的能力。本文将介绍如何使用VBA中的Shell函数来执行命令行指令,并通过实际示例展示如何获取计算机网络配置信息。 ... [详细]
  • Iris 开发环境配置指南 (最新 Go & IntelliJ IDEA & Iris V12)
    本指南详细介绍了如何在最新的 Go 语言环境及 IntelliJ IDEA 中配置 Iris V12 框架,适合初学者和有经验的开发者。文章提供了详细的步骤说明和示例代码,帮助读者快速搭建开发环境。 ... [详细]
  • 深入理解Hibernate延迟加载机制
    本文探讨了Hibernate框架中的延迟加载(懒加载)特性,分析其对程序性能的影响及实现原理,同时提供了具体的代码示例来说明如何配置和使用延迟加载。 ... [详细]
  • 1、服务器配置信息① 主服务器IP:192.168.1.2② 从服务器IP:192.168.1.3③ 操作系统:主服务器:Win8,从服务器࿱ ... [详细]
  • MySQL 5.7 绿色版安装及 my.ini 配置详解
    本文主要针对最近因系统重装导致的MySQL配置问题,详细介绍了MySQL 5.7.24绿色解压版的安装步骤及my.ini配置文件的关键设置,帮助用户顺利完成数据库的安装与配置。 ... [详细]
  • MyBatis入门指南
    本文详细介绍了MyBatis的基础知识,包括如何整合日志框架(如log4j和logback),使用外部JDBC文件,getMapper()方法的应用,以及别名设置等技巧。 ... [详细]
  • 本文介绍了Windows驱动开发的基础知识,包括WDF(Windows Driver Framework)和WDK(Windows Driver Kit)的概念及其重要特性,旨在帮助开发者更好地理解和利用这些工具来简化驱动开发过程。 ... [详细]
  • 本文深入探讨了SSH隧道技术,详细介绍了如何利用SSH协议构建安全的通信通道,实现跨网络的数据传输。通过实例分析,分别阐述了动态SSH隧道、本地SSH隧道和远程SSH隧道的配置方法及应用场景。 ... [详细]
  • 本文旨在分享将Hadoop集群从Windows环境迁移到Linux环境过程中遇到的技术难题及其解决方案,以帮助同行或未来的学习者避免类似问题。 ... [详细]
  • 本文档详细规划了从基础到高级的软件测试学习路径,包括但不限于测试基础、Linux和数据库、功能测试、Python编程、接口测试、性能测试、金融项目实战、UI自动化测试等内容,旨在为初学者和进阶者提供全面的学习指导。 ... [详细]
  • Linux环境下PostgreSQL的安装、配置及日常管理
    本文详细介绍了在Linux环境下安装、配置PostgreSQL数据库的过程,包括环境准备、安装步骤、配置数据库访问以及日常服务管理等方面的内容。适合初学者和有一定经验的数据库管理员参考。 ... [详细]
author-avatar
mobiledu2502874965
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有