Sql Statement returning Duplicate Rows some times.
Oracle Database Version - 19.17.0.0.0
OS - Oracle Linux Server release 7.9
Query Attached.
We have built a query that should show detailed blocker/waiter session report with object information. However sometimes it returns duplicate rows.
Everything works fine if we exclude below subquery used for blocking object info.
Could you please check and help what is missing here to avoid duplication?
(select distinct o.name blocked_object from obj$ o, v$session z, v$lock l where o.obj#=z.row_wait_obj# and z.sid=l.sid and l.id1=o.obj# and l.type='TM' and z.blocking_session is not null and z.BLOCKING_SESSION_STATUS='VALID')e