EventsThis is a featured page

WARNING The misuse of events can cause damages and/or loss of service.
Contact Oracle Support to use events on Production databases.
Be carefulo a mistake on one digit or reversing two numbers can cause tragic consequences.
An event is a
· trace of a specific activity you can enable, to diagnose a problem
· dump information on error or at request
· task you can execute
· feature you can enable
· corruption you want to generate

There is few official information about events to use it, means a lot of investigation, but anyway the results deserves the effort, one example is the event 10053 to capture CBO information, you’ll find information about it digging on internet from people who had made investigation and discovered part of his functionality, or in books, for example you can get more information on the event 10046, from Cary’s book “Optimizing Oracle Performance” than in metalink.

Whenever you can use a supported package, DBMS_MONITOR to enable trace instead of event 10046, for example.

1.A Syntax

To enable an event you execute the command
ALTER [SESSION|SYSTEM] SET EVENTS =
‘(Event Number) TRACE NAME CONTEXT [FOREVER, LEVEL (Level Number) | OFF ]’;
EVENT=”(Event Number) TRACE NAME CONTEXT [FOREVER, LEVEL (Level Number) | OFF ]”

1.B Finding Specific Events

I had created a function table to search on errors messages, events are between 10000 and 10999 error message list.
Here is an example of how to use it.
SELECT CDESC FROM THE ( SELECT CAST(M.FUT_ERRORES(10000,10999) AS M.TYP_ERRORES ) FROM DUAL )
WHERE UPPER(CDESC) LIKE UPPER('%HISTOGRAM%') ;
Event 10129: Alter histogram lookup for remote queries
Event 10169: CBO disable histograms for multi partitions
Event 10190: Analyze use old frequency histogram collection and density
1.B.i Error Trace ALTER [SESSION|SYSTEM] SET EVENTS =
‘(Error Number) TRACE NAME ERROR [STACK LEVEL (level)| OFF ]’;
In parameter file, you can set in the same way 1.B.i.a Hunting Events I’m getting an error and want more information, to debug faster, I want to know if there is a event to know which parameter is the one giving the error, so I enable trace. In this example I’m sending to the parameter c varchar2, a number.
create or replace procedure test_par(a varchar2,b varchar2,
c number, d varchar2,
e varchar2, f varchar2,
g varchar2, h varchar2,
i varchar, j varchar2) is
begin
null;
end;
/
ALTER SESSION SET EVENTS='6502 trace name ERRORSTACK level 1';
SQL> exec test_par('a','b','c','d','e','f','g','h','i','j');
BEGIN test_par('a','b','c','d','e','f','g','h','i','j'); END;
*
ERROR en lÝnea 1:
ORA-06502: PL/SQL: error : error de conversi¾n de carßcter a n·mero numÚrico o de valor
ORA-06512: en lÝnea 1
And I got this information, as you can see this don’t helps too much in finding the problem; unless you learn to interpret this.
Dump file f:\oracle\product\10.2.0\admin\orcl\udump\orcl_ora_2156.trc
Sat Nov 12 18:47:11 2005
ORACLE V10.2.0.1.0 - Production vsnsta=0
vsnsql=14 vsnxtr=3
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Windows XP Version V5.1 Service Pack 2
CPU : 1 - type 586
Process Affinity : 0x00000000
Memory (Avail/Total): Ph:62M/767M, Ph+PgF:1059M/1526M, VA:1723M/2047M
Instance name: orcl

Redo thread mounted by this instance: 1

Oracle process number: 16

Windows thread id: 2156, image: ORACLE.EXE (SHAD)


*** ACTION NAME:() 2005-11-12 18:47:11.038
*** MODULE NAME:(SQL*Plus) 2005-11-12 18:47:11.038
*** SERVICE NAME:(orcl) 2005-11-12 18:47:11.038
*** SESSION ID:(144.7) 2005-11-12 18:47:11.038
*** 2005-11-12 18:47:11.038
ksedmp: internal or fatal error
ORA-06502: PL/SQL: error : error de conversión de carácter a número numérico o de valor
Current SQL statement for this session:
BEGIN test_par('a','b','c','d','e','f','g','h','i','j'); END;
----- PL/SQL Call Stack -----
object line object
handle number name
6CE82490 1 anonymous block
----- Call Stack Trace -----
calling call entry argument values in hex
location type point (? means dubious value)
-------------------- -------- -------------------- ----------------------------
_ksedst+38 CALLrel _ksedst1+0 0 1
_ksedmp+898 CALLrel _ksedst+0 0
_ksddoa+2088 CALLreg 00000000 1
_ksdpcg+238 CALLrel _ksddoa+0 4D00C60 4CD7710
_ksdpec+230 CALLrel _ksdpcg+0 1966 83CCC20 1
__PGOSF89__ksfpec+1 CALLrel _ksdpec+0 1966
18
_kgerev+84 CALLreg 00000000 92CF450 1966
_kgerec1+18 CALLrel _kgerev+0 92CF450 4CD1F64 1966 1
83CCC90
_peirve+462 CALLrel _kgerec1+0
__VInfreq__pevm_CVT CALLrel _peirve+0
CN+22
_pfrinstr_CVTCN+35 CALLrel _pevm_CVTCN+0 4CE7E40 68F68ED8 4CD4440
_pfrrun_no_tool+56 CALL??? 00000000 4CE7E40 68F68C20 4CE7E7C
_pfrrun+781 CALLrel _pfrrun_no_tool+0 4CE7E40 68F68C12 4CE7E7C
_plsql_run+738 CALLrel _pfrrun+0 4CE7E40
_peicnt+247 CALLrel _plsql_run+0 4CE7E40 1 0
_kkxexe+413 CALLrel _peicnt+0
_opiexe+5544 CALLrel _kkxexe+0 4CE7210
_kpoal8+2172 CALLrel _opiexe+0 49 3 83CDB10
_opiodr+1099 CALLreg 00000000 5E 17 83CF6F4
_ttcpip+1273 CALLreg 00000000 5E 17 83CF6F4 0
_opitsk+1017 CALL??? 00000000
_opiino+1087 CALLrel _opitsk+0 0 0
_opiodr+1099 CALLreg 00000000 3C 4 83CFC8C
_opidrv+819 CALLrel _opiodr+0 3C 4 83CFC8C 0
_sou2o+45 CALLrel _opidrv+0 3C 4 83CFC8C
_opimai_real+112 CALLrel _sou2o+0 83CFC80 3C 4 83CFC8C
_opimai+92 CALLrel _opimai_real+0 2 83CFCB8
_OracleThreadStart@ CALLrel _opimai+0
4+708
7C80B508 CALLreg 00000000

--------------------- Binary Stack Dump ---------------------

========== FRAME [1] (_ksedst+38 -> _ksedst1+0) ==========
Dump of memory from 0x083CC9F0 to 0x083CCA00
83CC9F0 083CCA00 0040468B 00000000 00000001 [..<..F@.........]
========== FRAME [2] (_ksedmp+898 -> _ksedst+0) ==========
Dump of memory from 0x083CCA00 to 0x083CCAC0
83CCA00 083CCAC0 00403083 00000000 00000000 [..<..0@.........]
83CCA10 00000000 00000000 00000000 00000000 [................]
Repeat 5 times
………….
So we had to see another chances
I searched for a specific event
1 SELECT CDESC FROM THE ( SELECT CAST(M.FUT_ERRORES(10000,10999) AS M.TYP_ERRORES ) FROM DUAL )
2* WHERE UPPER(CDESC) LIKE UPPER('%PL%SQL%')
SQL> /
CDESC
-----------------------------------------------------------------------------------------------------
Event 10255: pl/sql parse checking
Event 10840: trace / debug pl/sql caching module (kkxmInitCache)

I searched , this took a time but on internet and found the event 10938
Then went to metalink and found
Note:52481.1 PL/SQL Tracing Features Available with PL/SQL 2.3.4 in Oracle 7.3.4,
I did several tests, but I didn’t found useful for my purpose.

So as you can see understand an event takes times, and not always you get what you expect, or you can’t understand all the data generated.


No user avatar
juancarlosreyesp
Latest page update: made by juancarlosreyesp , Sep 30 2008, 9:53 PM EDT (about this update About This Update juancarlosreyesp Edited by juancarlosreyesp

942 words added

view changes

- complete history)
Keyword tags: None
More Info: links to this page
There are no threads for this page.  Be the first to start a new thread.