Home » SQL & PL/SQL » SQL & PL/SQL » Table Lock (Oracle 11g)
Table Lock [message #642057] Tue, 01 September 2015 07:24 Go to next message
stsivaraj
Messages: 1
Registered: September 2015
Location: Chennai
Junior Member
Hi,
I have a table Devices and am trying to insert 1000 records at a time using a single transaction. Suppose If I have 5 transaction and each transaction has 1000 records to insert. In this case, will all transaction will insert parallel or wait for each other to complete. My doubt is for each transaction acquire the table lock or row lock. Will it insert parallel mode or wait one transaction release other transaction.
Re: Table Lock [message #642058 is a reply to message #642057] Tue, 01 September 2015 07:29 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
Why don't you just try it?
You do have a test system to try these things on don't you?
Re: Table Lock [message #642059 is a reply to message #642057] Tue, 01 September 2015 07:40 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
stsivaraj wrote on Tue, 01 September 2015 05:24
Hi,
I have a table Devices and am trying to insert 1000 records at a time using a single transaction. Suppose If I have 5 transaction and each transaction has 1000 records to insert. In this case, will all transaction will insert parallel or wait for each other to complete. My doubt is for each transaction acquire the table lock or row lock. Will it insert parallel mode or wait one transaction release other transaction.


Welcome to this forum.

Please read and follow the forum guidelines, to enable us to help you:
OraFAQ Forum Guide
How to use {code} tags and make your code easier to read

Re: Table Lock [message #642060 is a reply to message #642057] Tue, 01 September 2015 07:54 Go to previous messageGo to next message
Michel Cadot
Messages: 68645
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Oracle does not use table lock on DML, only row locks.
have a look at Database Concepts.

Re: Table Lock [message #642145 is a reply to message #642057] Thu, 03 September 2015 21:02 Go to previous messageGo to next message
shirleyhu
Messages: 4
Registered: August 2015
Location: AUSTRALIA
Junior Member
It depend on table structure for the locks . If there is primary key or unique index, row lock contention will be there to check the unique .Otherwise it just row lock .
Re: Table Lock [message #642151 is a reply to message #642145] Fri, 04 September 2015 00:53 Go to previous message
Michel Cadot
Messages: 68645
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

This does not anything, locks in index is also a row (or key) lock.

Quote:
It depend on table structure for the locks


This is meaningless.
What is "table structure for the locks"? Something you made up?

Previous Topic: to derive previous dates and ignore first date
Next Topic: ora-00900 invalid sql statement while using open cursor for variable
Goto Forum:
  


Current Time: Fri Apr 26 10:36:49 CDT 2024