RE: Tracing sessions - new sql_trace columns in v$session for 10.2

  • From: "Allen, Brandon" <Brandon.Allen@xxxxxxxxxxx>
  • To: <mgogala@xxxxxxxxxxx>, <Bernard.Polarski@xxxxxxxxxxxxxx>, <oracle-l@xxxxxxxxxxxxx>
  • Date: Wed, 15 Nov 2006 13:26:26 -0700

I figured it out. 

At first, I had the same disappointing results with the new
v$session.sql_trace column in 10.2.0.2 on AIX - as you can see below:


        SQL> execute
dbms_monitor.session_trace_enable(726,147,true,true);

        PL/SQL procedure successfully completed.

        SQL> select distinct sql_trace, sql_trace_waits, sql_trace_binds
from v$session;

        SQL_TRAC SQL_T SQL_T
        -------- ----- -----
        DISABLED FALSE FALSE

However, after I generated some activity in the traced session, then the
ENABLED trace information appeared in v$session:

<In traced session, sid=726>

SQL> select count(*) from t;

  COUNT(*)
----------
         9

<Back in sys session>

SQL> select sid, serial#, sql_trace, sql_trace_waits, sql_trace_binds
from v$session where sql_trace = 'ENABLED';

       SID    SERIAL# SQL_TRAC SQL_T SQL_T
---------- ---------- -------- ----- -----
       726        147 ENABLED  TRUE  TRUE


Also, according to this article
(http://www.oracle.com/technology/pub/articles/10gdba/nanda_10gr2dba_par
t3.html#check), the v$session.sql_trace columns are only populated by
the dbms_monitor.session_trace_enable procedure - not by sql_trace=true,
or event 10046.



Regards,
Brandon



> -----Original Message-----
> From: oracle-l-bounce@xxxxxxxxxxxxx 
> [mailto:oracle-l-bounce@xxxxxxxxxxxxx] On Behalf Of Mladen Gogala
> Sent: Monday, October 30, 2006 7:08 PM

> On 10/30/2006 03:10:09 AM, Polarski, Bernard wrote:
> > I did find thing only in 10gR2, it is not in 10.1.0.4.
> >  
> >  
> 
> Not only is it present only in 10.2.0, it doesn't work. I 
> tried it on Linux, with different methods, from DBMS_MONITOR, 
> set events to set sql_trace, I was always getting the value 
> of 'DISABLED' in SQL_TRACE.
> 

Privileged/Confidential Information may be contained in this message or 
attachments hereto. Please advise immediately if you or your employer do not 
consent to Internet email for messages of this kind. Opinions, conclusions and 
other information in this message that do not relate to the official business 
of this company shall be understood as neither given nor endorsed by it.

--
//www.freelists.org/webpage/oracle-l


Other related posts:

  • » RE: Tracing sessions - new sql_trace columns in v$session for 10.2