Professional Documents
Culture Documents
Oracle Locking: Michael Messina Principal Database Analyst Indiana University
Oracle Locking: Michael Messina Principal Database Analyst Indiana University
RS: row share RX: row exclusive S: share SRX: share row exclusive X: exclusive * Waits if another transaction has a lock
Oracle Latches
Latches are low-level serialization mechanisms to protect shared data structures in the system global area (SGA). Latches protect the oracle lists like list of users currently accessing the database and protect the data structures describing the blocks in the buffer cache. A server or background process acquires a latch for a very short time while manipulating or looking at one of these structures. The implementation of latches is operating system dependent, particularly in regard to whether and how long a process will wait for a latch.
Deadlocks
Oracle automatically detects deadlock situations and resolves them by rolling back one of the statements involved in the deadlock. This releases one set of the conflicting row locks. A corresponding message also is returned to the transaction that undergoes the rollback. Deadlocks often occur when transactions override Oracle default locking. Oracle itself does no lock escalation and does not use read locks for queries and does not use page-level locking, deadlocks rarely occur in Oracle. Deadlocks can usually be avoided if transactions accessing the same tables lock those tables in the same order, either through implicit or explicit locks and when a sequence of locks for one transaction are required, you should consider acquiring the most exclusive (least compatible) lock first Always close explicit cursors when finished to free locks.
CREDITS
Oracle Metalink White Paper 70120 Oracle 8.1.7 Documentation My own knowledge and experience using Oracle
?? QUESTIONS ??