SELECT * FROM all_tables WHERE table_name = 'DUAL' AND owner != 'SYS'; select * from v$locked_object; ------------- Assuming you have proper privilege.
KriC wrote:Define "it". Is "it" a query that you're running? A tool? Something else? If this is a query, post the query. If this is coming from a tool, tell us what tool and what, exactly, it is saying.
Its showing lock for below query.
SELECT SYSDATE FROM DUALI'm willing to wager that it has nothing to do with any locks. My wager is that you have a query (or a tool) that is telling you that session A holds a lock that session B is blocked waiting on and that session A is currently running (or the last query session A ran) was this SELECT statement. If that's the case, the SELECT statement has nothing to do with the lock that some previous SQL statement run by session A acquired.
Can some one help me to understand how this query can generate lock ?