There are many tables and views in Oracle database that we can get information about with locked objects. You can access a lot of information from the following views.
- DBA_BLOCKERS
- DBA_DDL_LOCKS
- DBA_DML_LOCKS
- DBA_LOCK_INTERNAL
- DBA_LOCKS
- DBA_WAITERS
Find locks in a table:
You can detect locks in a table with the following query.
1 2 3 4 |
SELECT B.Owner, B.Object_Name, A.Oracle_Username, A.OS_User_Name FROM gv$Locked_Object A, All_Objects B WHERE A.Object_ID = B.Object_ID AND B.Object_Name='TABLE_NAME'; |