ITPub博客

首页 > 数据库 > Oracle > SQL Trace - TRACEFILE_IDENTIFIER

SQL Trace - TRACEFILE_IDENTIFIER

原创 Oracle 作者:pan_tian 时间:2014-07-02 13:43:53 0 删除 编辑

sql trace默认生成到user_dump_dest下,这个目录有可能存在很多sql trace,所以要找到你的trace文件有时候要费一些功夫。Oracle提供了一个有用的参数,可以让你快速的找到你的trace文件--TRACEFILE_IDENTIFIER

Oracle SQL Trace收集方法:

1. Set the tracefile identifier as you want, this will be appended to trace file name.
alter session set tracefile_identifier=\'ptian_sql_trace\';

2. Enable your session level tracing
alter session set sql_trace=true;
alter session set events \'10046 trace name context forever, level 12\' ;

3. Execute your queries/statements...

DECLARE
BEGIN
END;


4. Turn-off tracing
alter session set events \'10046 trace name context off\';
alter session set sql_trace=false;

5. Check the user_dump_dest folder, execute linux command: ls *ptian_sql_trace*

and you will find a file name "SID_ora_nnnn_ptian_sql_trace.trc


<!-- Baidu Button BEGIN -->

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/26687597/viewspace-1204224/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 如何收集Concurrent Request的SQL Trace
下一篇: Oracle Events & Level Dictionary
请登录后发表评论 登录
全部评论
暂无介绍

注册时间:2012-02-18

最新文章