zoukankan      html  css  js  c++  java
  • [bbk3204] 第67集 Chapter 17Monitoring and Detecting Lock Contention(00)

    Objectives

    After completing this lesson,you should be able to do the following:

    • Define levels of locking
    • Identify causes of contention
    • Prevent locking problems
    • Use Oracle utilities to detect lock contention
    • Resolve contention in an emergency
    • Resovle deadlock conditions

    Modes of Locking

    Oracle Database uses two modes of locking in a multiuser database:

    • Exclusive lock mode prevents the associates resource from being shared.This lock mode is obtained to modify data.The first transaction to lock a resource exclusively is the only transaction that can alter the resource until exclusive lock is release.
    • Shared lock mode allows the associated resource to be shared.depending on the operations involved.Multiple users reading data can share the data,holding share locks to prevent concurrent access by a writer (who needs an exclusive lock).Several transaction can acquire share locks on the same resource.

    Locking Mechanism

    • Automatic management
    • High level of data concurrency
      • -Row-level locks for DML transactions
      • -No locks required for queries
    • Multi-version consistency
    • Exclusive and Share lock modes
    • Locks held unitl commit or rollback operations are performed

    Data Concurrency

    Three Types of Lokcs

    • DML or data locks:
      • -Table-level locks(TM)
      • -Row-level locks(TX)
    • DDL or dictionary locks
    • Latch locks

    DML Locks

    A DML transaction gets at least tow locks:

    • A shared table lock
    • An exclusive row lock

    Enqueue Mechanism

    The enqueue mechanism keeps track of:

    • Users waiting for locks
    • The requested lock mode
    • The order in which users requested the lock
  • 相关阅读:
    最长公共子序列问题LCS
    [LuoguP2900] [USACO08MAR]土地征用(Land Acquisition)
    [LuoguP3195] [HNOI2008]玩具装箱TOY
    $Yeasion$的码风修改历程
    点分治模板
    Poj2919 Crane
    Poj2010 Moo University
    Kuhn-Munkres算法
    Uva10791 Minimum Sum LCM
    P1018 乘积最大(高精度加/乘)
  • 原文地址:https://www.cnblogs.com/arcer/p/3070764.html
Copyright © 2011-2022 走看看