Will Oracle lock the whole table while performing a DML statement or just the row

前端 未结 4 1980
南旧
南旧 2021-02-14 16:29

When i try to insert/update something in a db table, will Oracle lock the whole table or only the row being inserted/updated?

Is this something that can be controlled t

4条回答
  •  渐次进展
    2021-02-14 16:52

    You should probably read the oracle concepts manual regarding locking. For standard DML operations (insert, update, delete, merge), oracle takes a shared DML (type TM) lock. This allows other DMLs on the table to occur concurrently (it is a share lock.) Rows that are modified by an update or delete DML operation and are not yet committed will have an exclusive row lock (type TX). Another DML operation in another session/transaction can operate on the table, but if it modifies the same row it will block until the holder of the row lock releases it by either committing or rolling back.

    Parallel DML operations and serial insert direct load operations take exclusive table locks.

提交回复
热议问题