Oracle Database automatically locks a resource on behalf of a transaction to prevent other transactions from doing something that requires exclusive access to the same resource. The database automatically acquires different types of locks at different levels of restrictiveness depending on the resource and the operation being performed.
注意:The database never locks rows when performing simple reads.
Oracle Database locks are divided into the following categories.
Lock | Description |
---|---|
DML Locks | Protect data. For example, table locks lock entire tables, while row locks lock selected rows. |
DDL Locks | Protect the structure of schema objects—for example, the dictionary definitions of tables and views. |
System Locks | Protect internal database structures such as data files. Latches, mutexes, and internal locks are entirely automatic. |
关于DML locks、DDL locks、System locks的介绍放在我的博客的其他文章里