对oracle监听做trace

来源:互联网 发布:霸王别姬 段小楼 知乎 编辑:程序博客网 时间:2024/06/10 22:43
参考:http://docs.oracle.com/cd/B19306_01/network.102/b14212/troublestng.htm#sthref1710


SQL> select * from V$version;BANNER----------------------------------------------------------------Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - ProdPL/SQL Release 10.2.0.2.0 - ProductionCORE    10.2.0.2.0      ProductionTNS for Linux: Version 10.2.0.2.0 - ProductionNLSRTL Version 10.2.0.2.0 - Production[oracle@ocm54m5 trace]$ pwd/u01/app/oracle/product/10.2.0/db_1/network/trace[oracle@ocm54m5 trace]$ ls



方法一:通过命令实现



对默认监听listener做trace


命令:lsnrctl trace listener_name level


level可以是数字也可以是下面的值
off (equivalent to 0) provides no tracing
user (equivalent to 4) traces to identify user-induced error conditions
admin (equivalent to 6) traces to identify installation-specific problems
support (equivalent to 16) provides trace information for troubleshooting information for Oracle Support Services


可选的数字从0到16
The trace level value can either be a value within the range of 0 (zero) to 16 (where 0 is no tracing and 16 represents the maximum amount of tracing) or a value of off, admin, user, or support.



如下:[oracle@ocm54m5 trace]$ lsnrctl trace listener adminLSNRCTL for Linux: Version 10.2.0.2.0 - Production on 13-FEB-2014 16:00:23Copyright (c) 1991, 2005, Oracle.  All rights reserved.Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ocm54m5)(PORT=1521)))Opened trace file: /u01/app/oracle/product/10.2.0/db_1/network/trace/listener.trcThe command completed successfully[oracle@ocm54m5 trace]$ lslistener.trc




方法二:通过listener.ora中参数实现

新增以下参数,取值和方法1一样。
TRACE_LEVEL_listener_name

LSNR2=  (DESCRIPTION=    (ADDRESS_LIST=      (ADDRESS=(PROTOCOL=tcp)(HOST=ocm54m5)(PORT=1526))      (ADDRESS=(PROTOCOL=ipc)(KEY=extproc1))))trace_level_lsnr2=support




然后再重启下监听 ,可以看到trace文件生成了:
[oracle@ocm54m5 trace]$ ls
lsnr2.trc
[oracle@ocm54m5 trace]$ 




格式化输出


[oracle@ocm54m5 trace]$ trcasst lsnr2.trc > aa.txt


[oracle@ocm54m5 trace]$  ls
aa.txt  lsnr2.trc  















0 0
原创粉丝点击