[askdba] Re: [dba_gurus] share and exclusive lock mode

  • From: Nisar Tareen <ntareen@xxxxxxxxx>
  • To: farrukh sohail <farrukh_sohail31@xxxxxxxxx>, oracle-dba-masters@xxxxxxxxxxxxxxx
  • Date: Sun, 22 May 2005 10:45:19 -0700 (PDT)

Automatic Locking
Oracle's automatically locks table data at the row level to minimize data 
contention. Oracle doesn't ever escalate row locks to block or table locks. 

Oracle may maintain several different types of row lock:

Exclusive lock mode - Prevents the resource from being shared. This lock mode 
is obtained to modify data. Only one exclusive lock can be placed on a resource 
(such as a row or a table).

Share lock mode - Allows the resource to be shared, depending on the operations 
involved. Multiple users reading data can share the data, holding a share lock 
to prevent concurrent access by a writer (who needs an exclusive lock). Many 
share locks can be placed on a single resource.

Manual Locking
Oracle's automatic locking can be overridden at two levels:

Per Session
As described above, the ALTER SESSION statement can set the transaction 
isolation level.

Per Transaction 
Transactions that include the following SQL statements override Oracle's 
default locking:
- The SET TRANSACTION ISOLATION LEVEL statement
- The SELECT ... FOR UPDATE statement
- The LOCK TABLE statement (which locks either a table or, when used with a 
view, the underlying base table)
e.g. "LOCK TABLE MyTable IN EXCLUSIVE MODE" 

Locks acquired by these statements are released after the transaction commits 
or rolls back.

 

Nisar Tareen


farrukh sohail <farrukh_sohail31@xxxxxxxxx> wrote:
hi

what is difference between share lock mode and exclusive mode 
can anybody explain in with example

farrukh

            
---------------------------------
Do you Yahoo!?
Make Yahoo! your home page   

[Non-text portions of this message have been removed]



---------------------------------
Yahoo! Groups Links

   To visit your group on the web, go to:
http://groups.yahoo.com/group/dba_gurus/
  
   To unsubscribe from this group, send an email to:
dba_gurus-unsubscribe@xxxxxxxxxxxxxxx
  
   Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 



                
---------------------------------
Yahoo! Mail Mobile
 Take Yahoo! Mail with you! Check email on your mobile phone.


Other related posts:

  • » [askdba] Re: [dba_gurus] share and exclusive lock mode