trace top sql session


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/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/23757700/viewspace-775536/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值