ORACEL SET EVENTS 跟踪事件大全
引自:http://blog.myspace.cn/e/401923344.htm
event
Event Reference
Event 10013 - Monitor Transaction Recovery
This event can be used to trace transaction recovery during startup.
For example: ALTER SESSION SET EVENTS '10013 trace name context forever, level 1';
Event 10015 - Dump Undo Segment Headers
This event can be used to dump undo segment headers before and after transaction recovery.
For example: ALTER SESSION SET EVENTS '10015 trace name context forever, level 1';
Event 10032 - Dump Sort Statistics
This event can be used to dump sort statistics. Level 10 is the most detailed.
For example: ALTER SESSION SET EVENTS '10032 trace name context forever, level 10';
Event 10033 - Dump Sort Intermediate Run Statistics
This event can be used to dump sort intermediate run statistics. Level 10 is the most detailed.
For example: ALTER SESSION SET EVENTS '10033 trace name context forever, level 10';
Event 10045 - Trace Free List Management Operations
This event can be used to trace free list management operations.
For example: ALTER SESSION SET EVENTS '10045 trace name context forever, level 1';
Event 10046 - Enable SQL Statement Trace
This event can be used to dump SQL statements executed by a session with execution plans and statistics. Bind variable and wait statistics can optionally be included. Level 12 is the most detailed.
For example: ALTER SESSION SET EVENTS '10046 trace name context forever, level 12';
Levels are: | Action |
0 | Disabled |
1 | Print SQL statements, execution plans and execution statistics. Same as ALTER SESSION SET sql_trace = TRUE |
4 | All level 1 plus bind variables |
8 | All level 1 plus wait statistics |
12 | All level 1 plus bind variables and wait statistics |
Event 10053 - Dump Optimizer Decisions
This event can be used to dump the decisions made by the optimizer when parsing a statement. Level 1 is the most detailed.
For example: ALTER SESSION SET EVENTS '10053 trace name context forever, level 1';
Levels are: | Action |
1 | Print statistics and computations |
2 | Print computations only |
Event 10060 - Dump Predicates
This event can be used to force the optimizer to dump predicates to a table. It is available in Oracle 7.1.3 and above, and was still working in Oracle 9.2.
This event requires the following table to be created in the schema of the user parsing the statement
CREATE TABLE kkoipt_table (c1 INTEGER,c2 VARCHAR2(80));
To enable this event use: ALTER SESSION SET EVENTS '10060 trace name context forever, level 1';
This example uses the following object: CREATE TABLE t1 (c01 NUMBER, c02 NUMBER);
With event 10060 set to level 1, when the following statement is executed for the first time SELECT c01 FROM t1 WHERE c02 = 0;
It is parsed and the results written to kkoipt_table. The results can be selected using the statement: SELECT c1,c2 FROM kkoipt_table ORDER BY c1;
Levels are: | Action |
1 | Table: |
2 | T1 |
3 | frofand |
4 | "T1"."C02"=0 |
The following table summarises the various operations that can be reported by this event
Operation | Description |
fptconst | Folding constants |
fptrnum | Remove ROWNUM predicates |
fptwhr | Remove all WHERE predicates except remaining ROWNUM predicates |
frofkks (rowid lookup) | ROWID lookup |
frofkks[i] (and-equal lookup) | start key |
frofkke[i] (and-equal lookup) | end key |
froiand | index-only predicate |
frofkksm[i] (sort-merge) | sort-merge key |
frosand (sort-merge) | sort-merge predicates |
frojand (sort-merge) | join predicates |
frofkks[i] (index start key) | index start key |
frofkke[i] (index stop key) | index end key |
frofand (hash part) | table predicate (hash) |
froiand (index only filter) | index only predicate |
frofand | table predicate |
froutand | outer join predicates |
Event 10065 - Restrict Library Cache Dump Output for State Object Dumps
The amount of library cache dump output for state object dumps can be limited using event 10065
For example: ALTER SESSION SET EVENTS '10065 trace name context forever, level number';
where number is one of the following
Level no. | Description |
1 | Address of library object only |
2 | As level 1 plus library object lock details |
3 | As level 2 plus library object handle and library object |
Level 3 is the default
Event 10079 - Dump SQL*Net Statistics
This event can be used to SQL*Net statistics. Level 2 is the most detailed.
For example: ALTER SESSION SET EVENTS '10079 trace name context forever, level 2';
Event 10081 - Trace High Water Mark Changes
This event can be used to trace high water mark changes.
For example: ALTER SESSION SET EVENTS '10081 trace name context forever, level 1';
Event 10104 - Dump Hash Join Statistics
This event can be used to hash join statistics. Level 10 is the most detailed.
For example: ALTER SESSION SET EVENTS '10104 trace name context forever, level 10';
Event 10128 - Dump Partition Pruning Information
This event can be used to partition pruning information.
For example: ALTER SESSION SET EVENTS '10128 trace name context forever, level number';
Levels no. are: | Action |
0x0001 | Dump pruning descriptor for each partitioned object |
0x0002 | Dump partition iterators |
0x0004 | Dump optimizer decisions about partition-wise joins |
0x0008 | Dump ROWID range scan pruning information |
There are further levels (up to 4096?). In Oracle 9.0.1 and above, a table must be created before level 2 of this event can be set. The table definition is as follows:
CREATE TABLE kkpap_pruning ( partition_count NUMBER, iterator VARCHAR2(32), partition_level VARCHAR2(32), order_pt VARCHAR2(12), call_time VARCHAR2(12), part# NUMBER, subp# NUMBER, abs# NUMBER );
Event 10200 - Dump Consistent Reads
This event can be used to dump consistent reads.
For example: ALTER SESSION SET EVENTS '10200 trace name context forever, level 1';
Event 10201 - Dump Consistent Read Undo Application
This event can be used to dump consistent read undo application.
For example: ALTER SESSION SET EVENTS '10201 trace name context forever, level 1';
Event 10220 - Dump Changes to Undo Header
This event can be used to dump changes to the undo header (transaction table).
For example: ALTER SESSION SET EVENTS '10220 trace name context forever, level 1';
Event 10221 - Dump Undo Changes
This event can be used to dump undo changes applied. Level 7 is the most detailed.
For example: ALTER SESSION SET EVENTS '10221 trace name context forever, level 7';
Event 10224 - Dump Index Block Splits / Deletes
This event can be used to dump index block splits and deletes detailed.
For example: ALTER SESSION SET EVENTS '10224 trace name context forever, level 1';
Event 10225 - Dump Changes to Dictionary Managed Extents
This event can be used to dump changes to dictionary-managed extents made in the row cache.
For example: ALTER SESSION SET EVENTS '10225 trace name context forever, level 1';
Event 10241 - Dump Remote SQL Execution
This event can be used to dump remotely executed SQL statements.
For example: ALTER SESSION SET EVENTS '10241 trace name context forever, level 1';
Event 10246 - Trace PMON Process
This event can be used to trace the actions of the PMON background process.
This event can only be enabled in the PFILE using: event = "10246 trace name context forever, level 1"
The ALTER SYSTEM command does not appear to work for this event.
There only appears to be one level for this event (levels 5 and 10 appear to generate the same output as level 1)
Event 10248 - Trace Dispatcher Processes
This event can be used to trace dispatcher processes.
This event can be enabled in the PFILE using. event = "10248 trace name context forever, level 10"
In Oracle 9.2 (Windows 2000) the trace is written to a file in udump with the name in the format: ServiceName_dDispatcherNumber_ThreadNumber.trc
For example: JD92001_d000_1234.trc
Valid levels are 1 to 10 (Metalink Note)
Event 10249 - Trace Shared Server (MTS) Processes
This event can be used to trace shared server (MTS) processes.
This event can be enabled in the PFILE using: event = "10249 trace name context forever, level 10"
In Oracle 9.2 (Windows 2000) the trace is written to a file in udump with the name in the format: ServiceName_sSharedServerNumber_ThreadNumber.trc
For example: JD92001_s000_5678.trc Valid levels are 1 to 10 (Metalink Note)
Event 10270 - Debug Shared Cursors
This event can be used to enable debugging code in shared cursor management modules.
For example: event = "10270 trace name context forever, level 10"
Event 10299 - Debug Prefetching
This event can be used to enable debugging code for table and index block prefetching. It also enables dumping of trace by the CKPT process.
For example: event = "10299 trace name context forever, level 1"
Event 10357 - Debug Direct Path
This event can be used to enable debugging code for direct path.
For example: ALTER SESSION SET EVENTS '10357 trace name context forever, level 1';
Event 10390 - Dump Parallel Execution Slave Statistics
This event can be used to dump parallel slave statistics.
For example: ALTER SESSION SET EVENTS '10390 trace name context forever, level number';
Level No. | Action |
0x0001 | Slave-side execution messages |
0x0002 | Coordinator-side execution messages |
0x0004 | Slave context state changes |
0x0008 | Slave ROWID range bind variables and xty |
0x0010 | Slave fetched rows as enqueued to TQ |
0x0020 | Coordinator wait reply handling |
0x0040 | Coordinator wait message buffering |
0x0080 | Slave dump timing |
0x0100 | Coordinator dump timing |
0x0200 | Slave dump allocation file number |
0x0400 | Terse format for debug dumps |
0x0800 | Trace CRI random sampling |
0x1000 | Trace signals |
0x2000 | Trace parallel execution granule operations |
0x4000 | Force compilation by slave 0 |
Event 10391 - Dump Parallel Execution Granule Allocation
This event can be used to dump parallel granule allocation / assignment statistics.
For example: ALTER SESSION SET EVENTS '10391 trace name context forever, level number';
Level No. | Action |
0x0001 | Dump summary of each object scanned in parallel |
0x0002 | Full dump of each object except extent map |
0x0004 | Full dump of each object including extent map |
0x0010 | Dump summary of each granule generators |
0x0020 | Full dump of granule generators except granule instances |
0x0040 | Full dump of granule generators including granule instances |
0x0080 | Dump system information |
0x0100 | Dump reference object for the query |
0x0200 | Gives timing in kxfralo |
0x0400 | Trace affinity module |
0x0800 | Trace granule allocation during query execution |
0x1000 | Trace object flush |
0x2000 | Unknown |
Event 10393 - Dump Parallel Execution Statistics
This event can be used to dump kxfp statistics after each parallel query.
For example: ALTER SESSION SET EVENTS '10393 trace name context forever, level 1';
Note that in Oracle 9.2 for parallel execution trace is written to files with names of the format: ServiceName_pServerNumber_ThreadNumber.trc
Below is example output for this event.
kxfpdst dumping statistics --------------------------- Query Sessions 1 Total Messages Sent 0 Data Messages Sent 948 Stream Messages Sent 917 Dialog Messages Sent 26 Null Messages Sent 0 Fast Shared Memory Streams 669 Fast Distributed Stream 0 Stream Mode Credit Ping 0 Unknown Credit Pings 0 Single Credit Pings 252 Double Credit Pings 0 Triple Credit Pings 0 Multiple Credit Pings 0 Total Messages Dequeued 0 Data Messages Dequeued 31 Null Messages Dequeued 0 Immediate Dequeues 1 Posted Dequeues 31 Timed-out Dequeues 0 Implicit Dequeues 255 Total Dequeue Waits 85 Total Dequeue Timeouts 44 Dequeues for Credit (geb) 77 Dequeues for Credit (free) 0 Dequeues for Credit (enq) 39
Event 10500 - Trace SMON Process
This event can be used to trace the actions of the SMON background process.
This event can be enabled in the PFILE using: event = "10500 trace name context forever, level 1"
Event 10608 - Trace Bitmap Index Creation
This event traces bitmap index creation.
For example: ALTER SESSION SET EVENTS '10608 trace name context forever, level 10';
Event 10704 - Trace Enqueues
This event dumps information about which enqueues are being obtained. When enabled it prints out arguments to calls to ksqcmi and ksqlrl and the return values.
For example: ALTER SESSION SET EVENTS '10704 trace name context forever, level 1';
Event 10706 - Trace Global Enqueue Manipulation
This event allows RAC global enqueue manipulation to be trace.
For example: ALTER SESSION SET EVENTS '10706 trace name context forever, level 1';
The amount of output can be limited using the unsupported parameter '_ksi_trace'. This parameter specifies the lock types that should be included e.g. TM, TX etc.
They are specified as a string e.g. 'TMTX'. The parameter '_ksi_trace' can only be set in the PFILE.
Event 10708 - Trace RAC Buffer Cache
This event allows RAC buffer cache activity to be traced.
For example: ALTER SESSION SET EVENTS '10708 trace name context forever, level 10';
This diagnostic applies only to RAC clusters (not single-instance)
Event 10710 - Trace Bitmap Index Access
This event traces bitmap index access. It displays the start ROWID and end ROWID of each bitmap.
For example: ALTER SESSION SET EVENTS '10710 trace name context forever, level 1';
Event 10711 - Trace Bitmap Index Merge Operation
This event traces the bitmap index merge operation.
For example: ALTER SESSION SET EVENTS '10711 trace name context forever, level 1';
Event 10712 - Trace Bitmap Index OR Operation
This event traces the bitmap index OR operation.
For example: ALTER SESSION SET EVENTS '10712 trace name context forever, level 1';
Event 10713 - Trace Bitmap Index AND Operation
This event traces the bitmap index AND operation.
For example: ALTER SESSION SET EVENTS '10713 trace name context forever, level 1';
Event 10714 - Trace Bitmap Index MINUS Operation
This event traces the bitmap index MINUS operation.
For example: ALTER SESSION SET EVENTS '10714 trace name context forever, level 1';
Event 10715 - Trace Bitmap Index Conversion to ROWIDs Operation
This event traces the bitmap index conversion to ROWIDs operation.
For example: ALTER SESSION SET EVENTS '10715 trace name context forever, level 1';
Event 10716 - Trace Bitmap Index Compress/Decompress
This event traces the bitmap index compress/decompress.
For example: ALTER SESSION SET EVENTS '10716 trace name context forever, level 1';
Event 10717 - Trace Bitmap Index Compaction
This event traces the bitmap index compaction.
For example: ALTER SESSION SET EVENTS '10717 trace name context forever, level 1';
Event 10719 - Trace Bitmap Index DML
This event traces the bitmap index DML.
For example: ALTER SESSION SET EVENTS '10719 trace name context forever, level 1';
Event 10730 - Trace Fine Grained Access Predicates
This event traces find grained access (RLS) predicates.
For example: ALTER SESSION SET EVENTS '10730 trace name context forever, level 1';
Event 10731 - Trace CURSOR Statements
This event traces CURSOR statements.
For example: ALTER SESSION SET EVENTS '10731 trace name context forever, level number';
Levels no. are: | Action |
1 | Print parent query and subquery |
2 | Print subquery only |
Event 10928 - Trace PL/SQL Execution
This event traces PL/SQL execution.
For example: ALTER SESSION SET EVENTS '10928 trace name context forever, level 1';
Event 10938 - Dump PL/SQL Execution Statistics
This event dumps PL/SQL execution statistics..
For example: ALTER SESSION SET EVENTS '10938 trace name context forever, level 1';
This event currently generates the following output
--NOTICE --------------------------------------- --PL/SQL TRACE INFORMATION IS NOW IN THE DATABASE-- To create the trace tables, use the script. ---- rdbms/admin/tracetab.sql under ORACLE_HOME --
###################
一、Oracle跟踪文件
Oracle跟踪文件分为三种类型,一种是后台报警日志文件,记录数据库在启动、关闭和运行期间后台进程的活动情况,如表空间创建、回滚段创建、某些alter命令、日志切换、错误消息等。在数据库出现故障时,应首先查看该文件,但文件中的信息与任何错误状态没有必然的联系。后台报警日志文件保存BACKGROUND_DUMP_DEST参数指定的目录中,文件格式为SIDALRT.LOG。另一种类型是DBWR、LGWR、SMON等后台进程创建的后台跟踪文件。后台跟踪文件根据后台进程运行情况产生,后台跟踪文件也保存在BACKGROUND_DUMP_DEST参数指定的目录中,文件格式为siddbwr.trc、sidsmon.trc等。还有一种类型是由连接到Oracle的用户进程(Server Processes)生成的用户跟踪文件。这些文件仅在用户会话期间遇到错误时产生。此外,用户可以通过执行oracle跟踪事件(见后面)来生成该类文件,用户跟踪文件保存在USER_DUMP_DEST参数指定的目录中,文件格式为oraxxxxx.trc,xxxxx为创建文件的进程号(或线程号)。
二、Oracle跟踪事件
Oracle提供了一类命令,可以将Oracle各类内部结构中所包含的信息转储(dump)到跟踪文件中,以便用户能根据文件内容来解决各种故障。设置跟踪事件有两种方法,一种是在init.ora文件中设置事件,这样open数据库后,将影响到所有的会话。设置格式如下:
EVENT="eventnumber trace name eventname [forever,] [level levelnumber] : ......."
通过:符号,可以连续设置多个事件,也可以通过连续使用event来设置多个事件。
另一种方法是在会话过程中使用alter session set events命令,只对当前会话有影响。设置格式如下:
alter session set events '[eventnumber|immediate] trace name eventname [forever] [, level levelnumber] : .......'
通过:符号,可以连续设置多个事件,也可以通过连续使用alter session set events 来设置多个事件。
格式说明:eventnumber指触发dump的事件号,事件号可以是Oracle错误号(出现相应错误时跟踪指定的事件)或oralce内部事件号,内部事件号在10000到10999之间,不能与immediate关键字同用。
immediate关键字表示命令发出后,立即将指定的结构dump到跟踪文件中,这个关键字只用在alter session语句中,并且不能与 eventnumber、forever关键字同用。
trace name 是关键字。
eventname指事件名称(见后面),即要进行dump的实际结构名。若eventname为context,则指根据内部事件号进行跟踪。
forever关键字表示事件在实例或会话的周期内保持有效状态,不能与immediate同用。
level为事件级别关键字。但在dump错误栈(errorstack)时不存在级别。
levelnumber表示事件级别号,一般从1到10,1表示只dump结构头部信息,10表示dump结构的所有信息。
1、buffers事件:dump SGA缓冲区中的db buffer结构
alter session set events 'immediate trace name buffers level 1'; --表示dump缓冲区的头部。
2、blockdump事件:dump数据文件、索引文件、回滚段文件结构
alter session set events 'immediate trace name blockdump level 66666'; --表示dump块地址为6666的数据块。
在Oracle 8以后该命令已改为:
alter system dump datafile 11 block 9; --表示dump数据文件号为11中的第9个数据块。
3、controlf事件:dump控制文件结构
alter session set events 'immediate trace name controlf level 10'; --表示dump控制文件的所有内容。
4、locks事件:dump LCK进程的锁信息
alter session set events 'immediate trace name locks level 5';
5、redohdr事件:dump redo日志的头部信息
alter session set events 'immediate trace name redohdr level 1'; --表示dump redo日志头部的控制文件项。
alter session set events 'immediate trace name redohdr level 2'; --表示dump redo日志的通用文件头。
alter session set events 'immediate trace name redohdr level 10'; --表示dump redo日志的完整文件头。
注意:redo日志的内容dump可以采用下面的语句:
alter system dump logfile 'logfilename';
6、loghist事件:dump控制文件中的日志历史项
alter session set events 'immediate trace name loghist level 1'; --表示只dump最早和最迟的日志历史项。
levelnumber大于等于2时,表示2的levelnumber次方个日志历史项。
alter session set events 'immediate trace name loghist level 4'; --表示dump 16个日志历史项。
7、file_hdrs事件:dump 所有数据文件的头部信息
alter session set events 'immediate trace name file_hdrs level 1'; --表示dump 所有数据文件头部的控制文件项。
alter session set events 'immediate trace name file_hdrs level 2'; --表示dump 所有数据文件的通用文件头。
alter session set events 'immediate trace name file_hdrs level 10'; --表示dump 所有数据文件的完整文件头。
8、errorstack事件:dump 错误栈信息,通常Oracle发生错误时前台进程将得到一条错误信息,但某些情况下得不到错误信息,可以采用这种方式得到Oracle错误。
alter session set events '604 trace name errorstack forever'; --表示当出现604错误时,dump 错误栈和进程栈。
9、systemstate事件:dump所有系统状态和进程状态
alter session set events 'immediate trace name systemstate level 10'; --表示dump 所有系统状态和进程状态。
10、coalesec事件:dump指定表空间中的自由区间
levelnumber以十六进制表示时,两个高位字节表示自由区间数目,两个低位字节表示表空间号,如0x00050000表示dump系统表空间中的5个自由区间,转换成十进制就是327680,即:
alter session set events 'immediate trace name coalesec level 327680';
11、processsate事件:dump进程状态
alter session set events 'immediate trace name processsate level 10';
12、library_cache事件:dump library cache信息
alter session set events 'immediate trace name library_cache level 10';
13、heapdump事件:dump PGA、SGA、UGA中的信息
alter session set events 'immediate trace name heapdump level 1';
14、row_cache事件:dump数据字典缓冲区中的信息
alter session set events 'immediate trace name row_cache level 1';
三、内部事件号
1、10013:用于监视事务恢复
2、10015:转储UNDO SEGMENT头部
event = "10015 trace name context forever"
3、10029:用于给出会话期间的登陆信息
4、10030:用于给出会话期间的注销信息
5、10032:转储排序的统计信息
6、10033:转储排序增长的统计信息
7、10045:跟踪Freelist管理操作
8、10046:跟踪SQL语句
alter session set events '10046 trace name context forever, level 4'; --跟踪SQL语句并显示绑定变量
alter session set events '10046 trace name context forever, level 8'; --跟踪SQL语句并显示等待事件
9、10053:转储优化策略
10、10059:模拟redo日志中的创建和清除错误
11、10061:阻止SMON进程在启动时清除临时段
12、10079:转储 SQL*NET统计信息
13、10081:转储高水标记变化
14、10104:转储Hash连接统计信息
15、10128:转储分区休整信息
16、10200:转储一致性读信息
17、10201:转储一致性读中Undo应用
18、10209:允许在控制文件中模拟错误
19、10210:触发数据块检查事件
event = "10210 trace name context forever, level 10"
20、10211:触发索引检查事件
21、10213:模拟在写控制文件后崩溃
22、10214:模拟在控制文件中的写错误
levelnumber从1-9表示产生错误的块号,大于等于10则每个控制文件将出错
23、10215:模拟在控制文件中的读错误
24、10220:转储Undo头部变化
25、10221;转储Undo变化
26、10224:转储索引的分隔与删除
27、10225:转储基于字典管理的区间的变化
28、10229:模拟在数据文件上的I/O错误
29、10231:设置在全表扫描时忽略损坏的数据块
alter session set events '10231 trace name context off'; -- 关闭会话期间的数据块检查
event = "10231 trace name context forever, level 10" -- 对任何进程读入SGA的数据块进行检查
30、10232:将设置为软损坏(DBMS_REPAIR包设置或DB_BLOCK_CHECKING为TRUE时设置)的数据块dump到跟踪文件
31、10235:用于内存堆检查
alter session set events '10235 trace name context forever, level 1';
32、10241:转储远程SQL执行
33、10246:跟踪PMON进程
34、10248:跟踪dispatch进程
35、10249:跟踪MTS进程
36、10252:模拟写数据文件头部错误
37、10253:模拟写redo日志文件错误
38、10262:允许连接时存在内存泄漏
alter session set events '10262 trace name context forever, level 300'; -- 允许存在300个字节的内存泄漏
39、10270:转储共享游标
40、10285:模拟控制文件头部损坏
41、10286:模拟控制文件打开错误
42、10287:模拟归档出错
43、10357:调试直接路径机制
44、10500:跟踪SMON进程
45、10608:跟踪位图索引的创建
46、10704:跟踪enqueues
47、10706:跟踪全局enqueues
48、10708:跟踪RAC的buffer cache
49、10710:跟踪对位图索引的访问
50、10711:跟踪位图索引合并操作
51、10712:跟踪位图索引OR操作
52、10713:跟踪位图索引AND操作
53、10714:跟踪位图索引MINUS操作
54、10715:跟踪位图索引向ROWID的转化
55、10716:跟踪位图索引的压缩与解压
56、10719:跟踪位图索引的修改
57、10731:跟踪游标声明
58、10928:跟踪PL/SQL执行
59、10938:转储PL/SQL执行统计信息
最后要说明的是,由于版本不同以上语法可能有些变化,但大多数还是可用的。
附完整的跟踪事件列表,event No.10000 to 10999
SET SERVEROUTPUT ON
DECLARE
err_msg VARCHAR2(120);
BEGIN
dbms_output.enable (1000000);
FOR err_num IN 10000..10999
LOOP
err_msg := SQLERRM (-err_num);
IF err_msg NOT LIKE '%Message '||err_num||' not found%' THEN
dbms_output.put_line (err_msg);
END IF;
END LOOP;
END;
/
1.select sid,serial#,username,osuser,machine from v$session;查询session的sid,serial#
2.exec dbms_system.set_sql_trace_in_session(141,6,true);开始跟踪
3.exec dbms_system.set_sql_trace_in_session(141,6,true) 停止跟踪
4.tkprof *.trc *.txt
1.select sid,serial#,username,osuser,machine from v$session;查询session的sid,serial#
2.exec dbms_system.set_sql_trace_in_session(141,6,true);开始跟踪
3.exec dbms_system.set_sql_trace_in_session(141,6,true) 停止跟踪
4.tkprof *.trc *.txt
5.查看文件
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/276487/viewspace-673228/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/276487/viewspace-673228/