ITPub博客

首页 > Linux操作系统 > Linux操作系统 > trace top sql session

trace top sql session

原创 Linux操作系统 作者:yhj20041128001 时间:2013-11-01 19:40:53 0 删除 编辑

1. How can we find these sessions according these sql id?
The answer is check the view dba_hist_active_sess_history, for example:
select snap_id,dbid,sample_time,session_id,sql_id from dba_hist_active_sess_history where sql_id='gks5t3d6285bw';
2. Could you please provide the v$session output?
conn / as sysdba
set pages 1000
set num 20
alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss';
set mark html on
spool sess.html
select * from v$session;
spool off
exit
 
We have reviewed the screenshot you uploaded.
But we need know the SQL which the report executed, otherwise we even don't know what is the issue.
Action Plan
========
1. First, we need to know the session in the database which was created by the report application.
Please work with your dba to find out the session id.
SQL> select * from v$session; <<<<<< find out the session id.
2. Then we need to get the spid for the session, you can get spid by:
SQL>select spid from v$session a, v$process b where a.paddr=b.addr and a.sid=123;==>change this to the actual sid.
3. Then we can trace the report.
SQL> connect / as sysdba
SQL>oradebug setospid 12345 ==>Please change the 12345 to your actual spid returned by step 2.
SQL>oradebug unlimit
SQL>oradebug event 10046 trace name context forever, level 12
==>Generate the report in your application till it finish.
SQL>oradebug event 10046 trace name context off;
A trace file will be generated under udump.

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

上一篇: 绑定2网卡为bond0
下一篇: 安装mysql
请登录后发表评论 登录
全部评论

注册时间:2010-09-17

  • 博文量
    162
  • 访问量
    354714