LOCK TABLE table_name in lockmode MODE [NOWAIT];
lockmode:
ROW SHARE allows concurrent access to the locked table, but prohibits users
from locking the entire table for exclusive access. ROW SHARE is synonymous
with SHARE UPDATE, which is included for compatibility with earlier versions
of Oracle.
ROW EXCLUSIVE is the same as ROW SHARE, but also prohibits locking in SHARE
mode. Row Exclusive locks are automatically obtained when updating,
inserting, or deleting.
SHARE UPDATE—see ROW SHARE.
SHARE allows concurrent queries but prohibits updates to the locked table.
SHARE ROW EXCLUSIVE is used to look at a whole table and to allow others to
look at rows in the table but to prohibit others from locking the table in SHARE
mode or updating rows.
EXCLUSIVE allows queries on the locked table but prohibits any other activity
on it.
NOWAIT
Specify NOWAIT if you want Oracle to return control to you immediately if the
specified table (or specified partition or subpartition) is already locked by another
user. In this case, Oracle returns a message indicating that the table, partition, or
subpartition is already locked by another user.
If you omit this clause, Oracle waits until the table is available, locks it, and returns
control to you.
|