How to view the list of locks on Oracle v9-11 database

in #oracle6 years ago

Coding-aeon.png

<p dir="auto">This query will let you easily see the list of locks on database objects for Oracle v9 to 11. <pre><code>select c.owner, c.object_name, c.object_type, b.sid, b.serial#, b.status, b.osuser, b.machine from v$locked_object a , v$session b, dba_objects c where b.sid = a.session_id and a.object_id = c.object_id; <p dir="auto">It has proven really useful when encountering this particular issue that blocks you from performing updates on specific objects in your schema.<br /> Most often this happens on tables and it is caused by other processes performing DML instructions or other routines on specific objects.<br /> It is actually a feature that Oracle uses to protect data integrity, not allowing more than one process to modify exactly the same data simultaneously.<br /> The problem is that sometimes they get stuck because of poorly developed procedures or instructions getting terminated and other issues. <h3>Thank you! Stay tuned for more coding tips, tricks and much more! <p dir="auto"><span><img src="https://images.hive.blog/768x0/https://ipfs.busy.org/ipfs/QmXrxwDmaPUXwpRtTqp6e5FRt3eFxk3673dbAk7pHUEJqg" alt="resh aquasummit.png" srcset="https://images.hive.blog/768x0/https://ipfs.busy.org/ipfs/QmXrxwDmaPUXwpRtTqp6e5FRt3eFxk3673dbAk7pHUEJqg 1x, https://images.hive.blog/1536x0/https://ipfs.busy.org/ipfs/QmXrxwDmaPUXwpRtTqp6e5FRt3eFxk3673dbAk7pHUEJqg 2x" />