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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ADFS – How to enable Trace Debugging and advanced access logging
- [20221222]How to Enable and Disable Database Options in oracle 11g.txtDatabaseOracle
- How to enable Traefik Dashborad in K3s
- oracle ENABLE=BROKENOracle
- Oracle session traceOracleSession
- Oracle 10046 SQL TRACEOracleSQL
- 使用dbms_monitor.session_trace_enable跟蹤一個會話Session會話
- Oracle ENABLE=broken引數與TCP KeepAliveOracleTCP
- Oracle診斷案例-Sql_traceOracleSQL
- How Oracle Store Number internal(zt)Oracle
- How to Install EMC PowerPath on Oracle VM 3.4Oracle
- Oracle清理trace、alert、aud、listener.log檔案Oracle
- oracle清理trace、alert、aud、listener等日誌檔案Oracle
- How To Deal With Split Brain In Oracle 19c RacAIOracle
- Oracle 12.2 How to Generate AWRs in Active Data Guard Standby DatabasesOracleDatabase
- 運用Log和Trace檔案排除Oracle Net問題Oracle
- How To Deal With Split Brain In Oracle 19c Rac-202203AIOracle
- How To Replicate Data from Oracle to Postgres Using GoldenGate (Doc ID 1544137.1OracleGo
- oracle ebs 根據請求id找到對應trace 檔案Oracle
- Oracle 12c後enable_ddl_logging的日誌位置變化Oracle
- SQL TraceSQL
- 【TRACE】如何設定或動態跟蹤Oracle net偵聽器Oracle
- enable_index_filterIndexFilter
- FSM:Enable shift register
- oracle 資料庫lsnrctl監聽的日誌路徑和trace檔案Oracle資料庫
- Oracle執行語句跟蹤 使用sql trace實現語句追蹤OracleSQL
- DBMS_TRACE(zt)
- How to ssh
- Spring中Enable*功能的使用Spring
- Android Framework: 增加trace點AndroidFramework
- How to find dependency
- RuntimeWarning: Enable tracemalloc to get the object allocation tracebackObject
- SpringBoot開發自己的@Enable功能Spring Boot
- Chromium Trace and Perfetto使用詳解
- Matrix原始碼分析————Trace Canary原始碼
- [譯] WebAssembly: How and whyWeb
- How OpenStack integrates with Ceph?
- How to Build a Cybersecurity CareerUI
- CISO之What & How