客戶端使用SCNAIP連線11G RAC資料庫報錯ORA-12545解決
客戶端配置及報錯:
[oracle@bys3 admin]$ cat tnsnames.orabysrac =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.228)(PORT = 1521)) --其中HOST = 192.168.1.228 這裡的IP為RAC的SCANIP。
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = bysrac)
)
)
[oracle@bys3 admin]$ tnsping bysrac
TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 01-JAN-2014 20:25:19
Copyright (c) 1997, 2013, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.228)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = bysrac)))
OK (10 msec) --tnsping可以正常聯通。
客戶端的使用sqlplus bys/bys@bysrac登陸時報錯:ORA-12545: Connect failed because target host or object does not exist
[oracle@bys3 admin]$ sqlplus bys/bys@bysracSQL*Plus: Release 11.2.0.4.0 Production on Wed Jan 1 20:10:31 2014
Copyright (c) 1982, 2013, Oracle. All rights reserved.
ERROR:
ORA-12545: Connect failed because target host or object does not exist
################
解決方法1:修改RAC的local_listener引數,將引數值中HOST=的值改為當前節點的VIP或者scanip
解決方法2:另一解決方法是在客戶端的hosts文字中配置VIP/SCAN IP的解析條目
HOST主機引數為scanip地址,則修改完引數後,scanip能夠正常使用,但如果有客戶端配置使用vip的話,連線時則會出現錯誤:ORA-12514: TNS:listener does not currently know of service requested in connect descriptor。
具體修改步驟:
檢視RAC的SCANIP狀態及監聽狀態
[oracle@bysrac1 ~]$ su - gridPassword:
[grid@bysrac1 ~]$ srvctl config scan
SCAN name: bysrac-cluster-scan, Network: 1/192.168.1.128/255.255.255.128/eth0
SCAN VIP name: scan1, IP: /bysrac-cluster/192.168.1.228
[grid@bysrac1 ~]$ srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node bysrac1
[grid@bysrac1 ~]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 01-JAN-2014 20:10:13
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 28-DEC-2013 20:06:56
Uptime 4 days 0 hr. 3 min. 17 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /g01/app/11.2.0/grid/network/admin/listener.ora
Listener Log File /g01/app/grid/diag/tnslsnr/bysrac1/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.226)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.221)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "bysrac" has 1 instance(s).
Instance "bysrac1", status READY, has 1 handler(s) for this service...
Service "caiwu" has 1 instance(s).
Instance "bysrac1", status READY, has 1 handler(s) for this service...
Service "jiaoyi" has 1 instance(s).
Instance "bysrac1", status READY, has 1 handler(s) for this service...
The command completed successfully
[grid@bysrac1 ~]$ exit
[oracle@bysrac1 ~]$ 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
192.168.1.221 bysrac1 bysrac1.bys.com
192.168.1.226 bysrac1-vip
192.168.1.222 bysrac2 bysrac2.bys.com
192.168.1.227 bysrac2-vip
192.168.10.1 bysrac1-priv
192.168.10.2 bysrac2-priv
192.168.1.228 bysrac-cluster bysrac-cluster-scan
實驗1:修改RAC的local_listener引數,將引數值中HOST=的值改為當前節點的VIP值--RAC多節點都需要改
[oracle@bysrac1 ~]$ sqlplus bys/bysBYS@ bysrac>select instance_name from v$instance;
INSTANCE_NAME
----------------
bysrac1
BYS@ bysrac1>show parameter local_l -------檢視local_listener 引數的值
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string (DESCRIPTION=(ADDRESS_LIST=(AD
DRESS=(PROTOCOL=TCP)(HOST=bysr
ac1-vip)(PORT=1521))))
BYS@ bysrac1>alter system set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.226)(PORT=1521))))' sid='bysrac1';
System altered. --這裡HOST=192.168.1.226,修改為該節點VIP的IP值。我這裡只修改了一個節點的,如果多個節點,照此方法在其它節點修改。
BYS@ bysrac1>show parameter local_l
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string (DESCRIPTION=(ADDRESS_LIST=(AD
DRESS=(PROTOCOL=TCP)(HOST=192.
168.1.226)(PORT=1521))))
BYS@ bysrac1>exit ---退出前可以手工註冊下監聽alter system register; 我這裡沒做也是可以的。
客戶端tnsnames.ora 中使用SCANIP或者VIP任一都可以登陸到RAC資料庫
1.使用配置 SCNAIP的方法可以登陸:
[oracle@bys3 admin]$ tnsping bysracTNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 01-JAN-2014 20:25:19
Copyright (c) 1997, 2013, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.228)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = bysrac)))
OK (10 msec) --tnsping可以正常聯通,HOST = 192.168.1.228這裡tnsnames.ora裡已經修改為RAC的一個節點的SCANIP了。。節約篇幅,沒貼tnsnames.ora
[oracle@bys3 admin]$ sqlplus bys/bys@bysrac
SQL*Plus: Release 11.2.0.4.0 Production on Wed Jan 1 20:34:53 2014
Copyright (c) 1982, 2013, 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
BYS@ bysrac>select instance_name from v$instance;
INSTANCE_NAME
----------------
bysrac1
BYS@ bysrac>exit
2.客戶端使用VIP也可以連線到RAC資料庫
[oracle@bys3 admin]$ tnsping bysracTNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 01-JAN-2014 20:52:54
Copyright (c) 1997, 2013, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.226)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = bysrac)))
OK (10 msec) -----tnsping可以正常聯通,HOST = 192.168.1.226這裡tnsnames.ora裡已經修改為RAC的一個節點的VIP了。。節約篇幅,沒貼tnsnames.ora
[oracle@bys3 admin]$ sqlplus bys/bys@bysrac
SQL*Plus: Release 11.2.0.4.0 Production on Wed Jan 1 20:52:57 2014
Copyright (c) 1982, 2013, 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
BYS@ bysrac>select instance_name,status from v$instance;
INSTANCE_NAME STATUS
---------------- ------------
bysrac1 OPEN
BYS@ bysrac>exit
################
實驗2:修改RAC的local_listener引數,將引數值中HOST=的值改為scanip
[oracle@bysrac1 ~]$ sqlplus bys/bys
BYS@ bysrac1>show parameter local_listener
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string (DESCRIPTION=(ADDRESS_LIST=(AD
DRESS=(PROTOCOL=TCP)(HOST=192.
168.1.226)(PORT=1521))))
BYS@ bysrac1>alter system set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.228)(PORT=1521))))';
System altered.
BYS@ bysrac1>show parameter local_listener
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string (DESCRIPTION=(ADDRESS_LIST=(AD
DRESS=(PROTOCOL=TCP)(HOST=192.
客戶端使用VIP時報錯ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
[oracle@bys3 admin]$ tnsping bysrac
TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 01-JAN-2014 21:12:40
Copyright (c) 1997, 2013, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.226)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = bysrac)))
OK (10 msec) -----tnsping可以正常聯通,HOST = 192.168.1.226,這裡tnsnames.ora裡已經修改為RAC的一個節點的VIP了。。節約篇幅,沒貼tnsnames.ora
[oracle@bys3 admin]$ sqlplus bys/bys@bysrac
SQL*Plus: Release 11.2.0.4.0 Production on Wed Jan 1 21:12:44 2014
Copyright (c) 1982, 2013, Oracle. All rights reserved.
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
客戶端使用SCANIP可以正常連線
[oracle@bys3 admin]$ tnsping bysrac
TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 01-JAN-2014 21:13:01
Copyright (c) 1997, 2013, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.228)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = bysrac)))
OK (10 msec) --tnsping可以正常聯通,HOST = 192.168.1.228這裡tnsnames.ora裡已經修改為RAC的一個節點的SCANIP了。。節約篇幅,沒貼tnsnames.ora
[oracle@bys3 admin]$ sqlplus bys/bys@bysrac
BYS@ bysrac>select instance_name,status from v$instance;
INSTANCE_NAME STATUS
---------------- ------------
bysrac1 OPEN
Elapsed: 00:00:00.01
BYS@ bysrac>
相關文章
- 客戶端連線RAC報ora-12545客戶端
- 解決:客戶端連線11gR2 RAC報ORA-12545錯誤客戶端
- 連線rac資料庫報ORA-12545資料庫
- 解決Oracle 11g R2 RAC 無法在客戶端通過scanIP連線資料庫Oracle客戶端資料庫
- 如何配置oracle客戶端連線10g rac 資料庫Oracle客戶端資料庫
- 客戶端連線資料庫的方法客戶端資料庫
- oracle 客戶端連線11gR2 SCAN 報ORA-12545錯誤Oracle客戶端
- 解決Oracle 11gR2 RAC 無法在客戶端通過scanIP連線資料庫Oracle客戶端資料庫
- 客戶端通過SCAN連線11g Oracle RAC報錯ORA-12537客戶端Oracle
- 配置ORACLE 客戶端連線到資料庫Oracle客戶端資料庫
- ORACLE RAC中連線ScanIP報錯ORA-12545的問題解決Oracle
- ORACLE DG為RAC時使用scan-ip連線資料庫會報 ORA-12545錯誤Oracle資料庫
- PL/SQL developer 遠端連線資料庫 客戶端配置SQLDeveloper資料庫客戶端
- 解決navicat遠端連線資料庫報2059錯誤的方法資料庫
- 客戶端連不上資料庫,如何來排錯客戶端資料庫
- 客戶端連不上資料庫客戶端資料庫
- 客戶端無法連線資料庫的小問題客戶端資料庫
- 顯示連線Oracle資料庫的客戶端IP地址Oracle資料庫客戶端
- Oracle11gR2 RAC 使用scan IP無法連線資料庫(ORA-12545)問題解決Oracle資料庫
- 客戶端通過SCAN TNS無法連線ORA-12545客戶端
- 關於11G 客戶端連線資料庫 SCAN 和 Transparent Application Failover(TAF)客戶端資料庫APPAI
- 解決oracle 客戶端混亂造成OBIEE Client Administration不能連線資料庫問題Oracle客戶端client資料庫
- RAC禁止某個客戶端登入資料庫客戶端資料庫
- 低版本客戶端連線高版本資料庫報錯ORA-28040、ORA-01017客戶端資料庫
- impala客戶端連線客戶端
- Redis客戶端連線Redis客戶端
- oracle 10g rac 客戶端連線偶爾報ORA-12535錯誤Oracle 10g客戶端
- Oracle 資料庫連線錯誤解決方法Oracle資料庫
- Oracle 11g連線遠端資料庫Oracle資料庫
- 客戶端連線EBS 11i VIS報ORA-12537: TNS: 連線已關閉 錯誤的解決客戶端
- PLSQL Developer 客戶端沒有TNS監聽,無法連線資料庫SQLDeveloper客戶端資料庫
- 客戶端連線資料時會報“ORA-12537:TNS連線已關閉”客戶端
- 解決ssms2012連線遠端資料庫報錯崩潰的問題SSM資料庫
- 11G RAC 一節點當機後修改監聽相關配置使通過當機節點VIP連線資料庫的客戶端可以連線資料庫客戶端
- RAC資料庫連線配置,tnsnames和client端配置資料庫client
- 【Oracle】11g RAC ORA-12545 解決方案Oracle
- 使用 WebSocket 客戶端連線 MQTT 伺服器Web客戶端MQQT伺服器
- 資料庫連線錯誤的原因及解決方法資料庫