Oracle11g RAC无法使用VIP或SCAN IP连接数据库的解决方案

在windows客户端sqlplus工具使用VIP或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

检查各组件状态,正常,TNSPING也是通的

原因:

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

另外解决Oracle 11gR2 RAC 无法在客户端通过scanIP连接数据库

安装完Oracle 11g rac后,在10g的客户端的 tnsnames.ora中配置好,scanip,但是无法访问,报错为目标主机不存在,折腾了很久,没弄明白,后面查到,系统初始化参数里有local_listener这一项,在这里可以对host的值加以修改,将scanip注册进来、在监听器中使用vip!


在racnode1服务器上:

[root@racdb1 ~]# su - oracle

[oracle@racdb1 ~]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.1.0 Production on Wed Apr 21 13:44:12 2010

Copyright (c) 1982, 2009, Oracle. All rights reserved.

SQL> conn /as sysdba

Connected.

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=racscan)(PORT=1521))))' scope=both sid='racdb1';

System altered.

SQL>


节点二上面也是,一样的修改。

相关推荐
周全全4 分钟前
MySQL报错解决:The user specified as a definer (‘root‘@‘%‘) does not exist
android·数据库·mysql
白云如幻8 分钟前
MySQL的分组函数
数据库·mysql
荒川之神23 分钟前
ORACLE 闪回技术简介
数据库·oracle
时差9532 小时前
【面试题】Hive 查询:如何查找用户连续三天登录的记录
大数据·数据库·hive·sql·面试·database
让学习成为一种生活方式2 小时前
R包下载太慢安装中止的解决策略-R语言003
java·数据库·r语言
Mephisto.java2 小时前
【大数据学习 | kafka高级部分】kafka的优化参数整理
大数据·sql·oracle·kafka·json·database
秋意钟2 小时前
MySQL日期类型选择建议
数据库·mysql
山海青风2 小时前
第七篇: BigQuery中的复杂SQL查询
sql·googlecloud
Dxy12393102163 小时前
python下载pdf
数据库·python·pdf
桀桀桀桀桀桀4 小时前
数据库中的用户管理和权限管理
数据库·mysql