Oracle Lock table and unlock

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.