Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Powerful tracing...

RE: Powerful tracing...

From: Jacques Kilchoer <Jacques.Kilchoer_at_quest.com>
Date: Tue, 08 Apr 2003 15:43:37 -0800
Message-ID: <F001.0057D7B6.20030408154337@fatcity.com>

> -----Original Message-----
> From: Jose Luis Delgado [mailto:joseluis_delgado_at_yahoo.com]
> 
> How can I trace BIND variables inside an application??

I think someone else has already answered your question, but I will take the liberty of mentioning a few alternatives for tracing sessions (if anyone knows of a different method or any inaccuracies in what I say below, I would be glad to know! This is what I give to developers so I would welcome any corrections)

When you trace the SQL for the database or for a particular session, the trace files will be found in the udump directory aka the user_dump_dest directory. The name of the directory can be found with this query:
select value from v$parameter where name = 'user_dump_dest' ;

For help in reading trace files you can use Oracle's tkprof utility. See Metalink note 41634.1

To turn on tracing for any session, Oracle's "recommended" way is using dbms_support (see Metalink note 62294.1)
--


There are various other ways of turning on tracing. Some of these ways are generic
in that they are used to set an event and so could be used for any event. To see
the list of events, look on a UNIX database server in file $ORACLE_HOME/rdmbs/mesg/oraus.msg .
Setting events should only be done at the direction of Oracle technical support personnel etc etc.

To signal Oracle to perform SQL_TRACE type actions, you should set event 10046. The 10046 trace is the equivalent of setting SQL_TRACE = TRUE. However when setting the event you have in addition the choice of several levels:

1  - Enable standard SQL_TRACE functionality (Default) 
4  - As Level 1 PLUS trace bind values 
8  - As Level 1 PLUS trace waits 
     This is especially useful for spotting latch wait etc.  
     but can also be used to spot full table scans and index scans. 
12 - As Level 1 PLUS both trace bind values and waits

For details of interpreting 10046 output see Metalink note 39817.1

ALTER SESSION / SET SQL_TRACE
Turn on tracing for your own session
--


ALTER SESSION / SET EVENT
Turn on tracing for your own session by setting event 10046
--


DBMS_SYSTEM / SET SQL_TRACE
Turn on tracing for any session (dbms_system is an "undocumented" procedure):
--


DBMS_SYSTEM / SET EVENT
Turn on tracing for any session by setting event 10046  (dbms_system is an "undocumented" procedure, and set_ev even more so):
--


ORADEBUG / SET EVENT
Turn on tracing for any session by setting event 10046
--


SPFILE / ALTER SYSTEM SET SQL_TRACE
Turn on tracing for ALL sessions
note: restart the database for this change to take effect

      sql_trace is a static parameter so scope=spfile is required
--


SPFILE / ALTER SYSTEM SET EVENT
Turn on tracing for ALL sessions by setting event 10046 note: restart the database for this change to take effect

      event is a static parameter so scope=spfile is required
--


INIT.ORA / SQL_TRACE
Turn on tracing for ALL sessions
note: restart the database for this change to take effect
--

INIT.ORA / EVENT
Turn on tracing for ALL sessions by setting event 10046 note: restart the database for this change to take effect
--


--

Please see the official ORACLE-L FAQ: http://www.orafaq.net
--

Author: Jacques Kilchoer
  INET: Jacques.Kilchoer_at_quest.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services

---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Tue Apr 08 2003 - 18:43:37 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US