--- TKPROF command ::= 》-- TKPROF traced_file formatted_file ---> | | +- SORT = ---+ | | +-- OPTION --+ | | | +--- , ---+ | | V | | |__( OPTION )__| >---
Tkprofisanexecutablethat'parses'Oracletracefilestoproducemorereadableoutput.RememberthatalltheinformationinTkProfisavailablefromthebasetracefile. Ifyouhaveasystemthatisperformingbadly,agoodwaytoidentifyproblemSQLstatementsistotraceatypicalusersessionandthenuseTkProftoformattheoutputusingthesortfunctionsonthetkprofcommand...
Tcp port: 3306 Unix socket: /var/lib/mysql/mysql.sock Time Id Command Argument # Time: 2881064151 22:05:48 # User@Host: root[root] @ localhost [] # Query_time: 4.396858 Lock_time: 0.000140 Rows_sent: 0 Rows_examined: 53056 use tempdb; SET timestamp=1412431548; insert into tb_slow ...
到user_dump_dest定义的路径下查找刚刚最近生成的trace文件,可以根据时间来排序,找最近的trace文件,也可以根据SID_ORA_SPID.TRC的规则,即ORCL_ORA_14483.TRC找到TRACE文件。 接着使用tkprof工具对此trace文件进行格式化分析,生成分析后的trace文件。 $tkprof orcl_ora_14483.trc allan.txt explain=system/manager aggr...
Otc: Oracle command type 命令的类型 Cr: consistent reads 一致性方式读取的数据块 Pos:执行计划中的位置 Lid: 私有用户id Cu:current 方式读取的数据块 Obj:当前操作的对象id(如果当前行原始一个对象的话) Tim:时间戳 Mis:cursor misss in cache 硬分析次数 Op:当前行源的数据访问操作 ...
PID USERNAME THR PR NCE SIZERESSTATETIME FLTS CPU COMMAND 14483 oracle 1 51 08.8G8.8Gsleep 77.1H 1 5.69% oracle 28222 oracle 1 52 08.8G8.8Gcpu18 93:55 2742 3.32% oracle 3722 oracle 1 59 08.8G8.8Gsleep 157:41 0 0.45% oracle
. a). SQL>select s.USERNAME,s.SID,s.SERIAL#,s.COMMAND from v$session s where s.USERNAME='COLM' ; b). SQL>exec sys.dbms_system.set_sql_trace_in_session(9,7,true); c). SQL>exec sys.dbms_system.set_sql_trace_in_session(9,7,false); ...
SQL>select s.USERNAME,s.SID,s.SERIAL#,s.COMMAND from v$session s where s.USERNAME='ETOH' ; --注意用户名用大写 SQL>exec dbms_system.SET_SQL_TRACE_IN_SESSION(12,73,true); 等待被跟踪session活动一段时间 SQL>exec dbms_system.SET_SQL_TRACE_IN_SESSION(12,73,false); ...
TKPROF is a program that you invoke at the operating system command prompt in order to reformat the trace file into a format that is much easier to comprehend. Each SQL statement is displayed in the report, along with counts of how many times it was parsed, executed, and fetched. CPU tim...
Otc: Oracle command type 命令的类型 Cr: consistent reads 一致性方式读取的数据块 Pos:执行计划中的位置 Lid: 私有用户id Cu:current 方式读取的数据块 Obj:当前操作的对象id(如果当前行原始一个对象的话) Tim:时间戳 Mis:cursor misss in cache 硬分析次数 Op:当前行源的数据访问操作 ...