DNS導致資料庫登入緩慢的問題解決

westzq1984發表於2012-12-17
Normal 0 7.8 磅 0 2 false false false EN-US ZH-CN X-NONE今天遠端支援了下同事處理一個故障

某運營商的一個IT管理系統,AIX平臺,資料庫登入緩慢,包括sqlplus本機sysdba登入也及其緩慢,大概要1分鐘以上才能登入

 

進行了如下測試

1.    由於沒走監聽,那肯定和監聽也沒有關係了

2.    sqlplus登入,看到程式立刻就產生了伺服器程式,但是在資料庫裡面查詢v$process,沒有該程式

3.    等待一段時間後,可以從v$process中觀察到該程式,但是仍然沒有登入進去。這時檢視v$session,沒有異常等待

 

感覺可能和主機配置相關,那麼truss了下sqlplus登入過程,並且和一臺正常的機器的sqlplus登入的truss跟蹤檔案比對,發現主要慢在如下地方,程式多次請求socket,然後sleep

[11:10:35]176296: socket(2, 2, 0)                                 = 8

[11:10:35]176296: getsockopt(8, 65535, 4104, 0x0FFFFFFFFFFF70D4, 0x0FFFFFFFFFFF70D0) = 0

[11:10:35]176296: connext(8, 0x09001000A0022A68, 16)              = 0

[11:10:35]176296: _esend(8, 0x0FFFFFFFFFFF7FE0, 23, 0, 0x0000000000000000) = 23

[11:10:35]176296: _poll(0x0FFFFFFFFFFF71A0, 1, 5000)              = 1

[11:10:35]176296: _enrecvfrom(8, 0x0FFFFFFFFFFF9310, 1024, 0, 0x0FFFFFFFFFFF7960, 0x0FFFFFFFFFFF7188, 0x0000000000000000) = 23

[11:10:35]176296: close(8)                                        = 0

[11:10:35]176296: socket(2, 2, 0)                                 = 8

[11:10:35]176296: _esendto(8, 0x0FFFFFFFFFFF7FE0, 23, 0, 0x09001000A0022A78, 16, 0x0000000000000000) = 23

[11:10:36]90574:  kread(8, "\0 E\0\006\0\0\0\0\002 g".., 2064) (sleeping...)

[11:10:36]176296: _poll(0x0FFFFFFFFFFF71A0, 1, 5000) (sleeping...)

[11:10:39]176296: _poll(0x0FFFFFFFFFFF71A0, 1, 5000)              = 0

[11:10:39]176296: close(8)                                        = 0

[11:10:39]176296: socket(2, 2, 0)                                 = 8

[11:10:39]176296: _esendto(8, 0x0FFFFFFFFFFF7FE0, 23, 0, 0x09001000A0022A78, 16, 0x0000000000000000) = 23

[11:10:42]176296: _poll(0x0FFFFFFFFFFF71A0, 1, 5000) (sleeping...)

[11:10:44]176296: _poll(0x0FFFFFFFFFFF71A0, 1, 5000)              = 0

[11:10:44]176296: close(8)                                        = 0

[11:10:44]176296: socket(2, 2, 0)                                 = 8

[11:10:44]176296: _esendto(8, 0x0FFFFFFFFFFF7FE0, 23, 0, 0x09001000A0022A78, 16, 0x0000000000000000) = 23

[11:10:46]176296: _poll(0x0FFFFFFFFFFF71A0, 1, 10000) (sleeping...)

[11:10:54]176296: _poll(0x0FFFFFFFFFFF71A0, 1, 10000)             = 0

[11:10:54]176296: close(8)                                        = 0

[11:10:54]176296: socket(2, 2, 0)                                 = 8

[11:10:54]176296: _esendto(8, 0x0FFFFFFFFFFF7FE0, 23, 0, 0x09001000A0022A78, 16, 0x0000000000000000) = 23

[11:10:57]176296: _poll(0x0FFFFFFFFFFF71A0, 1, 20000) (sleeping...)

[11:11:15]176296: _poll(0x0FFFFFFFFFFF71A0, 1, 20000)             = 0

[11:11:15]176296: close(8)                                        = 0

 

馬上感覺是網路配置問題,嘗試ping主機名,要等待很久後才開始ping,但是ping IP地址就很快

 

難道是DNS解析有問題?但是ping無法truss。立刻重新閱讀sqlplustruss檔案

發現故障機器多讀了個/etc/resolv.conf,也就是設定DNS伺服器的檔案。而其他機器都沒得該檔案

立馬想到了LINUX下,ftp的反向解析的問題。

 

讓現場工程師和客戶確認能否刪除下該檔案

確認可以刪除測試後,刪除該檔案測試,sqlplus飛速登入,ping主機名也一切正常

 

DNS的問題我就不知道,反正問題解決了,有空在研究。

sqlplus本地登入的機制,也可以再研究下

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

相關文章