11gR2不能在client段通過scanip連線的解決辦法

warehouse發表於2012-09-23

通過vip連線沒有問題,通過scanip配置tns以後tnsping可以,但是連線時報錯

[@more@]

通過vip連線沒有問題,通過scanip配置tns以後tnsping可以,但是連線時報錯

tns配置如下:

SCANIP =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac-scan)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = racdb)
)
)

C:>tnsping scanip

TNS Ping Utility for 64-bit Windows: Version 11.2.0.1.0 - Production on 23-9月 -
2012 19:13:31

Copyright (c) 1997, 2010, Oracle. All rights reserved.

已使用的引數檔案:
f:oracleproduct11.2.0client_1networkadminsqlnet.ora


已使用 TNSNAMES 介面卡來解析別名
嘗試連線 (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = rac-s
can)(PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = racdb))
)
OK (160 毫秒)

C:>sqlplus sys/system@scanip as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on 星期日 9月 23 19:16:03 2012

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

ERROR:
ORA-12545: 因目標主機或物件不存在, 連線失敗


請輸入使用者名稱:
ERROR:
ORA-12560: TNS: 協議介面卡錯誤


請輸入使用者名稱:
ERROR:
ORA-12560: TNS: 協議介面卡錯誤


SP2-0157: 在 3 次嘗試之後無法連線到 ORACLE, 退出 SQL*Plus

解決步驟:

1、在client段的hosts檔案中增加scanip和主機的對應關係如下:

192.168.0.20 rac-scan

2、修改2個node的local_listener引數,把vip對應的主機名改成vip地址。

--======================================

SQL> show parameter listener

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
listener_networks string
local_listener string (DESCRIPTION=(ADDRESS_LIST=(AD
DRESS=(PROTOCOL=TCP)(HOST=rac2
-vip)(PORT=1521))))
remote_listener string rac-scan:1521
SQL> alter system set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.16)(PORT=1521))))' scope=both sid='racdb2';

System altered.

SQL> show parameter listener

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
listener_networks string
local_listener string (DESCRIPTION=(ADDRESS_LIST=(AD
DRESS=(PROTOCOL=TCP)(HOST=192.
168.0.16)(PORT=1521))))
remote_listener string rac-scan:1521
SQL>

--=======================================

C:>
C:>sqlplus sys/system@scanip as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on 星期日 9月 23 19:16:16 2012

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


連線到:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management a
nd Real Application Testing options

SQL>

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/19602/viewspace-1059487/,如需轉載,請註明出處,否則將追究法律責任。

相關文章