November 28, 2010

Lock a table

Locking a table prevents two users to update a table at same time. 
Using locks we can prevent data replications. 
 
LOCK TABLE employees
   IN EXCLUSIVE MODE;
This exclusive mode enables the user to look into the rows but can update it.
And this command for remote link tables.
LOCK TABLE employees@DB
IN SHARE MODE 
 
The alternative for this is to use sequence in your table.It will also prevent data duplications. 

No comments:

Post a Comment

Thanks for your comments submitted.,will review and Post soon! by admin.

Part of my Oracle Fusion HCM Fix of the Day series: real issues from implementations and a Redwood rollout I led without a Systems Integrat...