Questions about locking and security in Oracle

From: Gilles Nicaud <nicaud_at_lannion.cnet.fr>
Date: 21 May 92 11:57:28 GMT
Message-ID: <1992May21.115728.29899_at_cnet.fr>


Questions about locking and security in Oracle.

I- LOCKING Would somebody be kind enough to confirm the following understanding I have about Oracle locking :

  1. Oracle implicitely uses writelocks. It's what people call "the weak consistency" : reads are clean (the read values are always committed values) but reads are not repeteable. Read locks are not used.
  2. When choosing the option "read only transaction", locks are not used as Oracle reads in the snapshot area : the consistency is absolute (in terms of serializability) but the read values are not necessarily the last committed values in the base.
  3. Using the "lock table statement", it is possible
  4. either to lock the entire table (options : "share", "share row exclusive", "exclusive") : the consistency is absolute and the read values cannot be modified until the end of the transaction,
  5. or to lock at the tuple level with a read lock ("row share" option) or a write lock ("share update" option). If there are two identical read requests inside a transaction, the tuples responding to the second request will include the tuples of the first request plus new ones that may appear in the meanwhile (phantoms).

The locking is automatically done by Oracle when accesses occur.

Is there anybody to tell me the scope of the "lock table" statement : it is valid for the session or for the transaction ?

II- SECURITY In case of failure, Oracle has a "redo log" to redo committed data not yet in the base and "rollback segments" to undo uncommitted data already in the base.

However, the only security disk write during the transaction is the redo log disk write at commitment.

How does Oracle manage the "rollback segments" to perform only a redo log disk write as it is necessary to save the "before image" in the "rollback" before the cache manager writes in the base an uncommited modification ?

Thank you in advance for the answers.

  • F R A N C E T E L E C O M =========================
   Gilles Nicaud                              Phone :  +33 96 05 31 94
   Centre National d'Etudes                   FAX   :  +33 96 05 32 86
   des Telecommunications                     Email :  nicaud_at_lannion.cnet.fr
   LAA/SLC/BSA
   Route de Tregastel
   22301 LANNION CEDEX
   FRANCE
Received on Thu May 21 1992 - 13:57:28 CEST

Original text of this message