Thursday, July 20, 2017

Tracing events

Most things that happen in a database is an 'event'. Oracle lets us trace events.

When development / testing teams are receiving an oracle warning and they dont know where the warning is occuring we can trace it.

 Eg: ORA-29261: bad argument
alter system set events '29261 trace name errorstack level 1';

This will produce a trace file every time the event ORA-29261 happens.

----- Error Stack Dump ----- ORA-29261: bad argument ----- Current SQL Statement for this session (sql_id=cz0fcp412ms20) ----- begin DECLARE l_page VARCHAR2(10); BEGIN IF :P203_NEWCLIENT = 'Y' THEN l_page := '207'; ELSE l_page := '205'; END IF; rsv.rsv_user.send_apex_mail_register(p_user_email => :P203_EMAIL_ADDRESS, p_password => :P203_password, p_from_email => :P203_EMAIL_ADDRESS, p_page_nav => l_page, p_request => 'INITIALISE'); END; end;

Turn off the tracing for the event.

alter system set events '29261 trace name context off';

******************************************
keywords: trace tracing events event
******************************************
rdbms version: 12c
******************************************

No comments: