SQL> alter session set sql_trace=true 2 ; SQL> select * from emp; 然后在user_dump_dest目录中找到生成的trace文件 dos下执行:tkprof ora11_ora_1960.trc 11.txt11.txt中的内容:TKPROF: Release 11.1.0.6.0 - Production on 星期三 5月 28 23:52:59 2008Copyright (c) 1982, 2007, Oracle. All rights reserved.Trace file: ora11_ora_1960.trc Sort options: default******************************************************************************** count = number of times OCI procedure was executed cpu = cpu time in seconds executing elapsed = elapsed time in seconds executing disk = number of physical reads of buffers from disk query = number of buffers gotten for consistent read current = number of buffers gotten in current mode (usually for update) rows = number of rows processed by the fetch or execute call ******************************************************************************** .....********************************************************************************SQL ID : a2dk8bdn0ujx7 select * from emp call count cpu elapsed disk query current rows ------- ------ -------- ---------- ---------- ---------- ---------- ---------- Parse 1 0.00 0.01 0 0 0 0 Execute 1 0.00 0.00 0 0 0 0 Fetch 2 0.00 0.00 0 8 0 14 ------- ------ -------- ---------- ---------- ---------- ---------- ---------- total 4 0.00 0.01 0 8 0 14Misses in library cache during parse: 1 Optimizer mode: ALL_ROWS Parsing user id: 81 Rows Row Source Operation ------- --------------------------------------------------- 14 TABLE ACCESS FULL EMP (cr=8 pr=0 pw=0 time=0 us cost=3 size=518 card=14)********************************************************************************
2 ;
SQL> select * from emp;
然后在user_dump_dest目录中找到生成的trace文件
dos下执行:tkprof ora11_ora_1960.trc 11.txt11.txt中的内容:TKPROF: Release 11.1.0.6.0 - Production on 星期三 5月 28 23:52:59 2008Copyright (c) 1982, 2007, Oracle. All rights reserved.Trace file: ora11_ora_1960.trc
Sort options: default********************************************************************************
count = number of times OCI procedure was executed
cpu = cpu time in seconds executing
elapsed = elapsed time in seconds executing
disk = number of physical reads of buffers from disk
query = number of buffers gotten for consistent read
current = number of buffers gotten in current mode (usually for update)
rows = number of rows processed by the fetch or execute call
********************************************************************************
.....********************************************************************************SQL ID : a2dk8bdn0ujx7
select *
from
emp
call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.01 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 2 0.00 0.00 0 8 0 14
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 4 0.00 0.01 0 8 0 14Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 81 Rows Row Source Operation
------- ---------------------------------------------------
14 TABLE ACCESS FULL EMP (cr=8 pr=0 pw=0 time=0 us cost=3 size=518 card=14)********************************************************************************
dos下执行:tkprof ora11_ora_1960.trc 11.txt trace我找到了就是根据时间取的最近的哪个文件但是DOS下执行 我就不是很清楚能稍微详细一点么??
还要输入一个OUTPUT我就随便写了一个 11.TXT