Oracle Locks   «Prev  Next»
Lesson 10

Tuning Oracle locks Conclusion

As you can see, there is quite a bit of complexity to Oracle locking. The main points of this module include:
  1. Oracle locking is designed to prevent inconsistencies and inadvertent overlaying of row data
  2. Oracle issues locks automatically for all UPDATE statements
  3. Oracle programmers can issue row-exclusive locks using the FOR UPDATE clause
  4. Oracle programmers can issue table-exclusive locks with the LOCK TABLE command
  5. Oracle deadlocks are detected and prevented by aborting the task that would have caused the deadlock
  6. Oracle provides the V$LOCK_ACTIVITY and V$SYSSTAT views to show lock information
  7. Oracle provides the catblock.sql and utllockt.sql scripts to enhance the V$ views and show tasks that are holding or waiting onlocks
  8. Application can issue custom locks using the dbms_lock package

Detecting Resolving Lock Contention

We will be continuing our discussion of Oracle locks in the next module where we will explore techniques for detecting and resolving lock contention. Now you should be able to:
  1. Describe Oracle's locking scheme
  2. Describe the purpose of shared and exclusive Oracle locks
  3. Describe Oracle lock modes
  4. Identify an Oracle deadlock
  5. Prevent a database deadlock
  6. List the dictionary lock views
  7. Run the lock utility scripts
  8. Use the dbms_lock package

New terms

Here are the terms from this module that may have been new to you:
  1. coexistence methods: A technique for ensuring coexistence between two methods for access to the Oracle database.
  2. concurrency management: This is the process of ensuring that all database changes are single-threaded, and that no two tasks can ever update a row at the same moment in time.
  3. Deadlock: A situation that occurs when two processes are dependent on each other, resulting in an impass.
  4. dbms_lock: An Oracle packages that makes Oracle kernel's lock management services available to user-written applications.
  5. exclusive locks: Exclusive locks are issued for the duration of all SQL UPDATE or DELETE statements to ensure that all changes are single-threaded through the database.
  6. exclusive table locks: The most restrictive of the table locks. Prevents everything except queries against the affected table. Exclusive locks are used when the programmer desired exclusive control over a set of rows until their operation has completed.
  7. lock hit ratio: Used to identify excessive lock conversion by the DLM.
  8. locks: Locks are used by the Oracle database to ensure that database rows are not inadvertently written-over by concurrent tasks.
  9. pre-emptive locks: Exclusive locks issued at the time of retrieval and held until the task has committed or ended.
  10. row exclusive locks: A type of lock issued automatically against a table when an UPDATE, DELETE, or INSERT statement is issued against the table.
  11. row locks: Locks placed on individual rows within an Oracle table.
  12. row share table locks: A type of lock issued when an SQL transaction has declared its intent to update the table in row share mode.
  13. Shared row exclusive table locks: Type of lock issued with the LOCK TABLE table1 IN SHARE ROW EXCLUSIVE MODE command.
  14. shared locks: In shared locking, whenever a unit of data is retrieved from the database, an entry is placed in the database storage pool.
  15. table locks:A single lock that encompasses an entire Oracle table.
  16. table share locks: Type of lock issued when the LOCK TABLE command is issued against the table.
Oracle Database 12c Performance Tuning
Now that we know the basics, let us move on to look at advanced Oracle locking topics. In the next module we will explore the detection and correction of Oracle lock contention.

Oracle Lock Concepts - Quiz

To complete this module, click the Quiz link below to test your knowledge so far of Oracle locks concepts and tuning.
Oracle Lock Concepts - Quiz