Haven't written a blog for a long time. I don't know what to write.
Today, let me clear a table of data, the result is clear, the system is not moving, as if the server hangs dead.
Later found a half-day to find that the original is I delete data after not commit things caused the database lock table, and then do not understand,
What is the lock table, so I went online to check
Check for a long while, most of it is to say how to solve the lock table and query lock table, but only understand the method is not enough, and want to know the principle, so
We're going to go deep and find the Oracle lock mechanism.
Because the database is a shared resource used by multiple users at the same time, multiple processes occur in the database when multiple users are concurrently accessing things
In the case of simultaneous operation of the same data, it is possible to read and store incorrect data if the concurrency operation is not controlled, which can destroy the consistency of the database.
And locking is a very important technology to realize concurrency control of database. When a transaction makes a request to the system before it operates on a data object,
To lock it. After locking, the transaction has some control over the data object, and the other transaction cannot perform the data object until the transaction releases the lock.
The update operation.
There are two basic types of locks in the database, exclusive locks (Exclusive Locks, or x locks), and shared locks (share Locks, S locks). When
Data is locked in the row, it can not be read and modified by other things, and on the shared lock, can only be read by other things, but can not be modified database is to use these two locks on the database transactions to do concurrency control.
What do you do when you say so many specific Oracle lock tables?
In order not to mislead everyone, this I personally try to send out again.
Oracle Lock table and unlock