1. 程式人生 > >如何使用sqlnet net trace 跟蹤或調試oracle連接故障

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

如何使用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:
diag_adr_enabled=off
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_level_client=16
Trace_directory_client=D:\app\Administrator\product\11.2.0\client_1\network\admin
Trace_unique_client=on
Trace_timestamp_client=on
Diag_adr_enabled=off
tnsping.trace_directory=D:\app\Administrator\product\11.2.0\client_1\network\admin
tnsping.trace_level=admin


實驗測試

修改客戶端的sqlnet.ora文件:

# sqlnet.ora Network Configuration File: D:\app\Administrator\product\11.2.0\client_1\network\admin\sqlnet.ora
# Generated by Oracle configuration tools.
# This file is actually generated by netca. But if customers choose to 
# install "Software Only", this file wont exist and without the native 
# authentication, they will not be able to connect to the database on NT.
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
#SQLnet trace
Trace_level_client=16
Trace_directory_client=D:\app\Administrator\product\11.2.0\client_1\network\admin
Trace_unique_client=on
Trace_timestamp_client=on
Diag_adr_enabled=off
tnsping.trace_directory=D:\app\Administrator\product\11.2.0\client_1\network\admin
tnsping.trace_level=admin

在客戶端中tnsping udevasm 如下:

技術分享

查看生成的trace 文件如下:

技術分享

內容如下:

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

-> PARAMETER TABLE LOAD RESULTS FOLLOW <-
Successful parameter table load
-> PARAMETER TABLE HAS THE FOLLOWING CONTENTS <-
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
nlpaxini: entry
nlpaxini: 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
snlinGetAddrInfo: entry
snlinGetAddrInfo: exit
nttbnd2addr: using host IP address: 192.168.1.152
snlinFreeAddrInfo: entry
snlinFreeAddrInfo: exit
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>sqlplus [email protected]

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
輸入口令:
ERROR:
ORA-12560: TNS: 協議適配器錯誤


請輸入用戶名: sys
輸入口令:
ERROR:
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]
[16-7月 -2017 14:25:23:163] -> PARAMETER TABLE LOAD RESULTS FOLLOW <-
[16-7月 -2017 14:25:23:163] Successful parameter table load
[16-7月 -2017 14:25:23:163] -> PARAMETER TABLE HAS THE FOLLOWING CONTENTS <-
[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] nlpaxini: entry
[16-7月 -2017 14:25:23:194] nlpaxini: 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

[[email protected] 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文件

[[email protected] 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 & 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"
// *Cause: A generic protocol adapter error occurred.
// *Action: For further details, turn on tracing and reexecute the operation.
/
///////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////
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 & 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"
// *Cause: A generic protocol adapter error occurred.
// *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來排查原因

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