ORA-12170錯誤的解決辦法

pingley發表於2012-02-25
ORA-12170錯誤的解決辦法
在客戶端上面的查詢是出現的錯誤如下
SQL> select * from account_manager@testlink;
select * from account_manager@testlink
                              *
第 1 行出現錯誤:
ORA-12170: TNS: 連線超時
[oracle@zeng ~]$  oerr ora 12170
12170, 00000, "TNS:Connect timeout occurred"
// *Cause:  The server shut down because connection establishment or
// communication with a client failed to complete within the allotted time
// interval. This may be a result of network or system delays; or this may
// indicate that a malicious client is trying to cause a Denial of Service
// attack on the server.
// *Action: If the error occurred because of a slow network or system,
// reconfigure one or all of the parameters SQLNET.INBOUND_CONNECT_TIMEOUT,
// SQLNET.SEND_TIMEOUT, SQLNET.RECV_TIMEOUT in sqlnet.ora to larger values.
// If a malicious client is suspected, use the address in sqlnet.log to
// identify the source and restrict access. Note that logged addresses may
// not be reliable as they can be forged (e.g. in TCP/IP).
可以看出導致的原因有伺服器已經關閉了,網路時延,或者是伺服器探測到客服端在進行拒絕服務攻擊等,此處是因為伺服器端的防火牆沒有把客戶端需要連線的端(1521)開啟.
先透過關閉遠端伺服器中的防火牆(當然這不是一個好方法,正確的方法應該是適當的配置防火牆。)我這裡簡單的關閉防火牆或者執行iptables -F。再在客戶端上面使用dblink。
[root@zeng ~]# service iptables stop
iptables: Flushing firewall rules: [  OK  ]
iptables: Setting chains to policy ACCEPT: filter [  OK  ]
iptables: Unloading modules: [  OK  ]

SQL> select * from account_manager@testlink;
ID         NAME                                               EMPLOYMENT_DAT
---------- -------------------------------------------------- --------------
    SALARY COMMISSION RE
---------- ---------- --
10000      smith                                              05-2月 -12
     10000       3000 N

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

相關文章