Home » SQL & PL/SQL » SQL & PL/SQL » Logging events
Logging events [message #18880] Tue, 19 February 2002 22:33 Go to next message
Rm69
Messages: 39
Registered: January 2002
Member
Have a trigger that logs database errors.
If one has to modify this script so that it logs errors including the errors from specific tables how would l achieve this? ie table a,b and c or maybe this trigger has to be on all three tables?
l also want to log procedure events has it been suceesful or it failed and at what point?

/** Log all database errors **/

Create or Replace trigger Mis_log_errors_trig
after servererror on database
declare
var_user varchar2(30);
var_osuser varchar2(30);
var_machine varchar2(64);
var_process varchar2(8);
var_program varchar2(48);
begin
select username, osuser, machine, process, program
into var_user, var_osuser, var_machine, var_process, var_program
from sys.v_$session
where audsid = userenv('sessionid');

insert into mis_log_errors_tab
values(dbms_standard.server_error(1),sysdate,var_user,
var_osuser,var_machine,var_process,var_program);
end;
Re: Logging events [message #18885 is a reply to message #18880] Wed, 20 February 2002 00:34 Go to previous message
pratap kumar tripathy
Messages: 660
Registered: January 2002
Senior Member
better use database audit for that
Previous Topic: count and sum from different tables
Next Topic: striping
Goto Forum:
  


Current Time: Fri Sep 24 04:35:41 CDT 2021