SQL Performance (MOSC)

MOSC Banner

Sql Statement returning Duplicate Rows some times.

edited Aug 12, 2023 6:50PM in SQL Performance (MOSC) 14 commentsAnswered ✓

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

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center