To prevent users from concurrently accessing and modifying resources at the same time, Oracle uses different types of locks to control concurrent access to data to prevent disruptive interactions between users
1, Lock table
common syntax for locking tables: Lock in <share or share update or exclusive mode>
There are three types of lock table modes:
Sharing modes (in share mode)
Shared update mode (in Share update modes)
Exclusive lock modes (in exclusive mode)
Lock Table instance: // Lock the Trun table in exclusive lock mode Lock in exclusive mode
2. View a table is locked
to view a locked table: Select from where b.object_id = a.object_id
3, querying Sid and Serial#
querying SIDs and serial# Select from where a.session_id = b.sid ORDER by B.logon_time
4, remove lock
To delete a lock table: // of These, 159 is sid;107 for serial# ' 159,107 '
Oracle Lock table and unlock