Automatic Diagnostic Repository (ADR) with Oracle Net for 11g

Using and Disabling the Automatic Diagnostic Repository (ADR) with Oracle Net for 11g [ID 454927.1]

修改时间 08-OCT-2010 类型 HOWTO 状态 PUBLISHED

In this Document
Goal
Solution


Applies to:

Oracle Net Services - Version: 11.1.0.6.0 to 11.2.0.1 - Release: 11.1 to 11.2
Linux x86
Microsoft Windows (32-bit)
MS Windows
Intel Based Server LINUX

Checked for relevance on 19-MAR-2010.

Goal

Using and Disabling the Automatic Diagnostic Repository (ADR) with Oracle Net. Includes instructions for using the adrci executable included in the 11g installation.

Solution

Client Trace Files

Viewing Method 1

adrci
adrci> show base -product client
adrci> set base
adrci> show tracefile
adrci> show trace
Note: Windows will need a double backslash (\\) when setting the base if the base contains spaces in the path


Viewing Method 2 (Linux)

cd ~
cd oradiag_username
cd clients
cd user_username
cd host*
cd trace

-or-

adrci exec='show base -product client' | awk '{print $4}' > /tmp/dir.txt;export A=`sed -e 's/"//g' /tmp/dir.txt`;cd $A/diag/clients/u*/h*/trace


Followed by ls -ltr to sort the directory listing by date.

Viewing Method 2 (Windows)

cd %systemdrive%\Documents and Settings\%username%\oracle\oradiag_%username%\diag\clients\user_%username%\host*\trace


Server Trace Files

Viewing Method 1

adrci
adrci> show tracefile
adrci> show trace


Viewing Method 2 (Linux)

Server traces are in the format of _ora_.trc

cd $ORACLE_BASE/diag/rdbms/instance_name/$ORACLE_SID/trace

e.g., /u01/app/oracle/product/diag/rdbms/v11/V11/trace


Viewing Method 2 (Windows) List of server traces:


Server traces are in the format of _ora_.trc

set /p sid="What instance name was traced? " & cd %systemdrive%\oracle\product\diag\rdbms\%sid%\%sid%\trace



Listener Trace Files

Viewing Method 1

adrci
adrci> show tracefile
adrci> show trace

Viewing Method 2 (Linux)
Listener traces are in the format of ora__.trc

cd /diag/tnslsnr///trace

ls -ltr to sort by time and date

Viewing Method 2 (Windows)
Listener traces are in the format of ora__.trc

cd %systemdrive%\oracle\product\diag\diagtool\%computername%\listener\trace

dir /od *.trc to sort by time and date


LSNRCTL traces

Viewing Method 1

adrci
adrci> show base -product client
adrci> set base
adrci> show tracefile
adrci> show trace
Note: Windows will need a double backslash (\\) when setting the base if the base contains spaces in the path

Viewing Method 2 (Linux)

cd $HOME/oradiag_oracle/diag/lsnrctl/$HOSTNAME/$HOSTNAME/trace


ls -ltr *.trc to sort by time and date


Viewing Method 2 (Windows)

cd %systemdrive%\Documents and Settings\%username%\Oracle\oradiag_%username%\diag\tnslsnr\%computername%\%computername%\trace

dir /od *.trc to sort by time and date


Listener and CMAN Log Files

Logs are in XML format and must be made readable with adrci.

Viewing Method 1

adrci
adrci> show alert
[pick a number corresponding to a log file]

Use vi commands and :w to write the file

Since Windows does not use vi, you must copy notepad.exe or wordpad.exe to a location in the PATH that has no spaces and rename to vi.exe. The adrci "set editor" command can be used, but there are parsing bugs that makes this an unreliable option.


CMAN Trace Files

Because cman trace files are no longer named cmadmin.trc, cmgw0.trc, etc, it is not practical to use ADRCI to view cman trace files. Manual directory navigation is more suitable.


Viewing Method 1 (Linux)

cd diagnostic_base/diag/netcman///trace


Viewing Method 1 (Windows)

cd %oracle_base%\diag\netcman\%computername%\%cman%\trace

Sort directory listings by time/date (ls -ltr or dir /od)
If you have "n" number of CMAN gateways configured then the last (n + 2) traces in the directory output are what is needed.
Out of these last (n + 2) traces, the 1st will be the cmadmin trace, the 2nd will be the cman tnslsnr trace, and the remaining will be gateway traces.


sqlnet.log


Viewing Method 1

adrci

adrci>show base -product client

adrci> set base <above output>
adrci> show alert
[pick a number corresponding to a log file]

Note: Windows will need a double backslash (\\) when setting the base if the base contains spaces in the path


Use vi commands and :w to write the file

Since Windows does not use vi, you must copy notepad.exe or wordpad.exe to a location in the PATH that has no spaces and rename to vi.exe. The adrci "set editor" command can be used, but there are parsing bugs that makes this an unreliable option.



trcasst
No ADR created tracefile can be read by trcasst. Please see below on how to disable ADR.

Note that trcasst will read ADR trace files beginning in 11gR2. See unpublished BUG7828959 for more information. The Net Administrator's Guide will be corrected to include this information.



Tnsping Tracing

Tnsping traces are not effected by ADR being set or not. Set tnsping_trace_level as usual.


Reverting Back to Old-Style. Tracing and Logging:
Set DIAG_ADR_ENABLED=off in the following locations, after doing so, set a trace_level accordingly:

revert to client/server tracing/logging: set parameter DIAG_ADR_ENABLED=off in the client or server sqlnet.ora files


revert to listener tracing/logging: set parameter DIAG_ADR_ENABLED_listenerName=off in the listener.ora file


revert to cman tracing/logging:
Linux and Windows: add (DIAG_ADR_ENABLED=off) inside the parameter_list

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/756652/viewspace-719232/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/756652/viewspace-719232/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值