Skip to Main Content
  • Questions
  • ORA-06502 exception_dump tracing does not work??

Breadcrumb

Announcement

Free this Wednesday? Looking for some cool tech demos? Come along to our FREE hour of 100% 23ai demo . No slides, no marketing, just all demo.

Question and Answer

Connor McDonald

Thanks for the question, Narendra.

Asked: February 19, 2025 - 11:18 pm UTC

Last updated: February 28, 2025 - 7:22 am UTC

Version: 19.25

Viewed 1000+ times

You Asked

Hello Connor/Chris,

Hope you are doing well.
I came across MOS note ORA-6502 Research Events (Doc ID 2911572.1), which claims to recommend an option to enable trace to get more details about ORA-06502 error.
However, I am not able to reproduce the behaviour on 19.25 and 19.24 databases.
Despite enabling trace as mentioned in MOS note using below command, no trace file is created.

alter session set events '6502 trace name exception_dump forever';

I am using below PL/SQL block to reproduce the ORA-06502 error

declare
  rt NUMBER(1);
begin
  rt := 11;
end;
/


What am I missing?

Thanks in advance

and Connor said...

Perhaps try this

alter session set events '6502 trace name errorstack level 3';

and see if that gets you further.

Rating

  (3 ratings)

Comments

Re: ORA-06502 exception_dump tracing

Narendra, February 24, 2025 - 8:08 am UTC

Hello Connor,

Thank you for your response.
I have tried your suggestion and it does generate the trace file.
However, I could not find the below information in the trace file that looks quite useful in identifying the actual problem. Below has been the example output taken from MOS note ORA-6502 Research Events (Doc ID 2911572.1)

*** 2022-11-25T11:50:59.845388+09:00

--------- PL/SQL Exception Information ------------------

Suberror Message: character string buffer too small

Source Value: "AAA"

Source Length: 3 BYTE

Destination Length: 1 BYTE

----- PL/SQL Call Stack -----

object line object

handle number name

0x6cce8520 4 anonymous block

--------- End of PL/SQL Exception Information ------------------

Connor McDonald
February 25, 2025 - 3:39 am UTC

This worked for me

alter session set events '6502 incident(plsql_error)';

But I did a a full incident for each occurrence, so use wisely

Re: ORA-06502 exception_dump tracing

Narendra, February 25, 2025 - 10:29 pm UTC

Hello Connor,

Thanks for the suggestion.
It does indeed dump a lot of trace in multiple incident files. However, none of those trace files contain the details mentioned in MOS note under "PL/SQL Exception Information" section.
Connor McDonald
February 28, 2025 - 7:22 am UTC

Are you sure? This is what I got from mine (a snippet)

*** 2025-02-25T11:37:17.833152+08:00
*** SESSION ID:(56.61643) 2025-02-25T11:37:17.833152+08:00
*** CLIENT ID:() 2025-02-25T11:37:17.833152+08:00
*** SERVICE NAME:(SYS$USERS) 2025-02-25T11:37:17.833152+08:00
*** MODULE NAME:(sqlplus.exe) 2025-02-25T11:37:17.833152+08:00
*** ACTION NAME:() 2025-02-25T11:37:17.833152+08:00
*** CLIENT DRIVER:(SQL*PLUS) 2025-02-25T11:37:17.833152+08:00
*** CONTAINER ID:(1) 2025-02-25T11:37:17.833152+08:00
*** CLIENT IP:(N/A) 2025-02-25T11:37:17.833152+08:00
*** CONNECTION ID:(4poH7IhvSRasTJvw9Cw2UA==) 2025-02-25T11:37:17.833152+08:00
 
[TOC00000]
Jump to table of contents
Dump continued from file: C:\ORACLE\diag\rdbms\db21\db21\trace\db21_ora_22572.trc
[TOC00001]
ORA-00700: soft internal error, arguments: [EVENT_CREATED_INCIDENT], [6502], [PLSQL_ERROR], [], [], [], [], [], [], [], [], []
ORA-06502: PL/SQL: numeric or value error: number precision too large

[TOC00001-END]
[TOC00002]
========= Dump for incident 1145263 (ORA 700 [EVENT_CREATED_INCIDENT] [6502] [PLSQL_ERROR]) ========

*** 2025-02-25T11:37:17.842707+08:00
dbkedDefDump(): Starting incident default dumps (flags=0x2, level=3, mask=0x0)
[TOC00003]
----- Current SQL Statement for this session (sql_id=3sgs9k0bsu4aj) -----
declare
  rt NUMBER(1);
begin
  rt := 11;
end;
[TOC00004]
----- PL/SQL Stack -----
----- PL/SQL Call Stack -----
  object      line  object
  handle    number  name
00007FF898EA1C50         4  anonymous block
[TOC00004-END]
[TOC00003-END]

[TOC00005]