天天看點

如何使用sqlnet net trace 跟蹤或調試oracle連接配接故障

Oracle Net trace 用于跟蹤或調試oracle連接配接故障,連接配接異常斷開或者連接配接逾時等情形,通過産生詳細的跟蹤資訊來進行分析和診斷Oracle Net相關故障。關于這個網絡調試主要是通過為相關的網絡配置檔案添加相關的參數來實作

Oracle trace的相關參數如下:

trace_level_[client|server|listener] = [0-16|user|admin|support|off]

trace_file_[client|server|listener] = <file name>

trace_directory_[client|server|listener] = <directory>

trace_unique_[client|server|listener] = [on|true|off|false]

trace_timestamp_[client|server|listener] = [on|true|off|false] #oracle8i+

trace_filelen_[client|server|listener] = <size in kb> #oracle8i+

trace_fileno_[client|server|listener] = <number> #oracle8i+

log_file_[client|server|listener] = <file name>

log_directory_[client|server|listener] = <directory name>

logging_listener = [on|off]

tnsping.trace_level = [0-16|user|admin|support|off]

tnsping.trace_directory = <directory>

names.trace_level = [0-16|user|admin|support|off]

names.trace_file = <file name>

names.trace_directory = <directory>

names.trace_unique = [on|off]

names.log_file = <file name>

names.log_directory = <directory>

names.log_unique = [on|off]

namesctl.trace_level = [0-16|user|admin|support|off]

namesctl.trace_file = <file name>

namesctl.trace_directory = <directory>

namesctl.trace_unique = [on|off]notes on tracing 11g and newer client/server/listener/cman

對于Oracle 11g,使用傳統的Oracle net tracing時,必須添加下列參數禁用adr

sqlnet.ora file on either client or server:

diag_adr_enabled=off

listener.ora file:

diag_adr_enabled_<listener_name>=off

cman.ora:

adr_base=/your_directory

啟用sqlnet trace

為用戶端的sqlnet.ora檔案添加下列項來啟用sqlnet trace,trace後,建議移除這些選項以避免額外的網絡開銷

Trace_level_client=16

Trace_directory_client=<path_to_the_trace_directory> # use the full path to the trace directory

Trace_unique_client=on

Trace_timestamp_client=on

Diag_adr_enabled=off

oracle net trace的元件,參數檔案及預設的trace檔案

oracle net component | configuration file | default trace file

----------------------- --------------------- --------------------------------

oracle net listener    listener.ora           listener.trc

oracle net - client    sqlnet.ora on client    cli*.trc

oracle net - server    sqlnet.ora on server    svr_*.trc

tnsping                sqlnet.ora on client | server  tnsping.trc

oracle name server      names.ora                   names.trc

oracle namesctl         sqlnet.ora on server

oracle connection manager cman.ora

03、TRACE時的注意事項

   1、確定所需trace的配置檔案存在

     預設情況下,Oracle會從下列位置搜尋網絡配置檔案

     a.TNS_ADMIN environment variable (incl. Windows Registry Key)

     b./etc or /var/opt/oracle (Unix)

     c.$ORACLE_HOME/network/admin (Unix)

     d.%ORACLE_HOME%/Network/Admin or %ORACLE_HOME%/Net80/Admin (Windows)

     Note: User-specific Oracle Net parameters may also reside in $HOME/sqlnet.ora file.

     An Oracle Net server installation is also a client itself.

  2、 確定trace檔案所在的磁盤有足夠的空間

  3、當有關Oracle net故障解決後應立即禁用Oracle net trace特性

  4、大型的跟蹤日志檔案使得程序開銷過大,是以在無異常的情況下關閉trace特性,截斷日志檔案等以提高Oracle net整體性能

  5、確定連接配接的使用者對跟蹤日志檔案所在的路徑使用者有寫權限

  6、對于伺服器端的trace,将其置為OFF後,并不能立即停止伺服器端的trace,需要重新開機監聽

  7、Oracle Net本身也産生相關的日志,如監聽日志,sqlnet日志等,Oracle Net trace則是在此基礎之上提供更為詳盡的故障診斷資訊

04、trace的相關示例

分用戶端與服務端:

001、用戶端trace

修改用戶端的sqlnet.ora檔案

Trace_directory_client=D:\app\Administrator\product\11.2.0\client_1\network\admin

tnsping.trace_directory=D:\app\Administrator\product\11.2.0\client_1\network\admin

tnsping.trace_level=admin

實驗測試

修改用戶端的sqlnet.ora檔案:

<code># sqlnet.ora Network Configuration File: D:\app\Administrator\product\11.2.0\client_1\network\admin\sqlnet.ora</code>

<code># Generated by Oracle configuration tools.</code>

<code># This file is actually generated by netca. But if customers choose to </code>

<code># install "Software Only", this file wont exist and without the native </code>

<code># authentication, they will not be able to connect to the database on NT.</code>

<code>SQLNET.AUTHENTICATION_SERVICES= (NTS)</code>

<code>NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)</code>

<code>#SQLnet trace</code>

<code>Trace_level_client=16</code>

<code>Trace_directory_client=D:\app\Administrator\product\11.2.0\client_1\network\admin</code>

<code>Trace_unique_client=on</code>

<code>Trace_timestamp_client=on</code>

<code>Diag_adr_enabled=off</code>

<code>tnsping.trace_directory=D:\app\Administrator\product\11.2.0\client_1\network\admin</code>

<code>tnsping.trace_level=admin</code>

在用戶端中tnsping udevasm 如下:

<a href="https://s4.51cto.com/wyfs02/M02/9C/08/wKiom1lrDqOBMmMcAACKb7iM4Sw947.jpg" target="_blank"></a>

檢視生成的trace 檔案如下:

<a href="https://s1.51cto.com/wyfs02/M00/9C/07/wKioL1lrDoqSmr5OAAByEdP6AZg055.jpg" target="_blank"></a>

内容如下:

TNS Ping Utility for 32-bit Windows: Version 11.2.0.4.0 - Production on 16-7月 -2017 14:20:26

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

--- TRACE CONFIGURATION INFORMATION FOLLOWS ---

New trace stream is D:\app\Administrator\product\11.2.0\client_1\network\admin\tnsping.trc

New trace level is 6

--- TRACE CONFIGURATION INFORMATION ENDS ---

--- PARAMETER SOURCE INFORMATION FOLLOWS ---

Attempted load of system pfile source D:\app\Administrator\product\11.2.0\client_1\network\admin\sqlnet.ora

Parameter source loaded successfully

 -&gt; PARAMETER TABLE LOAD RESULTS FOLLOW &lt;-

Successful parameter table load

 -&gt; PARAMETER TABLE HAS THE FOLLOWING CONTENTS &lt;-

  Diag_adr_enabled = off

  tnsping.trace_level = admin

  Trace_level_client = 16

  NAMES.DIRECTORY_PATH = (TNSNAMES, EZCONNECT)

  tnsping.trace_directory = D:\app\Administrator\product\11.2.0\client_1\network\admin

  Trace_unique_client = on

  SQLNET.AUTHENTICATION_SERVICES = (NTS)

  Trace_directory_client = D:\app\Administrator\product\11.2.0\client_1\network\admin

  Trace_timestamp_client = on

--- PARAMETER SOURCE INFORMATION ENDS ---

--- LOG CONFIGURATION INFORMATION FOLLOWS ---

Log stream will be "standard output"

Log stream validation not requested

--- LOG CONFIGURATION INFORMATION ENDS ---

nlstdipi: entry

nlstdipi: exit

nnfun2awanm: entry

nnfgiinit: entry

nncpcin_maybe_init: default name server domain is [root]

nnfgiinit: Installing read path

nnfgsrsp: entry

nnfgsrsp: Obtaining path parameter from names.directory_path or native_names.directory_path

nnfgsrdp: entry

nnfgsrdp: Setting path:

nnfgsrdp: checking element TNSNAMES

nnfgsrdp: checking element EZCONNECT

nnfgsrdp: Path set

nnfun2a: entry

nlolgobj: entry

nnfgrne: entry

nnfgrne: Going though read path adapters

nnfgrne: Switching to TNSNAMES adapter

nnftboot: entry

nlpaxini: entry

nlpaxini: exit

nnftmlf_make_local_addrfile: entry

nnftmlf_make_local_addrfile: construction of local names file failed

nnftmlf_make_local_addrfile: exit

nnftmlf_make_system_addrfile: entry

nnftmlf_make_system_addrfile: system names file is D:\app\Administrator\product\11.2.0\client_1\network\admin\tnsnames.ora

nnftmlf_make_system_addrfile: exit

nnftboot: exit

nnftrne: entry

nnftrne: Original name: udevasm

nnfttran: entry

nnfttran: exit

nnftrne: Using tnsnames.ora address (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.152)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = udevasm))) for name udevasm

nnftrne: exit

nnfgrne: exit

nlolgserv: entry

nnfggav: entry

nnftgav: entry

nnftgav: exit

nnfgfrm: entry

nnftfrm: entry

nnftfrm: exit

nnfgfrm: exit

nlolgserv: exit

nlolgobj: exit

nlolfmem: entry

nlolfmem: exit

nnfun2awanm: Getting the path of sqlnet.ora

nnfun2awanm: Getting the adapter name

nnfun2awanm: exit

nsmal: 216 bytes at 0x3df65a0

nscall: connecting...

snlinGetAddrInfo: entry

snlinGetAddrInfo: exit

snlinFreeAddrInfo: entry

snlinFreeAddrInfo: exit

nladini: entry

nladini: exit

nladget: entry

nladget: exit

nsmal: 107 bytes at 0x3df6fb8

nsc2addr: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.152)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=udevasm)))

nttbnd2addr: entry

nttbnd2addr: using host IP address: 192.168.1.152

nttbnd2addr: exit

nsmal: 1056 bytes at 0x3df7030

nsmal: 2120 bytes at 0x3df7458

nsmal: 84 bytes at 0x3df7de8

nsopen: opening transport...

nttcon: entry

nttcon: toc = 1

nttcnp: entry

nttcnp: exit

nttcni: entry

nttcni: Tcp conn timeout = 60000 (ms)

nttctl: entry

.........内容比較多就是省略了後面内容

上面顯示的是正常的邏輯下面的内容

下面再來看報錯時如何看trace檔案

修改tnsname.or中伺服器名

UDEVASM1 =

  (DESCRIPTION =

    (ADDRESS_LIST =

      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.152)(PORT = 1521))

    )

    (CONNECT_DATA =

      (SERVICE_NAME = udevasm)

  )

把udevasm修改udevasm1

然後通過sqlplus登入

C:\Users\Administrator&gt;sqlplus sys/oracle@udevasm

SQL*Plus: Release 11.2.0.4.0 Production on 星期日 7月 16 14:25:23 2017

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

ERROR:

ORA-12154: TNS: 無法解析指定的連接配接辨別符

請輸入使用者名:  sys

輸入密碼:

ORA-12560: TNS: 協定擴充卡錯誤

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

檢視trace檔案,截取部分内容如下:

[16-7月 -2017 14:25:23:163] --- TRACE CONFIGURATION INFORMATION FOLLOWS ---

[16-7月 -2017 14:25:23:163] New trace stream is D:\app\Administrator\product\11.2.0\client_1\network\admin\cli_932.trc

[16-7月 -2017 14:25:23:163] New trace level is 16

[16-7月 -2017 14:25:23:163] --- TRACE CONFIGURATION INFORMATION ENDS ---

[16-7月 -2017 14:25:23:163] --- PARAMETER SOURCE INFORMATION FOLLOWS ---

[16-7月 -2017 14:25:23:163] Attempted load of system pfile source D:\app\Administrator\product\11.2.0\client_1\network\admin\sqlnet.ora

[16-7月 -2017 14:25:23:163] Parameter source loaded successfully

[16-7月 -2017 14:25:23:163] 

[16-7月 -2017 14:25:23:163] Attempted load of local pfile source C:\Users\Administrator\sqlnet.ora

[16-7月 -2017 14:25:23:163] Parameter source was not loaded

[16-7月 -2017 14:25:23:163]  -&gt; PARAMETER TABLE LOAD RESULTS FOLLOW &lt;-

[16-7月 -2017 14:25:23:163] Successful parameter table load

[16-7月 -2017 14:25:23:163]  -&gt; PARAMETER TABLE HAS THE FOLLOWING CONTENTS &lt;-

[16-7月 -2017 14:25:23:163]   Diag_adr_enabled = off

[16-7月 -2017 14:25:23:163]   tnsping.trace_level = admin

[16-7月 -2017 14:25:23:163]   Trace_level_client = 16

[16-7月 -2017 14:25:23:163]   NAMES.DIRECTORY_PATH = (TNSNAMES, EZCONNECT)

[16-7月 -2017 14:25:23:163]   tnsping.trace_directory = D:\app\Administrator\product\11.2.0\client_1\network\admin

[16-7月 -2017 14:25:23:163]   Trace_unique_client = on

[16-7月 -2017 14:25:23:163]   SQLNET.AUTHENTICATION_SERVICES = (NTS)

[16-7月 -2017 14:25:23:163]   Trace_directory_client = D:\app\Administrator\product\11.2.0\client_1\network\admin

[16-7月 -2017 14:25:23:163]   Trace_timestamp_client = on

[16-7月 -2017 14:25:23:163] --- PARAMETER SOURCE INFORMATION ENDS ---

[16-7月 -2017 14:25:23:163] --- LOG CONFIGURATION INFORMATION FOLLOWS ---

[16-7月 -2017 14:25:23:163] Log stream will be "C:\Users\Administrator\sqlnet.log"

[16-7月 -2017 14:25:23:163] Log stream validation not requested

[16-7月 -2017 14:25:23:163] --- LOG CONFIGURATION INFORMATION ENDS ---

[16-7月 -2017 14:25:23:163] nlstdipi: entry

[16-7月 -2017 14:25:23:163] nlstdipi: exit

[16-7月 -2017 14:25:23:163] nigini: entry

[16-7月 -2017 14:25:23:163] nigini: Count in the NL global area is now 1

[16-7月 -2017 14:25:23:163] nigini: Count in NI gbl area now: 1

[16-7月 -2017 14:25:23:163] nrigbi: entry

[16-7月 -2017 14:25:23:163] nrigbni: entry

[16-7月 -2017 14:25:23:163] nrigbni: Unable to get data from navigation file tnsnav.ora

[16-7月 -2017 14:25:23:163] nrigbni: exit

[16-7月 -2017 14:25:23:163] nrigbi: exit

[16-7月 -2017 14:25:23:163] nigini: exit

[16-7月 -2017 14:25:23:179] nigsui: entry

[16-7月 -2017 14:25:23:179] nigsui: Set User Interrupt: hdl=0, prc=0x404070, ctx=0x8f2b50.

[16-7月 -2017 14:25:23:179] nigsui: exit (0)

[16-7月 -2017 14:25:23:194] nigini: entry

[16-7月 -2017 14:25:23:194] nigini: Count in the NL global area is now 2

[16-7月 -2017 14:25:23:194] nigini: Count in NI gbl area now: 2

[16-7月 -2017 14:25:23:194] nigini: exit

[16-7月 -2017 14:25:23:194] niqname: Using nnfsn2a() to build connect descriptor for (possibly remote) database.

[16-7月 -2017 14:25:23:194] nnfgiinit: entry

[16-7月 -2017 14:25:23:194] nncpcin_maybe_init: default name server domain is [root]

[16-7月 -2017 14:25:23:194] nnfgiinit: Installing read path

[16-7月 -2017 14:25:23:194] nnfgsrsp: entry

[16-7月 -2017 14:25:23:194] nnfgsrsp: Obtaining path parameter from names.directory_path or native_names.directory_path

[16-7月 -2017 14:25:23:194] nnfgsrdp: entry

[16-7月 -2017 14:25:23:194] nnfgsrdp: Setting path:

[16-7月 -2017 14:25:23:194] nnfgsrdp: checking element TNSNAMES

[16-7月 -2017 14:25:23:194] nnfgsrdp: checking element EZCONNECT

[16-7月 -2017 14:25:23:194] nnfgsrdp: Path set

[16-7月 -2017 14:25:23:194] nnfun2a: entry

[16-7月 -2017 14:25:23:194] nlolgobj: entry

[16-7月 -2017 14:25:23:194] nnfgrne: entry

[16-7月 -2017 14:25:23:194] nnfgrne: Going though read path adapters

[16-7月 -2017 14:25:23:194] nnfgrne: Switching to TNSNAMES adapter

[16-7月 -2017 14:25:23:194] nnftboot: entry

[16-7月 -2017 14:25:23:194] nlpaxini: entry

[16-7月 -2017 14:25:23:194] nlpaxini: exit

[16-7月 -2017 14:25:23:194] nnftmlf_make_local_addrfile: entry

[16-7月 -2017 14:25:23:194] nnftmlf_make_local_addrfile: construction of local names file failed

[16-7月 -2017 14:25:23:194] nnftmlf_make_local_addrfile: exit

[16-7月 -2017 14:25:23:194] nnftmlf_make_system_addrfile: entry

[16-7月 -2017 14:25:23:194] nnftmlf_make_system_addrfile: system names file is D:\app\Administrator\product\11.2.0\client_1\network\admin\tnsnames.ora

[16-7月 -2017 14:25:23:194] nnftmlf_make_system_addrfile: exit

[16-7月 -2017 14:25:23:194] nnftboot: exit

[16-7月 -2017 14:25:23:194] nnftrne: entry

[16-7月 -2017 14:25:23:194] nnftrne: Original name: udevasm

[16-7月 -2017 14:25:23:194] nnfttran: entry

[16-7月 -2017 14:25:23:194] nnfttran: Error querying udevasm of attribute A.SMD errcode 408

[16-7月 -2017 14:25:23:194] nnfgrne: Query unsuccessful, skipping to next adapter

[16-7月 -2017 14:25:23:194] nnfgrne: Switching to EZCONNECT adapter

[16-7月 -2017 14:25:23:194] nnfhboot: entry

[16-7月 -2017 14:25:23:194] nnfhboot: exit

[16-7月 -2017 14:25:23:194] snlinGetAddrInfo: entry

[16-7月 -2017 14:25:25:846] snlinGetAddrInfo: getaddrinfo() failed with error 11004

[16-7月 -2017 14:25:25:846] snlinGetAddrInfo: exit

[16-7月 -2017 14:25:25:846] nnfhrne: Error forming address for udevasm, errcode 406

[16-7月 -2017 14:25:25:846] nnfgrne: Query unsuccessful, skipping to next adapter

[16-7月 -2017 14:25:25:846] nnfgrne: exit

[16-7月 -2017 14:25:25:846] nnfun2a: address for name "udevasm" not found

[16-7月 -2017 14:25:25:846] niqname: Return code from nnfsn2a is 1

[16-7月 -2017 14:25:25:846] nigtrm: Count in the NI global area is now 1

[16-7月 -2017 14:25:25:846] nigtrm: Count in the NL global area is now 1

[16-7月 -2017 14:25:25:862] nigini: entry

[16-7月 -2017 14:25:25:862] nigini: Count in the NL global area is now 2

[16-7月 -2017 14:25:25:862] nigini: Count in NI gbl area now: 2

[16-7月 -2017 14:25:25:862] nigini: exit

[16-7月 -2017 14:25:25:862] niqname: Using nnfsn2a() to build connect descriptor for (possibly remote) database.

[16-7月 -2017 14:25:25:862] nnfun2a: entry

[16-7月 -2017 14:25:25:862] nlolgobj: entry

[16-7月 -2017 14:25:25:862] nnfgrne: entry

[16-7月 -2017 14:25:25:862] nnfgrne: Going though read path adapters

[16-7月 -2017 14:25:25:862] nnfgrne: Switching to TNSNAMES adapter

[16-7月 -2017 14:25:25:862] nnftrne: entry

[16-7月 -2017 14:25:25:862] nnftrne: Original name: udevasm

[16-7月 -2017 14:25:25:862] nnfttran: entry

[16-7月 -2017 14:25:25:862] nnfttran: Error querying udevasm of attribute A.SMD errcode 408

[16-7月 -2017 14:25:25:862] nnfgrne: Query unsuccessful, skipping to next adapter

[16-7月 -2017 14:25:25:862] nnfgrne: Switching to EZCONNECT adapter

[16-7月 -2017 14:25:25:862] snlinGetAddrInfo: entry

[16-7月 -2017 14:25:28:483] snlinGetAddrInfo: getaddrinfo() failed with error 11004

[16-7月 -2017 14:25:28:483] snlinGetAddrInfo: exit

[16-7月 -2017 14:25:28:483] nnfhrne: Error forming address for udevasm, errcode 406

[16-7月 -2017 14:25:28:483] nnfgrne: Query unsuccessful, skipping to next adapter

[16-7月 -2017 14:25:28:483] nnfgrne: exit

[16-7月 -2017 14:25:28:483] nnfun2a: address for name "udevasm" not found

[16-7月 -2017 14:25:28:483] niqname: Return code from nnfsn2a is 1

[16-7月 -2017 14:25:28:483] nigtrm: Count in the NI global area is now 1

[16-7月 -2017 14:25:28:483] nigtrm: Count in the NL global area is now 1

[16-7月 -2017 14:25:28:483] nigini: entry

[16-7月 -2017 14:25:28:483] nigini: Count in the NL global area is now 2

[16-7月 -2017 14:25:28:483] nigini: Count in NI gbl area now: 2

[16-7月 -2017 14:25:28:483] nigini: exit

從上面報錯的資訊可以看出來,udevasm這個SID不存在,無法找到,因為我們在上面修改了這個名稱,是以可以判斷這個是SID的錯誤

伺服器端的修改和用戶端修改一樣,隻不過在伺服器端的要重新加載一個監聽,lsnrctl reload

[oracle@localhost trace]$ ll

-rw-r----- 1 oracle oinstall  4487 Jul 16 15:42 db011_11048.trc

-rw-r----- 1 oracle oinstall  3536 Jul 16 15:42 db011_11051.trc

-rw-r----- 1 oracle oinstall  3768 Jul 16 15:43 db011_11056.trc

-rw-r----- 1 oracle oinstall  3536 Jul 16 15:43 db011_11058.trc

-rw-r----- 1 oracle oinstall  4487 Jul 16 15:44 db011_11063.trc

-rw-r----- 1 oracle oinstall  3536 Jul 16 15:44 db011_11065.trc

-rw-r----- 1 oracle oinstall  3768 Jul 16 15:45 db011_11070.trc

-rw-r----- 1 oracle oinstall  3536 Jul 16 15:45 db011_11072.trc

-rw-r----- 1 oracle oinstall  4255 Jul 16 15:46 db011_11075.trc

-rw-r----- 1 oracle oinstall  4487 Jul 16 15:46 db011_11081.trc

-rw-r----- 1 oracle oinstall  3536 Jul 16 15:46 db011_11083.trc

-rw-r----- 1 oracle oinstall     0 Jul 16 15:42 db012_11048.trc

-rw-r----- 1 oracle oinstall     0 Jul 16 15:42 db012_11051.trc

-rw-r----- 1 oracle oinstall     0 Jul 16 15:43 db012_11056.trc

由于trace檔案内容顯示的不是很友好,不友善排查錯誤,可以通過對于session trace, Oracle提供了tkprof工具,對于net trace,Oracle也提供了工具,那就是trcasst來格式化trace檔案。

現就通過trcasst來格式化trace檔案

[oracle@localhost trace]$ trcasst -odt -e0 -s cli_932.trc     

Trace Assistant Utility: Version 11.2.0.3.0 Production on July 16, 2017 3:57:43 PM

Copyright (c) 2001, 2011, Oracle.  All rights reserved.

    *************************************************************************

    *                        Trace Assistant                                *

///////////////////////////////////////////////////////////////

Error found. Error Stack follows:

              id:0

  Operation code:65

      NS Error 1:12560

      NS Error 2:0

NT Generic Error:530

  Protocol Error:126

        OS Error:0

 NS &amp; NT Errors Translation

12560, 00000 "TNS:protocol adapter error" 

 // *Cause: A generic protocol adapter error occurred. 

 // *Action: Check addresses used for proper protocol specification. Before 

 // reporting this error, look at the error stack and check for lower level 

 // transport errors.For further details, turn on tracing and reexecute the 

 // operation. Turn off tracing when the operation is complete. 

/

00000, 00000 "Not An Error" 

 // *Cause:  Everything is working as it should. 

 // *Action: Dont worry: Be happy. 

00530, 00000 "Protocol adapter error" 

 // *Action: For further details, turn on tracing and reexecute the operation. 

----------------------

Trace File Statistics:

Total number of Sessions: 0

DATABASE:

  Operation Count:    0 OPENS,     0 PARSES,     0 EXECUTES,     0 FETCHES

ORACLE NET SERVICES:

  Total Calls  :         0 sent,          0 received,           0 oci

  Total Bytes  :         0 sent,          0 received

    Average Bytes:  sent per packet,   received per packet

    Maximum Bytes:         0 sent,          0 received

  Grand Total Packets:      0  sent,       0 received

    *                    Trace Assistant has completed                      *

總結:對于用戶端到資料庫服務端的一些連接配接問題,可以先按程式、監聽本身、用戶端版本等方面排查,如果不能解決問題,則可以通過sqlnet trace來排查原因

本文轉自xiaocao1314051CTO部落格,原文連結: http://blog.51cto.com/xiaocao13140/1948000,如需轉載請自行聯系原作者