Oracle locks can be divided into several types: DML lock (data lock), DDL lock (dictionary lock) and internal lock/latch.
DML lock can be divided into row lock and table lock. Row lock in select .. for update/insert/update/delete is automatically generated implicitly. in addition to implicit generation of table lock, you can also call lock table <table_name> in </table_name> name to display the lock.
If you do not want any row in other session lock/insert/update/delete tables to be queried, you can use lock table table_name in exclusive mode. (X) The lock mode has the highest level and the minimum concurrency.
If you allow other sessions to query or use select for update to lock records and do not allow insert/update/delete, you can use lock table table_name in share row exclusive mode. (SRX)
If you allow other session queries, select for update, and lock table table_name in share mode, but do not allow insert/update/delete, you can use lock table table_name in share mode. (The difference between share mode and share row exclusive mode is that one is non-preemptible and the other is preemptible. After you enter the share row exclusive mode, other sessions cannot block you from insert/update/delete. After you enter the share mode, other sessions can also enter the share mode to prevent modification to the table. (S)
There are two lock modes: row share (RS) and row exclusive (RX ). They allow more concurrent operations. Generally, they are automatically obtained using DML statements instead of lock statements.