I want to trace ORA-06550 errors
SQL> alter session set events 'sql_trace';
Session altered.
SQL> select 'foo' from dual;
'FO
---
foo
SQL> exec foo
BEGIN foo; END;
*
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00201: identifier 'FOO' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
SQL> quit
If I look in my trace file, I find no ORA-6550
Trace file /u01/log/oracle/diag/rdbms/db01/DB01/trace/DB01_ora_42860586.trc
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_3
System name: AIX
Node name: srv01
Release: 1
Version: 7
Machine: 00F626FA4C00
Instance name: DB01
Redo thread mounted by this instance: 1
Oracle process number: 38
Unix process pid: 42860586, image: oracle@srv01.example.com (TNS V1-V3)
*** 2015-09-17 13:59:49.109
*** SESSION ID:(358.241) 2015-09-17 13:59:49.109
*** CLIENT ID:() 2015-09-17 13:59:49.109
*** SERVICE NAME:(SYS$USERS) 2015-09-17 13:59:49.109
*** MODULE NAME:(sqlplus@srv01.example.com (TNS V1-V3)) 2015-09-17 13:59:49.109
*** ACTION NAME:() 2015-09-17 13:59:49.109
CLOSE #4573396320:c=6,e=10,dep=0,type=1,tim=49416422688162
=====================
PARSING IN CURSOR #4573391040 len=22 dep=0 uid=0 oct=3 lid=0 tim=49416422690646 hv=3859763380 ad='70000005ae19830' sqlid='cvysbzgm0yn5n'
select 'foo' from dual
END OF STMT
PARSE #4573391040:c=790,e=1312,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=1,plh=1546270724,tim=49416422690645
EXEC #4573391040:c=18,e=31,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=1,plh=1546270724,tim=49416422690748
FETCH #4573391040:c=8,e=13,p=0,cr=0,cu=0,mis=0,r=1,dep=0,og=1,plh=1546270724,tim=49416422690808
STAT #4573391040 id=1 cnt=1 pid=0 pos=1 obj=0 op='FAST DUAL (cr=0 pr=0 pw=0 time=4 us cost=2 size=0 card=1)'
FETCH #4573391040:c=0,e=1,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=0,plh=1546270724,tim=49416422691085
*** 2015-09-17 13:59:57.118
CLOSE #4573391040:c=7,e=12,dep=0,type=0,tim=49416430697630
=====================
PARSING IN CURSOR #4573389592 len=202 dep=1 uid=0 oct=3 lid=0 tim=49416430698685 hv=3819099649 ad='700000066ccf5b8' sqlid='3nkd3g3ju5ph1'
select obj#,type#,ctime,mtime,stime, status, dataobj#, flags, oid$, spare1, spare2 from obj$ where owner#=:1 and name=:2 and namespace=:3 and remoteowner is null and linkname is null and subname is null
END OF STMT
PARSE #4573389592:c=59,e=95,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=4,plh=853875749,tim=49416430698684
EXEC #4573389592:c=32,e=52,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=4,plh=853875749,tim=49416430698837
FETCH #4573389592:c=18,e=31,p=0,cr=2,cu=0,mis=0,r=0,dep=1,og=4,plh=853875749,tim=49416430698888
STAT #4573389592 id=1 cnt=0 pid=0 pos=1 obj=18 op='TABLE ACCESS BY INDEX ROWID OBJ$ (cr=2 pr=0 pw=0 time=37 us cost=3 size=80 card=1)'
STAT #4573389592 id=2 cnt=0 pid=1 pos=1 obj=37 op='INDEX RANGE SCAN I_OBJ2 (cr=2 pr=0 pw=0 time=34 us cost=2 size=0 card=1)'
CLOSE #4573389592:c=1,e=1,dep=1,type=3,tim=49416430698970
*** 2015-09-17 14:00:00.974
XCTEND rlbk=0, rd_only=1, tim=49416434554077
CLOSE #4573391040:c=1,e=6,dep=0,type=0,tim=49416434554235
How is it possible to capture ORA-06550 and underlying exec statements ?
Thanks
Laurent