合 Oracle中常用的跟踪诊断trace配置方法
sqlnet.ora中配置
跟踪连接过程
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | -- 服务端trace TRACE_LEVEL_SERVER = 16 TRACE_FILE_SERVER = SERVER TRACE_DIRECTORY_SERVER= /u01/app/oracle/network/trace TRACE_TIMESTAMP_SERVER = ON TRACE_UNIQUE_SERVER = ON DIAG_ADR_ENABLED=OFF -- 客户端trace DIAG_ADR_ENABLED = off TRACE_LEVEL_CLIENT = 15 TRACE_UNIQUE_CLIENT = on TRACE_DIRECTORY_CLIENT = C:\Users\Administrator\Desktop\instantclient_21_9\network\admin\log TRACE_FILE_CLIENT = client TRACE_TIMESTAMP_CLIENT = ON |
跟踪tnsping过程
1 2 | tnsping.trace_directory=D:\Program files\app\oracle\product\11.2.0.1\dbhome_1\NETWORK\ADMIN tnsping.trace_level=support |
linux 跟踪sqlplus进程
1 2 3 | strace -o /tmp/output.txt -T -tt -e trace=all sqlplus / as sysdba strace -t -p 4545 |
Unix 跟踪sqlplus进程
1 | truss -dfaie -o /tmp/sched_trace.out.02271 sqlplus '/as sysdba' |
监听诊断
启动监听日志 lsnrctl set log_status on
1 2 | LSNRCTL> set log_status on LSNRCTL> save_config |