Quick Search:
CODE
Oracle PL/SQL Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
 The Oracle PL/SQL SHARE Keyword      [Return To Index] Jump to:  
  Looking for the original pages? (formerly called "Morgan's Library") You can find them here.

Term: SHARE

Definition:
In Oracle PL/SQL, the term SHARE refers to the locking mode of a table. A table can be explicitly locked using the LOCK TABLE command in SHARE or ROW SHARE mode.

A ROW SHARE table lock indicates that a set of rows in a table are held in a transaction. It allows users to query, insert, update or delete in the same table.

SHARE mode locks a table such that other transactions can only query the table, but restricts UPDATE operations. Multiple transactions can hold share table locks for the same table concurrently. No transaction can update the table (with SELECT... FOR UPDATE). Therefore, a transaction that has a share table lock can update the table only if no other transaction also has a share table lock on the same table.

Other locking modes available in Oracle are EXCLUSIVE, ROW EXCLUSIVE and SHARE ROW EXCLUSIVE

Example Syntax:

LOCK TABLE [TABLE NAME] IN [SHARE | ROW SHARE] MODE


Example Usage:

SQL> LOCK TABLE ORDERS IN SHARE MODE;

Table(s) Locked.

 
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us 239 users online    © 2009 psoug.org
PSOUG LOGIN
Username: 
Password: 
Forgot your password?