博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Oracle 12C ORA-12545 While Connecting to RAC through SCAN Name
阅读量:2438 次
发布时间:2019-05-10

本文共 8903 字,大约阅读时间需要 29 分钟。

操作环境为Oracle Linux 7.1,Oracle 12.2 RAC数据库,SCAN IP是使用GNS方式创建,在使用SCAN IP登录数据库时出现如下错误

SQL> conn sys/abcd@cs as sysdbaERROR:ORA-12545: Connect failed because target host or object does not exist

错误信息直译是目标主机或对象不存在。

查看scan的配置信息状态正常

[grid@cs1 ~]$ srvctl config scanSCAN name: cs-cluster-scan.cs-cluster.jy.net, Network: 1Subnet IPv4: 10.10.10.0/255.255.255.0/ens160, dhcpSubnet IPv6: SCAN 1 IPv4 VIP: -/scan1-vip/10.10.10.143SCAN VIP is enabled.SCAN VIP is individually enabled on nodes: SCAN VIP is individually disabled on nodes: SCAN 2 IPv4 VIP: -/scan2-vip/10.10.10.141SCAN VIP is enabled.SCAN VIP is individually enabled on nodes: SCAN VIP is individually disabled on nodes: SCAN 3 IPv4 VIP: -/scan3-vip/10.10.10.142SCAN VIP is enabled.SCAN VIP is individually enabled on nodes: SCAN VIP is individually disabled on nodes:

查看scan的监听信息状态正常

[grid@cs1 ~]$ srvctl config scan_listenerSCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521Registration invited nodes: Registration invited subnets: SCAN Listener is enabled.SCAN Listener is individually enabled on nodes: SCAN Listener is individually disabled on nodes: SCAN Listener LISTENER_SCAN2 exists. Port: TCP:1521Registration invited nodes: Registration invited subnets: SCAN Listener is enabled.SCAN Listener is individually enabled on nodes: SCAN Listener is individually disabled on nodes: SCAN Listener LISTENER_SCAN3 exists. Port: TCP:1521Registration invited nodes: Registration invited subnets: SCAN Listener is enabled.SCAN Listener is individually enabled on nodes: SCAN Listener is individually disabled on nodes: [grid@cs2 ~]$ lsnrctl status LISTENER_SCAN1LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 13-MAR-2018 11:05:13Copyright (c) 1991, 2016, Oracle.  All rights reserved.Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))STATUS of the LISTENER------------------------Alias                     LISTENER_SCAN1Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - ProductionStart Date                12-MAR-2018 19:10:06Uptime                    0 days 15 hr. 55 min. 7 secTrace Level               offSecurity                  ON: Local OS AuthenticationSNMP                      OFFListener Parameter File   /u01/app/product/12.2.0/crs/network/admin/listener.oraListener Log File         /u01/app/grid/diag/tnslsnr/cs2/listener_scan1/alert/log.xmlListening Endpoints Summary...  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN1)))  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.10.10.143)(PORT=1521)))Services Summary...Service "-MGMTDBXDB" has 1 instance(s).  Instance "-MGMTDB", status READY, has 1 handler(s) for this service...Service "66fa07fcd41a56f0e053be828a0abc70" has 1 instance(s).  Instance "-MGMTDB", status READY, has 1 handler(s) for this service...Service "_mgmtdb" has 1 instance(s).  Instance "-MGMTDB", status READY, has 1 handler(s) for this service...Service "cs" has 2 instance(s).  Instance "cs1", status READY, has 1 handler(s) for this service...  Instance "cs2", status READY, has 1 handler(s) for this service...Service "csXDB" has 2 instance(s).  Instance "cs1", status READY, has 1 handler(s) for this service...  Instance "cs2", status READY, has 1 handler(s) for this service...Service "gimr_dscrep_10" has 1 instance(s).  Instance "-MGMTDB", status READY, has 1 handler(s) for this service...The command completed successfully[grid@cs1 ~]$ lsnrctl status LISTENER_SCAN2LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 13-MAR-2018 11:05:29Copyright (c) 1991, 2016, Oracle.  All rights reserved.Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN2)))STATUS of the LISTENER------------------------Alias                     LISTENER_SCAN2Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - ProductionStart Date                12-MAR-2018 19:08:54Uptime                    0 days 15 hr. 56 min. 35 secTrace Level               offSecurity                  ON: Local OS AuthenticationSNMP                      OFFListener Parameter File   /u01/app/product/12.2.0/crs/network/admin/listener.oraListener Log File         /u01/app/grid/diag/tnslsnr/cs1/listener_scan2/alert/log.xmlListening Endpoints Summary...  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN2)))  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.10.10.141)(PORT=1521)))Services Summary...Service "-MGMTDBXDB" has 1 instance(s).  Instance "-MGMTDB", status READY, has 1 handler(s) for this service...Service "66fa07fcd41a56f0e053be828a0abc70" has 1 instance(s).  Instance "-MGMTDB", status READY, has 1 handler(s) for this service...Service "_mgmtdb" has 1 instance(s).  Instance "-MGMTDB", status READY, has 1 handler(s) for this service...Service "cs" has 2 instance(s).  Instance "cs1", status READY, has 1 handler(s) for this service...  Instance "cs2", status READY, has 1 handler(s) for this service...Service "csXDB" has 2 instance(s).  Instance "cs1", status READY, has 1 handler(s) for this service...  Instance "cs2", status READY, has 1 handler(s) for this service...Service "gimr_dscrep_10" has 1 instance(s).  Instance "-MGMTDB", status READY, has 1 handler(s) for this service...The command completed successfully[grid@cs1 ~]$ lsnrctl status LISTENER_SCAN3LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 13-MAR-2018 11:05:32Copyright (c) 1991, 2016, Oracle.  All rights reserved.Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN3)))STATUS of the LISTENER------------------------Alias                     LISTENER_SCAN3Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - ProductionStart Date                12-MAR-2018 19:08:52Uptime                    0 days 15 hr. 56 min. 40 secTrace Level               offSecurity                  ON: Local OS AuthenticationSNMP                      OFFListener Parameter File   /u01/app/product/12.2.0/crs/network/admin/listener.oraListener Log File         /u01/app/grid/diag/tnslsnr/cs1/listener_scan3/alert/log.xmlListening Endpoints Summary...  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN3)))  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.10.10.142)(PORT=1521)))Services Summary...Service "-MGMTDBXDB" has 1 instance(s).  Instance "-MGMTDB", status READY, has 1 handler(s) for this service...Service "66fa07fcd41a56f0e053be828a0abc70" has 1 instance(s).  Instance "-MGMTDB", status READY, has 1 handler(s) for this service...Service "_mgmtdb" has 1 instance(s).  Instance "-MGMTDB", status READY, has 1 handler(s) for this service...Service "cs" has 2 instance(s).  Instance "cs1", status READY, has 1 handler(s) for this service...  Instance "cs2", status READY, has 1 handler(s) for this service...Service "csXDB" has 2 instance(s).  Instance "cs1", status READY, has 1 handler(s) for this service...  Instance "cs2", status READY, has 1 handler(s) for this service...Service "gimr_dscrep_10" has 1 instance(s).  Instance "-MGMTDB", status READY, has 1 handler(s) for this service...The command completed successfully

在通过SCAN Name来连接RAC数据库时,客户端可以解析所有有完整域名的SCAN Name与VIP Name,但是不能解析没有域名的SCAN Name与VIP Name。通过以下操作可以解决这个问题。

1.在数据库级别使用有完整域名的VIP Name或VIP来设置pfile或spfile文件中的local_listener参数

alter system set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.10.10.140)(PORT=1521))))' scope=both sid='cs1';oralter system set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=cs1-vip.jy.net)(PORT=1521))))' scope=both sid='cs1';andalter system register;

在RAC的每个节点都执行类似上面的操作,但我的环境中local_listener的设置是正确的

SQL> show parameter local_listenerNAME                                 TYPE        VALUE------------------------------------ ----------- ------------------------------local_listener                       string      (DESCRIPTION=(ADDRESS_LIST=(AD                                                 DRESS=(PROTOCOL=TCP)(HOST=10.1                                                 0.10.140)(PORT=1521))))

2.在客户端的hosts文件中增加tnsnames.ora文件中带完整域名的SCAN Name

[root@cs1 ~]# vi /etc/hosts....10.10.10.141 cs-cluster-scan.cs-cluster.jy.net10.10.10.142 cs-cluster-scan.cs-cluster.jy.net10.10.10.143 cs-cluster-scan.cs-cluster.jy.net

3.再次登录

[oracle@cs11 ~]$ tnsping csTNS Ping Utility for Linux: Version 12.2.0.1.0 - Production on 13-MAR-2018 10:40:15Copyright (c) 1997, 2016, Oracle.  All rights reserved.Used parameter files:Used TNSNAMES adapter to resolve the aliasAttempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = cs-cluster-scan.cs-cluster.jy.net)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = cs)))OK (0 msec)[oracle@cs1 admin]$ sqlplus /nologSQL*Plus: Release 12.2.0.1.0 Production on Tue Mar 13 13:12:32 2018Copyright (c) 1982, 2016, Oracle.  All rights reserved.SQL> conn sys/abcd@cs as sysdbaConnected.

到此问题解决了,可以使用SCAN Name来登录数据库了。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26015009/viewspace-2151777/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/26015009/viewspace-2151777/

你可能感兴趣的文章
XML CDATA
查看>>
转义字符
查看>>
TIOBE开发语言排行榜
查看>>
分区和卷
查看>>
换行符
查看>>
O2O
查看>>
想起一句话:”多加一层,就可以把问题解决了“
查看>>
PostgreSQL Page页结构解析(7)- B-Tree索引存储结构#3
查看>>
企业文化和价值观
查看>>
推荐书籍:金字塔原理
查看>>
基础存储知识
查看>>
PostgreSQL 源码解读(37)- 查询语句#22(查询优化-grouping_plan...
查看>>
PostgreSQL 源码解读(44)- 查询语句#29(等价类相关数据结构)
查看>>
PostgreSQL 源码解读(48)- 查询语句#33(query_planner函数#9)
查看>>
PostgreSQL 源码解读(45)- 查询语句#30(query_planner函数#6)
查看>>
PostgreSQL 源码解读(47)- 查询语句#32(query_planner函数#8)
查看>>
PostgreSQL 源码解读(17)- 查询语句#2(查询优化基础)
查看>>
Windows Vista内置趣味实用工具大搜罗(转)
查看>>
FreeBSD安装文件系统(转)
查看>>
最简单FreeBSD网关方案(转)
查看>>