How to enable trace in Oracle
How to enable trace in Oracle
1. Enable trace at instance level[@more@]
Put the following line in init.ora. It will enable trace for all sessions and the background
processes
sql_trace = TRUE
to disable trace:
sql_trace = FALSE
- or -
to enable tracing without restarting database run the following command in sqlplus
SQLPLUS> ALTER SYSTEM SET trace_enabled = TRUE;
to stop trace run:
SQLPLUS> ALTER SYSTEM SET trace_enabled = FALSE;
2. Enable trace at session level
to start trace:
ALTER SESSION SET sql_trace = TRUE;
to stop trace:
ALTER SESSION SET sql_trace = FALSE;
- or -
EXECUTE dbms_session.set_sql_trace (TRUE);
EXECUTE dbms_session.set_sql_trace (FALSE);
- or -
EXECUTE dbms_support.start_trace;
EXECUTE dbms_support.stop_trace;
3. Enable trace in another session
Find out SID and SERIAL# from v$session. For example:
SELECT * FROM v$session WHERE osuser = OSUSER;
to start trace:
EXECUTE dbms_support.start_trace_in_session (SID, SERIAL#);
to stop trace:
EXECUTE dbms_support.stop_trace_in_session (SID, SERIAL#);
- or -
EXECUTE dbms_system.set_sql_trace_in_session (SID, SERIAL#, TRUE);
EXECUTE dbms_system.set_sql_trace_in_session (SID, SERIAL#, FALSE);
- or -
-- Oracle 10.1
EXECUTE DBMS_SYSTEM.set_sql_trace_in_session(sid=>SID, serial#=>SERIAL, sql_trace=>TRUE);
EXECUTE DBMS_SYSTEM.set_sql_trace_in_session(sid=>SID, serial#=>SERIAL, sql_trace=>FALSE);
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9907339/viewspace-1047407/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- How to enable the flashback database:Database
- How to read Oracle 10046 trace fileOracle
- How to Check and Enable/Disable Oracle Binary Options (文件 ID 948061.1)Oracle
- [oradebug命令學習3]How to Enable SQL_TRACE for Another Session Using OradebugSQLSession
- Event 10046 - Enable SQL Statement TraceSQL
- How to enable NUMA on 10G @ linuxLinux
- How to Run Statement Level/Java trace or a SQL Trace in Self Service ApplicationJavaSQLAPP
- oracle ENABLE=BROKENOracle
- How To Enable Hidden Administrator Account In Windows 10Windows
- [20221222]How to Enable and Disable Database Options in oracle 11g.txtDatabaseOracle
- How to Run and View a Listener Trace. [ID 147446.1]View
- 使用dbms_monitor.session_trace_enable跟蹤一個會話Session會話
- Oracle session traceOracleSession
- How to enable Hibernate option in windows 2008 R2 server?WindowsServer
- R12 - How To Enable and Collect Debug for HTTP, OC4J and OPMNHTTP
- How to enable Large Page Feature on AIX-Based Systems [ID 372157.1]AI
- Enable Oracle NUMA support with Oracle Server Version 11.2.0.1OracleServer
- Oracle sql trace用法OracleSQL
- Oracle Trace 及TKPROFOracle
- How Oracle Works!Oracle
- How to Study OracleOracle
- how to start '10046 trace name context forever,level 12'Context
- oracle 約束 enable validate 檢查Oracle
- ORACLE TRACE 10046Oracle
- 【TRACE】Oracle跟蹤事件Oracle事件
- oracle trace檔案解析Oracle
- 設定 oracle event traceOracle
- oracle“SQL Trace”簡介OracleSQL
- In Oracle,How to use dumpOracle
- An Example of How Oracle WorksOracle
- How to Get a 10046 trace for a Parallel Query [ID 1102801.1]Parallel
- Oracle ENABLE=broken引數與TCP KeepAliveOracleTCP
- Oracle 10046 SQL TRACEOracleSQL
- oracle trace檔名查詢Oracle
- oracle Database Event trace 設定OracleDatabase
- Oracle HowTo:How to get Oracle SCN?Oracle
- How Oracle Locking WorksOracle
- How to rename an Oracle stored procedureOracle