<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="it">
	<id>http://wiki.netsitech.com/index.php?action=history&amp;feed=atom&amp;title=ORACLE_TRACE</id>
	<title>ORACLE TRACE - Cronologia</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.netsitech.com/index.php?action=history&amp;feed=atom&amp;title=ORACLE_TRACE"/>
	<link rel="alternate" type="text/html" href="http://wiki.netsitech.com/index.php?title=ORACLE_TRACE&amp;action=history"/>
	<updated>2026-05-08T12:04:34Z</updated>
	<subtitle>Cronologia della pagina su questo sito</subtitle>
	<generator>MediaWiki 1.34.4</generator>
	<entry>
		<id>http://wiki.netsitech.com/index.php?title=ORACLE_TRACE&amp;diff=3959&amp;oldid=prev</id>
		<title>Mazzotti: /* Tracing other user's sessions */</title>
		<link rel="alternate" type="text/html" href="http://wiki.netsitech.com/index.php?title=ORACLE_TRACE&amp;diff=3959&amp;oldid=prev"/>
		<updated>2011-11-02T09:31:17Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Tracing other user&amp;#039;s sessions&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;it&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Versione meno recente&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Versione delle 09:31, 2 nov 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l21&quot; &gt;Riga 21:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Riga 21:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Get the SID and SERIAL# for the process you want to trace.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Get the SID and SERIAL# for the process you want to trace.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  SQL&amp;gt; select sid, serial# from sys.v_$session where ...&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  SQL&amp;gt; select &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;service_name, username, &lt;/ins&gt;sid, serial# from sys.v_$session where ...&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         SID    SERIAL#&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         SID    SERIAL# &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;  USERNAME SERVICE_NAME&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  ---------- ----------&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;---------- ---------- --&lt;/ins&gt;-------- ------------&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;           8      13607&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;           8      13607 &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;   xxxxxxx    yyyyyyyyy&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Enable tracing for your selected process:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Enable tracing for your selected process:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Mazzotti</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.netsitech.com/index.php?title=ORACLE_TRACE&amp;diff=3957&amp;oldid=prev</id>
		<title>Mazzotti: Creata pagina con 'This article lists the commands required to '''trace SQL statements''' executed by a user, an application or the entire database.   == Tracing a SQL session ==  === Start ses...'</title>
		<link rel="alternate" type="text/html" href="http://wiki.netsitech.com/index.php?title=ORACLE_TRACE&amp;diff=3957&amp;oldid=prev"/>
		<updated>2011-11-02T09:01:28Z</updated>

		<summary type="html">&lt;p&gt;Creata pagina con &amp;#039;This article lists the commands required to &amp;#039;&amp;#039;&amp;#039;trace &lt;a href=&quot;/index.php?title=SQL&amp;amp;action=tinymceedit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;SQL (la pagina non esiste)&quot;&gt;SQL&lt;/a&gt; statements&amp;#039;&amp;#039;&amp;#039; executed by a user, an application or the entire database.   == Tracing a SQL session ==  === Start ses...&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nuova pagina&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This article lists the commands required to '''trace [[SQL]] statements''' executed by a user, an application or the entire database. &lt;br /&gt;
&lt;br /&gt;
== Tracing a SQL session ==&lt;br /&gt;
&lt;br /&gt;
=== Start session trace ===&lt;br /&gt;
To start a SQL trace for the current session, execute:&lt;br /&gt;
 ALTER SESSION SET sql_trace = true;&lt;br /&gt;
&lt;br /&gt;
You can also add an identifier to the trace file name for later identification:&lt;br /&gt;
&lt;br /&gt;
 ALTER SESSION SET sql_trace = true;&lt;br /&gt;
 ALTER SESSION SET tracefile_identifier = mysqltrace;&lt;br /&gt;
&lt;br /&gt;
=== Stop session trace ===&lt;br /&gt;
To stop SQL tracing for the current session, execute:&lt;br /&gt;
 ALTER SESSION SET sql_trace = false;&lt;br /&gt;
&lt;br /&gt;
=== Tracing other user's sessions ===&lt;br /&gt;
DBA's can use '''DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION''' to trace problematic database sessions. Steps:&lt;br /&gt;
&lt;br /&gt;
* Get the SID and SERIAL# for the process you want to trace.&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; select sid, serial# from sys.v_$session where ...&lt;br /&gt;
        SID    SERIAL#&lt;br /&gt;
 ---------- ----------&lt;br /&gt;
          8      13607&lt;br /&gt;
&lt;br /&gt;
* Enable tracing for your selected process:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; ALTER SYSTEM SET timed_statistics = true;&lt;br /&gt;
 SQL&amp;gt; execute dbms_system.set_sql_trace_in_session(8, 13607, true);&lt;br /&gt;
&lt;br /&gt;
* Ask user to run just the necessary to demonstrate his problem.&lt;br /&gt;
&lt;br /&gt;
* Disable tracing for your selected process:&lt;br /&gt;
&lt;br /&gt;
 SQL&amp;gt; execute dbms_system.set_sql_trace_in_session(8,13607, false);&lt;br /&gt;
&lt;br /&gt;
* Look for trace file in USER_DUMP_DEST:&lt;br /&gt;
&lt;br /&gt;
 $ cd /app/oracle/admin/oradba/udump&lt;br /&gt;
 $ ls -ltr&lt;br /&gt;
 total 8&lt;br /&gt;
 -rw-r-----    1 oracle   dba         2764 Mar 30 12:37 ora_9294.trc&lt;br /&gt;
&lt;br /&gt;
== Tracing an entire database ==&lt;br /&gt;
To enable SQL tracing for the entire database, execute:&lt;br /&gt;
 ALTER SYSTEM SET sql_trace = true SCOPE=MEMORY;&lt;br /&gt;
&lt;br /&gt;
To stop, execute:&lt;br /&gt;
 ALTER SYSTEM SET sql_trace = false SCOPE=MEMORY;&lt;br /&gt;
&lt;br /&gt;
== Identifying trace files ==&lt;br /&gt;
Trace output is written to the database's [[UDUMP]] directory. &lt;br /&gt;
&lt;br /&gt;
The default name for a trace files is INSTANCE_PID_ora_TRACEID.trc where:&lt;br /&gt;
* INSTANCE is the name of the Oracle instance, &lt;br /&gt;
* PID is the operating system process ID (V$PROCESS.OSPID); and&lt;br /&gt;
* TRACEID is a character string of your choosing.&lt;br /&gt;
&lt;br /&gt;
== Size of trace files ==&lt;br /&gt;
&lt;br /&gt;
The trace file size is limited by the parameter MAX_DUMP_FILE_SIZE. The unit of this parameter, if you don't specify the K or M option, is in OS block size. &lt;br /&gt;
&lt;br /&gt;
Be sure this parameter is set to a value high enough for your purpose (e.g. some MB). Of course this depends on the amount and complexitiy of statements which have to be run while  tracing. If this value is set too low, possibly the dump file size limit will be reached before the execution of the crucial statements and the trace file will be closed before the interesting parts can be recorded in it.&lt;br /&gt;
&lt;br /&gt;
On the other hand, when this parameter is set to UNLIMITED (default value), if the program to be traced is working forth and forth and the trace mode is not finished, the trace file can grow without limit which means until the associated file system or disk is full. A DBA can stop the trace of a session using the DBMS_MONITOR (10g and up), DBMS_SYSTEM or DBMS_SUPPORT package.&lt;br /&gt;
&lt;br /&gt;
== Formatting output ==&lt;br /&gt;
Trace output is quite unreadable. However, Oracle provides a utility, called [[TKProf]], that can be used to format trace output.&lt;br /&gt;
&lt;br /&gt;
==Also see==&lt;br /&gt;
* [[TKProf]], Oracle's utility for formatting SQL_TRACE output.&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
* [http://www.ubtools.com/web/public itrprof SQL Analyzer], web based tool which analysing SQL_TRACE and Event 10046 trace files.&lt;br /&gt;
* [http://www.easymatica.com/flextracer FlexTracer], commercial client-side SQL tracer for Oracle.&lt;br /&gt;
* [http://www.queryadvisor.com QueryAdvisor], commercial GUI based client-side SQL tracefile analyzer for Oracle single instance and RAC.&lt;br /&gt;
&lt;br /&gt;
[[Category:SQL_Utility_script]]&lt;br /&gt;
[[Category:ORACLE]]&lt;/div&gt;</summary>
		<author><name>Mazzotti</name></author>
		
	</entry>
</feed>