DDL locks are divided into three types
1. Exclusive DDL Lock
2. Sharing DDL Locks
3. Can interrupt the resolution lock
Most DDL have exclusive DDL locks, such as a table being modified, you can use Select to query data, but most operations are not allowed, including all other DDL statements.
However, in Oracle, there are some DDL operations that do not have DDL locks to occur. such as online CREATE index
Online index creation with Dl,od, low-level TM lock, but no exclusive DDL lock
DL directly loads the lock, the direct load path to the table and the creation of the index cannot be done at the same time.
The OD lock online DDL supports true online.
Low-level TM locks prevent other DDL from occurring, while also allowing DML to perform normally
Another type is shared DDL locks
When you create a procedure or view, a shared DDL lock is added to the table involved, so that you can modify the contents of the table but you cannot modify the structure of the table.
Interruptible Parse Lock
When a session resolves a statement, a parse lock is applied to each object that the statement refers to, which is to brush out the parsed cache statement in the shared pool if the reference object is deleted or modified in some way.
Query the lock condition of the specified table
Select
(select username from v$session where sid=v$lock.sid) Username,
Sid
ID1,
ID2,
Lmode,
Request,block,v$lock.type
From V$lock
where id1=73834;//object_id query by user_objects
Queries the current session for an interruptible resolution lock, which is to find that the code cannot be compiled or timed out waiting for the query to find out who is using the
Set Linesize 1000
Select session_id Sid,owner,name,type,mode_held held,mode_requested Request
From Dba_ddl_locks
where session_id = (select Sid from V$mystat where rownum=1);
Oracle Learning----DDL Lock comprehension