如何使用sqlnet net trace 跟踪或调试oracle连接故障

本文涉及的产品
日志服务 SLS,月写入数据量 50GB 1个月
简介:

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文件:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# 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 如下:

wKiom1lrDqOBMmMcAACKb7iM4Sw947.jpg

查看生成的trace 文件如下:

wKioL1lrDoqSmr5OAAByEdP6AZg055.jpg

内容如下:

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 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
输入口令:
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

[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 & 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来排查原因





















本文转自xiaocao1314051CTO博客,原文链接: http://blog.51cto.com/xiaocao13140/1948000,如需转载请自行联系原作者

相关实践学习
日志服务之使用Nginx模式采集日志
本文介绍如何通过日志服务控制台创建Nginx模式的Logtail配置快速采集Nginx日志并进行多维度分析。
相关文章
|
6月前
|
开发框架 Oracle 关系型数据库
ASP.NET实验室LIS系统源码 Oracle数据库
LIS是HIS的一个组成部分,通过与HIS的无缝连接可以共享HIS中的信息资源,使检验科能与门诊部、住院部、财务科和临床科室等全院各部门之间协同工作。 
79 4
|
1月前
|
SQL 开发框架 .NET
ASP.NET连接SQL数据库:详细步骤与最佳实践指南ali01n.xinmi1009fan.com
随着Web开发技术的不断进步,ASP.NET已成为一种非常流行的Web应用程序开发框架。在ASP.NET项目中,我们经常需要与数据库进行交互,特别是SQL数据库。本文将详细介绍如何在ASP.NET项目中连接SQL数据库,并提供最佳实践指南以确保开发过程的稳定性和效率。一、准备工作在开始之前,请确保您
187 3
|
3月前
|
API
【Azure 媒体服务】Media Service的编码示例 -- 创建缩略图子画面的.NET代码调试问题
【Azure 媒体服务】Media Service的编码示例 -- 创建缩略图子画面的.NET代码调试问题
|
1月前
|
存储 Oracle 关系型数据库
数据库数据恢复—Oracle ASM磁盘组故障数据恢复案例
Oracle数据库数据恢复环境&故障: Oracle ASM磁盘组由4块磁盘组成。Oracle ASM磁盘组掉线 ,ASM实例不能mount。 Oracle数据库故障分析&恢复方案: 数据库数据恢复工程师对组成ASM磁盘组的磁盘进行分析。对ASM元数据进行分析发现ASM存储元数据损坏,导致磁盘组无法挂载。
|
2月前
|
开发框架 .NET C#
VSCode开发.net项目时调试无效
【9月更文挑战第22天】在使用 VSCode 开发 .NET 项目时遇到调试问题,可从项目配置、调试配置、调试器安装、运行环境、日志和错误信息等方面排查。确认项目类型及文件配置,检查 `launch.json` 文件及配置项,确保调试器扩展已安装并启用,验证 .NET 运行时版本和环境变量,查看 VSCode 输出窗口和项目日志文件,检查权限及代码错误。若问题仍未解决,可查阅官方文档或社区论坛。
|
1月前
|
SQL 开发框架 .NET
ASP.NET连接SQL数据库:实现过程与关键细节解析an3.021-6232.com
随着互联网技术的快速发展,ASP.NET作为一种广泛使用的服务器端开发技术,其与数据库的交互操作成为了应用开发中的重要环节。本文将详细介绍在ASP.NET中如何连接SQL数据库,包括连接的基本概念、实现步骤、关键代码示例以及常见问题的解决方案。由于篇幅限制,本文不能保证达到完整的2000字,但会确保
|
2月前
|
自然语言处理 C# 图形学
使用dnSpyEx对.NET Core程序集进行反编译、编辑和调试
使用dnSpyEx对.NET Core程序集进行反编译、编辑和调试
|
3月前
|
缓存 NoSQL 网络协议
【Azure Redis 缓存】Redisson 连接 Azure Redis出现间歇性 java.net.UnknownHostException 异常
【Azure Redis 缓存】Redisson 连接 Azure Redis出现间歇性 java.net.UnknownHostException 异常
|
3月前
|
开发框架 监控 .NET
【Azure 应用程序见解】在Docker中运行的ASP.NET Core应用如何开启Application Insights的Profiler Trace呢?
【Azure 应用程序见解】在Docker中运行的ASP.NET Core应用如何开启Application Insights的Profiler Trace呢?
|
4月前
|
Linux C# iOS开发
如何用 WinDbg 调试Linux上的 .NET程序
【7月更文挑战第13天】 1. `dotnet-dump`: Collects process dumps with `dotnet-dump collect -p &lt;process_id&gt;`. 2. `lldb`: Debugs Mono runtime apps on macOS/Linux. 3. **Visual Studio Code**: Remotely debugs .NET via the C# extension. 4. **JetBrains Rider**: Supports remote debugging of .NET on Linux.

推荐镜像

更多
下一篇
无影云桌面