[oradebug命令學習3]How to Enable SQL_TRACE for Another Session Using Oradebug
How to Enable SQL_TRACE for Another Session or in MTS Using Oradebug [ID 1058210.6]
修改時間:2012-6-12型別:BULLETIN狀態:PUBLISHED優先順序:3
修改時間:2012-6-12型別:BULLETIN狀態:PUBLISHED優先順序:3
***Checked for relevance on 12-Jun-2012***
How to Enable SQL_TRACE for Another Session Using ORADEBUG:
===========================================================
The ORADEBUG utility can enable/disable setting the SQL tracing for another
user's session or an MTS session. To enable tracing for another session, the
Oracle process identifier (PID) or the Operating System processes identifier
(SPID) must be identified from v$process. This is an effective way of capturing
a SQL trace from a process which is already running. The output can be used to
analyze SQL related performance issues.
The ORADEBUG dump produces a trace file in the user_dump_dest that can be
formatted with TKPROF. The ORADEBUG is a utility which is available from
Server Manager line mode (svrmgrl). This utility is available in Oracle
versions 7.3 and up.
NOTE: If using an older version of Oracle (prior to Oracle9), use 'svrmgrl'
instead of SQL*Plus as shown in the examples below.
e.g.
> svrmgrl
SVRMGR> connect internal
Do the following:
1. Obtain the Oracle process identifier or the Operating System process
identifier (SPID) from v$process in a non MTS environment:
> sqlplus /nolog
SQL> connect / as sysdba
SQL> select pid, spid, username from v$process;
PID SPID USERNAME
---- ----- --------
8 25807 oracle
Obtain the Oracle process identifier or the Operating System process
identifier (SPID) from v$process in an MTS environment:
sqlplus /nolog
SQL> connect / as sysdba
SQL> select pid, spid from v$process p, v$shared_server s
2 where p.addr = s.paddr;
PID SPID
---------- ------------
14 6976
2. Attach to the process using ORADEBUG.
Using the Oracle process identifier:
SQL> oradebug setorapid 8
Unix process pid: 25807, image: oracleV804
- or -
Using the Operating System process identifier:
SQL> oradebug setospid 25807
Oracle pid: 8, Unix process pid: 25807, image: oracleV804
3. Turn on SQL Trace for the session.
SQL> oradebug event 10046 trace name context forever, level 12
Statement processed.
4. Get the name and location of the tracefile generated
SQL> oradebug tracefile_name
/opt/oracle/admin/db92/udump/db92_ora_16921.trc
5. Turn off the SQL trace for the session.
SQL> oradebug event 10046 trace name context off
6. Format trace file using TKPROF.
References:
=========== Note 41634.1 - TKPROF and Problem Solving
References
NOTE:310830.1 - How to Use Oradebug to Get Trace File Name and Location來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/23135684/viewspace-748941/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [oradebug命令學習1]Using ORADEBUG Utility
- [oradebug命令學習2]How to Use Oradebug to Get Trace File Name and Location
- [oradebug命令學習4]HANGANALYZE
- Oracle oradebug命令Oracle
- oradebug命令詳解
- oracle之 oradebug 命令用法Oracle
- Oracle oradebug命令詳解Oracle
- How to CANCEL a query running in another session?Session
- Oracle oradebug 命令 使用說明Oracle
- Oracle oradebug命令使用說明Oracle
- ORACLE EVENT && ORADEBUGOracle
- oradebug詳解
- ORADEBUG使用詳解
- oradebug分析oracle hangOracle
- (轉)Oracle EVENT && ORADEBUGOracle
- Oracle Debug ---- oradebugOracle
- ipcs / oradebug ipc / sysresv
- oracle oradebug使用詳解Oracle
- 用oradebug掛起程式
- 使用Oradebug修改Oracle SCNOracle
- oracle實用工具:oradebugOracle
- zt_oradebug詳解
- 使用oradebug掛起程式
- oradebug工具使用系列一
- How to enable the flashback database:Database
- How to enable trace in OracleOracle
- oradebug處理DB hang情況
- 利用oradebug探討控制檔案
- 常用的DUMP語句ORADEBUG語法
- 通過oradebug研究控制檔案(一)
- 在10g中使用oradebug trace工具
- How to Move or Copy a Tablespace to Another Database (61)Database
- zt_使用oradebug dump errorstack 3分析cursor遊標各狀態Error
- 轉貼_Oradebug hanganalyze分析library cache等待
- 使用oradebug dump hanganalyze分析oracle hang系列一Oracle
- 使用oradebug dump hanganalyze 分析oracle hang系列二Oracle
- 使用oradebug dump hanganalyze 分析oracle hang系列三Oracle
- oracle實驗記錄 (使用hanganlyze&oradebug)Oracle