Row Locking and ITL in Oracle.
- Get link
- X
- Other Apps
Locking is very important aspect in a database. It is must to regulate access to (shared) resource so that one process/user doesn't change it while other is modifying the same.
If we question how database may be locking rows/data, we usually may think there may be a process/manager which must be doing the task internally.
The manager process maintains the information which process id wants/has to lock particular rows etc. Seems perfect for simple logical explanation, However if we consider this for OLTP systems, we can easily understand that such a single point of control may cause bottleneck.
All processes competing for locks(acquire or release) on resources via a single manager will ensure that the application/workload cant scale at all.
One of the major reason for Oracle being the top database is the locking mechanism which it implements. There is no such concept as lock manger etc.
Oracle places the lock related information in the actual data block itself.
Ex: when a row in a table is modified by a DML statement, the process must have accessed the database block and loaded in the database buffer cache.
During this, the information about the row now being locked is placed in the header of the block itself.
When another transaction wants to get the lock on the same row, it tries to access the block, and when it does so ,it can easily understand from the information in the header that the particular row is locked by another transaction and it must wait.
ITL(Interested transaction list) is the section in the header of each data block which keeps this information.
- Get link
- X
- Other Apps
Comments
Post a Comment