caodc1
29th July 2004, 04:38
I have a script as below. It was OK before this Monday.
But now every time I ran it, it hung on the "Select" before doing anything.
Do you have any concern?
Thanks in advance.

db.retry.point()

select tdsls045.*, tdsls040.*, tdsls041.*, tccom010.*
from tdsls045 for update, tdsls040, tdsls041, tccom010
where ( tdsls045._index1 = {:orno.1} or
tdsls045._index1 = {:orno.2} or
tdsls045._index1 = {:orno.3} or
tdsls045._index1 = {:orno.4} or
tdsls045._index1 = {:orno.5} or
tdsls045._index1 = {:orno.6} or
tdsls045._index1 = {:orno.7} or
tdsls045._index1 = {:orno.8} or
tdsls045._index1 = {:orno.9} or
tdsls045._index1 = {:orno.10} )
and tdsls045.ssls = :stno.4403
and tdsls045.ddat inrange :ddat.f and :ddat.t
and tdsls045.pino inrange :pino.f and :pino.t
and tdsls045.dqua <> 0
and tdsls045.orno refers to tdsls040 unref skip
and tdsls040.crte inrange :crte.f and :crte.t
and tdsls040.comp inrange :comp.f and :comp.t
and not (tdsls040.bkyn = tcyesno.yes and :blcs = :prog.name$)
and tdsls045.cmba refers to tdsls041 unref skip
and tdsls045.cuno refers to tccom010 unref skip
and tccom010.cnpa <> tccnpa.blocked
order by tdsls045.ssls, tdsls045.cuno, tdsls045.orno,
tdsls045.pono, tdsls045.srnb
with retry
selectdo

Gert Verheyen
29th July 2004, 10:47
Hi,

You might run into an oracle lock (see the 'for update' in the from clause).

I use this oracle query to identify them. Oracle V7
It might help to find the 'locker', so that you can stop that process.

ttitle 'Check Present Locks'
SELECT
OWNER||'.'||OBJECT_NAME "Object",
OS_USER_NAME "Terminal",
ORACLE_USERNAME "Locker",
PROGRAM "Program",
NVL(lockwait,'ACTIVE') "Wait",
DECODE(LOCKED_MODE,
2, 'ROW SHARE',
3, 'ROW EXCLUSIVE',
4, 'SHARE',
5, 'SHARE ROW EXCLUSIVE',
6, 'EXCLUSIVE', 'UNKNOWN') "Lockmode",
OBJECT_TYPE "Object Type",
SESSION_ID "Session ID",
SERIAL# "Serial",
c.SID
FROM
SYS.V_$LOCKED_OBJECT A,
SYS.ALL_OBJECTS B,
SYS.V_$SESSION c
WHERE
A.OBJECT_ID = B.OBJECT_ID AND
C.SID = A.SESSION_ID
ORDER BY 1 ASC, 5 Desc
/

regards,
Gert Verheyen
System development
Duni N.V.

caodc1
29th July 2004, 11:02
I checked this point and didn't find any oracle lock.
I tried to run the session "Reorganize tables". And it became ok for few days.
But the problem occured again. I need to find the root cause.