Skip to Main Content

Breadcrumb

May 4th

Question and Answer

Chris Saxon

Thanks for the question, Rahid.

Asked: August 10, 2020 - 5:13 pm UTC

Last updated: August 11, 2020 - 9:17 am UTC

Version: Oracle DB 12CR2

Viewed 1000+ times

You Asked

Hi dear AskTOM team. Have a great day to everyone. I have some confusion about UPDATE TABLE statement in Oracle DB 12cr2. Let's assume we have 3 users:

U1;
U2;
U3;

U1 has a table called TEST_1, and U2 and U3 both have UPDATE privilege on that table.

My question is that: If U2 and U3 try to update same rows in that particular table at the same time what will happen? How Oracle will control such kind of processes?

Thanks beforehand!

and Chris said...

Only one session at a time can update a row in a table. After the update starts in the first session, the second has to wait for the first to commit or rollback.

For more details on how this works, see:

https://asktom.oracle.com/pls/apex/asktom.search?tag=locks-200802
https://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:2247028425532
https://www.oracle.com/pls/topic/lookup?ctx=dblatest&id=GUID-3D57596F-8B73-4C80-8F4D-79A12F781EFD

Is this answer out of date? If it is, please let us know via a Comment

More to Explore

PL/SQL demos

Check out more PL/SQL tutorials on our LiveSQL tool.

PL/SQL docs

PL/SQL reference manual from the Oracle documentation library