Lock oracle records when querying records

Source: Internet
Author: User

The oracle record locking method may not be available to everyone. The following describes how to implement oracle record locking. If you are interested in this, take a look.

Implementation of oracle record lock:

Using the select for update clause

Conn system/manager

-- Create lab user
Grant connect, resource to test identified by test;

Conn test/test

-- Create lab table 1
Create table a (a number );
Insert into a values (1 );
Commit;

Select * from a for update;
Or
Select * from a for update of a. a; column a of table)

-- A New SQL * Plus window is opened.
Conn test/testtest user's second session)
Delete from;

At this point, the system pauses and waits for unlocking,
You can unlock the roll or commit command in the first window.

Introduction to Oracle Process Structure

Learn more about Oracle tablespace

Three phases of Oracle Startup Mode

Oracle conversion functions

Use dynamic SQL for Oracle stored procedures

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.