Oracle 12C ORA-12545 While Connecting to RAC through SCAN Name
操作環境為Oracle Linux 7.1,Oracle 12.2 RAC資料庫,SCAN IP是使用GNS方式建立,在使用SCAN IP登入資料庫時出現如下錯誤
SQL> conn sys/abcd@cs as sysdba ERROR: ORA-12545: Connect failed because target host or object does not exist
錯誤資訊直譯是目標主機或物件不存在。
檢視scan的配置資訊狀態正常
[grid@cs1 ~]$ srvctl config scan SCAN name: cs-cluster-scan.cs-cluster.jy.net, Network: 1 Subnet IPv4: 10.10.10.0/255.255.255.0/ens160, dhcp Subnet IPv6: SCAN 1 IPv4 VIP: -/scan1-vip/10.10.10.143 SCAN 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.141 SCAN 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.142 SCAN VIP is enabled. SCAN VIP is individually enabled on nodes: SCAN VIP is individually disabled on nodes:
檢視scan的監聽資訊狀態正常
[grid@cs1 ~]$ srvctl config scan_listener SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521 Registration 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:1521 Registration 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:1521 Registration 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_SCAN1 LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 13-MAR-2018 11:05:13 Copyright (c) 1991, 2016, 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 12.2.0.1.0 - Production Start Date 12-MAR-2018 19:10:06 Uptime 0 days 15 hr. 55 min. 7 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /u01/app/product/12.2.0/crs/network/admin/listener.ora Listener Log File /u01/app/grid/diag/tnslsnr/cs2/listener_scan1/alert/log.xml Listening 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_SCAN2 LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 13-MAR-2018 11:05:29 Copyright (c) 1991, 2016, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN2))) STATUS of the LISTENER ------------------------ Alias LISTENER_SCAN2 Version TNSLSNR for Linux: Version 12.2.0.1.0 - Production Start Date 12-MAR-2018 19:08:54 Uptime 0 days 15 hr. 56 min. 35 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /u01/app/product/12.2.0/crs/network/admin/listener.ora Listener Log File /u01/app/grid/diag/tnslsnr/cs1/listener_scan2/alert/log.xml Listening 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_SCAN3 LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 13-MAR-2018 11:05:32 Copyright (c) 1991, 2016, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN3))) STATUS of the LISTENER ------------------------ Alias LISTENER_SCAN3 Version TNSLSNR for Linux: Version 12.2.0.1.0 - Production Start Date 12-MAR-2018 19:08:52 Uptime 0 days 15 hr. 56 min. 40 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /u01/app/product/12.2.0/crs/network/admin/listener.ora Listener Log File /u01/app/grid/diag/tnslsnr/cs1/listener_scan3/alert/log.xml Listening 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'; or alter system set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=cs1-vip.jy.net)(PORT=1521))))' scope=both sid='cs1'; and alter system register;
在RAC的每個節點都執行類似上面的操作,但我的環境中local_listener的設定是正確的
SQL> show parameter local_listener NAME 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.net 10.10.10.142 cs-cluster-scan.cs-cluster.jy.net 10.10.10.143 cs-cluster-scan.cs-cluster.jy.net
3.再次登入
[oracle@cs11 ~]$ tnsping cs TNS Ping Utility for Linux: Version 12.2.0.1.0 - Production on 13-MAR-2018 10:40:15 Copyright (c) 1997, 2016, Oracle. All rights reserved. Used parameter files: Used TNSNAMES adapter to resolve the alias Attempting 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 /nolog SQL*Plus: Release 12.2.0.1.0 Production on Tue Mar 13 13:12:32 2018 Copyright (c) 1982, 2016, Oracle. All rights reserved. SQL> conn sys/abcd@cs as sysdba Connected.
到此問題解決了,可以使用SCAN Name來登入資料庫了。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26015009/viewspace-2151777/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle RAC修改public, VIP, SCAN IPOracle
- oracle rac scan監聽更改埠號Oracle
- Oracle RAC修改Scan IP,Public IP的方法Oracle
- Oracle 12c rac ocr和votedisk管理Oracle
- oracle rac的scan監聽狀態Not All Endpoints RegisteredOracle
- Oracle 11g RAC SCAN ip的原理及配置Oracle
- Oracle 12c 使用RMAN搭建物理備庫(RAC to RAC)Oracle
- RAC 增加SCAN IP
- ORACLE RAC中連線ScanIP報錯ORA-12545的問題解決Oracle
- oracle 12c rac 詳細部署教程(一)Oracle
- Oracle 12C RAC CDB資料庫部署Oracle資料庫
- oracle 12c rac 詳細部署教程(二)Oracle
- ORACLE 12C RAC 部署應用包準備Oracle
- ORACLE 12C RAC資料庫的啟停Oracle資料庫
- ORACLE 12C RAC 生產環境搭建介紹Oracle
- Oracle 12c RAC構築之二:共享磁碟配置Oracle
- Error creating bean with name ‘dataSource‘: Unsatisfied dependency expressed through fieldErrorBeanExpress
- Oracle 12c RAC CSSD程式無法啟動real time模式OracleCSS模式
- Oracle 12C RAC的單機Standby returning error ORA-16191OracleError
- oracle 12C RAC 12.1.0.2 叢集日誌(cluster log)目錄Oracle
- Oracle 12c 使用FILE_NAME_CONVERT建立pdb報錯 ORA-01276Oracle
- Oracle Database 12c RAC損壞ocr和votedisk恢復實驗OracleDatabase
- 關於“INS-40922 Invalid Scan Name – Unresolvable to IP address”
- oracle RACOracle
- 【RAC】Oracle 12c以及以上版本的diagsnap是什麼? (Doc ID 2469643.1)Oracle
- Oracle RAC Cache Fusion 系列十七:Oracle RAC DRMOracle
- [重慶思莊每日技術分享]-ORACLE RAC中連線ScanIP報錯ORA-12545的問題解決Oracle
- Oracle 11.2 DataGuard RAC To RAC搭建Oracle
- 私有IP丟失造成Oracle 12C RAC叢集節點不能啟動Oracle
- oracle 12c RAC安裝,例項不能多節點同時啟動Oracle
- 12C RAC 修改監聽埠
- Oracle RAC CacheFusion 系列十五:Oracle RAC CRServer Part TwoOracleServer
- Oracle 11gr2修改RAC叢集的scan ip,並處理ORA-12514問題Oracle
- ORACLE RAC clusterwareOracle
- Oracle RAC Cache Fusion系列十八:Oracle RAC Statisticsand Wait EventsOracleAI
- Oracle RAC Cache Fusion 系列十四:Oracle RAC CR Server Part OneOracleServer
- Oracle RAC Cache Fusion 系列十:Oracle RAC Enqueues And Lock Part 1OracleENQ
- [20181103]12c檢視V$EVENT_NAME.txt