Diagonose "ORA-04021 timeout waiting to lock object " What's holded the lock ? | Trigger Cant Captu
Hey,
The target is to diagonse and SHOW the developers what's holding the lock on partition when the agregate job loads data.
I just put the trigger to catch session id and sql_id ( after servererror trigger ) but... all errros were logged except "ORA-04021 timeout".
any ideas ?
The Library Cache Tiemout is set to default 15 minutes. ( I reproduced the error )
CREATE OR REPLACE TRIGGER catch_errors
after servererror on database
declare
sql_text ora_name_list_t;
msg_ varchar2(2000) := null;
stmt_ varchar2(2000) := null;
begin
for depth in 1 .. ora_server_error_depth loop
msg_ := msg_ || ora_server_error_msg(depth);
end loop;