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
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.
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.
========
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
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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle session traceOracleSession
- SQL TraceSQL
- Oracle 10046 SQL TRACEOracleSQL
- sql_trace相關指令碼SQL指令碼
- Oracle診斷案例-Sql_traceOracleSQL
- 單個SQL語句的10046 traceSQL
- 使用dbms_monitor.session_trace_enable跟蹤一個會話Session會話
- [20220323]完善tpt get_trace.sql指令碼.txtSQL指令碼
- postgresql定位top cpu sqlSQL
- AWR TOP SQL實現SQL
- 使用SQL_TRACE進行資料庫診斷(轉)SQL資料庫
- Oracle檢視歷史TOP SQLOracleSQL
- 批次殺執行某條sql的sessionSQLSession
- Oracle執行語句跟蹤 使用sql trace實現語句追蹤OracleSQL
- [20220120]探究v$session.SQL_EXEC_ID在共享池.txtSessionSQL
- DBMS_TRACE(zt)
- [20230226]探究v$session.SQL_EXEC_ID在共享池(windows).txtSessionSQLWindows
- [AlwaysOn] 建立SQL Server高可用性組T-SQL語法:SESSION_TIMEOUT引數SQLServerSession
- Android Framework: 增加trace點AndroidFramework
- [20230227]探究v$session.SQL_EXEC_ID在共享池(補充).txtSessionSQL
- Chromium Trace and Perfetto使用詳解
- Matrix原始碼分析————Trace Canary原始碼
- session和v$session說明Session
- laravel session 與 php session配置LaravelSessionPHP
- Oracle優化案例-教你線上搞定top cpu的sql(十二)Oracle優化SQL
- SessionSession
- 【遞迴SQL】v$session--X$KSUSE s,X$KSLED e對應情況遞迴SQLSession
- Istio Trace鏈路追蹤方案
- Android Perfetto 系列 2:Perfetto Trace 抓取Android
- 【dubbo3.x trace元件分享】元件
- 從v$diag_info定位trace file
- ADFS – How to enable Trace Debugging and advanced access logging
- Netweaver和CloudFoundry裡的trace開關Cloud
- Finding Trace Files v$diag_info & TKPROF
- debug:am trace-ipc原始碼分析原始碼
- cookie sessionCookieSession
- Session案例Session
- Spring SessionSpringSession
- session switchSession