Professional Documents
Culture Documents
1 de 2
http://dba.stackexchange.com/questions/18569/how-to-troubleshoot-en...
ROW_WAIT_OBJ#
136972
136972
ROW_WAIT_OBJ#
OBJECT_NAME LOCKWAIT
136971
MyTABLEIMAGES_IDPK
ROW_WAIT_OBJ#
137033
136972
ROW_WAIT_OBJ#
OBJECT_NAME
127176
MYTableLOG
SQL_ID
actionmyTableblock r
ID=p_ID;
select v$sql_bind_capture
VALUE_STRING
sql_id
row-lock
wait-types
12/10/2015 10:48
2 de 2
http://dba.stackexchange.com/questions/18569/how-to-troubleshoot-en...
Please help.
oracle
row-lock
wait-types
RolandoMySQLDBA
kupa
88.6k
643
12
99
216
19
39
You've got the sql_id for both. Look in v$sql Phil May 30 '12 at 12:16
@Phil I have sql_id for both but still don't know the exact blocking statement because is contains bind
variables. That are not captured in v$sql_bind_capture.I have added some info in "Additional Info" section in
my post above, please see. kupa May 30 '12 at 16:08
2 Answers
You can avoid row lock contention by making sure that the row is available for update
beforehand with a SELECT FOR UPDATE and either WAIT X or NOWAIT , e.g:
create or replace procedure ACTIONProcedureDELETE (p_ID NUMBER)
is
cursor oldval is select r.id,r.sessionstatus
from MyTABLEIMAGES r where r.idparent=p_ID FOR UPDATE NOWAIT;
l_id NUMBER;
begin
select id into l_id from actionmyTableblock where ID=p_ID
FOR UPDATE of status NOWAIT;
update
actionmyTableblock r
ID=p_ID;
If the row is locked, you will receive an ORA-00054 which is in most cases preferable to
indefinite waiting.
answered May 31 '12 at 12:57
Vincent Malgrat
3,574
Query
v$transaction
15
12/10/2015 10:48