Thanks for the question, Jeyaram.
Asked: October 23, 2019 - 10:42 am UTC
Answered by: Chris Saxon - Last updated: October 23, 2019 - 4:25 pm UTC
Category: Database Administration - Version: 188.8.131.52.0
Viewed 100+ times
I have a schema with multiple Schema objects like Procedures,Functions,Triggers and Packages.
While testing via application if any DB error occurs we need to check the log to identify errors.
Is there any way to create a single trigger to track database event and if any error occurs in any object it should be inserted into a table.
Ignore if its a stupid question.
and we said...
You're looking for an AFTER SERVERERROR ON DATABASE trigger:
create or replace trigger catch_errors
'An error happened!'
create table t (
insert into t values ( sysdate );
SQL> insert into t values ( sysdate );
An error happened!
insert into t values ( sysdate )
ERROR at line 1:
ORA-00932: inconsistent datatypes: expected NUMBER got DATE
Catch the details you want in the trigger and write it to a table.