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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- sql trace有兩種方法在session級進行trace(轉)SQLSession
- Oracle SQL 跟蹤 --- dbms_system.set_sql_trace_in_sessionOracleSQLSession
- dbms_system.set_sql_trace_in_session 無效SQLSession
- Oracle session traceOracleSession
- SQL TraceSQL
- SQL_TRACESQL
- 透過sql查詢獲得當前session的trace檔名稱SQLSession
- 用oracle trace 來跟蹤sessionOracleSession
- Oracle sql trace用法OracleSQL
- SQL Server TRACE FLAGSQLServer
- 【轉】 sql_traceSQL
- 跟蹤session 與 trace檔案分析Session
- 跟蹤SESSION 與 trace 檔案解析Session
- 用oracle trace 來跟蹤session 活動OracleSession
- Microsoft SQL Server Trace FlagsROSSQLServer
- sql_trace的使用SQL
- oracle“SQL Trace”簡介OracleSQL
- 【實驗】【SQL_TRACE】使用sql_trace功能獲得show parameter的sql語句SQL
- sql_trace生成及使用tkprof檢視trace fileSQL
- [oradebug命令學習3]How to Enable SQL_TRACE for Another Session Using OradebugSQLSession
- Oracle 10046 SQL TRACEOracleSQL
- SQL_TRACE與tkprof分析SQL
- 開啟/檢視 sql traceSQL
- sql trace 簡單測試SQL
- sql_trace 及 tkprof 工具SQL
- SQL 的跟蹤方法traceSQL
- How to Run Statement Level/Java trace or a SQL Trace in Self Service ApplicationJavaSQLAPP
- ORACLE TOP SQLOracleSQL
- Top 20 SqlSQL
- 跟蹤SQL - SQL Trace 及 10046 事件SQL事件
- Oracle診斷案例-Sql_traceOracleSQL
- sql_trace相關指令碼SQL指令碼
- sql trace的使用說明一SQL
- sql_trace 原檔案解析SQL
- sql_trace/ 10046 整理SQL
- 跟蹤 sql 的trace檔案SQL
- sql_trace and 10046事件SQL事件
- 利用sql_trace提高自學能力SQL