参考自:
Tracing windows system calls via Process Monitor - truss equivalent for Windows (Doc ID 1447085.1)
适用于:
Oracle Database - Enterprise Edition - Version 8.1.7.0 to 11.2.0.3 [Release 8.1.7 to 11.2]
Information in this document applies to any platform.
解决方案:
1. Process Monitor 介绍:
Process Monitor 是windows下的一个高级监控工具,该工具可以显示实时文件系统,注册表,进程和线程活动。
Process Monitor的特征是:广泛的事件属性,比如session ids 、user name,可信的进程信息,全部的线程stacks with integrated symbol support for each operation,同步的写入日志到文件等等。
2. Process Monitor的下载:
http://technet.microsoft.com/en-us/sysinternals/bb896645
3. Process Monitor的工作:
当你启动Process Monitor后,Process Monitor会启动对 来自所有 running application 的system calls 的跟踪。
下面是被监控的event classes 的列表(list)
- File System
- Network
- Process
- Profiling
- Registry
对于每个event,Process Monitor显示了如下信息:
操作:正在被执行的操作。
路径:操作所在位置,比如file的path,或者注册表键值(registry key)。
结果:操作的结果。
细节:操作的更一步的细节。
4. 跟踪单个application的方法
Process Monitor 提供非常丰富的过滤功能,这些功能允许用户来缩小跟踪到一个指定的标准。
使用如下之一的方法来建立一个filter:
- Open Filter menu > Select filter.
- Click Ctrl+L
- Click the filter icon (cone) from the toolbar.
当开启一个filter windows后,遵守下面的steps:
a. 从first drop down list中,选择Process name,或者 选择PID
b. 从second drop down list中,选择操作符(operator)
c. 填入process name or PID
d. 点击add 按钮
5.快速应用程序tracing
为了快速trace 一个application(区别于writing down the filter manually),点击sniper 图标,然后drag 到应用窗口。
6.跟踪一个单独的thread
Each oracle process is represented as a windows Thread, invoked by a single windows process.
To trace a single thread, select TID, then write down the thread id and click apply.
To get oracle session thread id, Join v$session and v$process to get SPID, which maps to windows thread ID:
select a.username, a.osuser, b.spid from v$session a, v$process b where a.paddr = b.addr and a.username is not null;
7. Resetting the filter.
To reset the filter and return to application default, do any of the following:
1. From filter menu, select Reset Filter.
2. Press Ctrl+R
8. Further reading.
For more information about Process Monitor utility, Please check utility‘s help, by clicking the help menu.