When updating a table, Oracle will add a tmlock to the table before submission to ensure that the table structure will not change. At this time, if another session executes alter on this table
When updating a table, Oracle will add a tmlock to the table before submission to ensure that the table structure will not change. At this time, if another session executes alter on this table
When updating a table, Oracle will add a tmlock to the table before submission to ensure that the table structure will not change.
At this time, if another session executes the alter or drop command on the table, the following error message will be obtained immediately:
Tony @ ORA11GR2> drop table t;
Drop table t
*
Row 3 has an error:
ORA-00054: the resource is busy, but specifies to get the resource in NOWAIT mode, or timeout is invalid
In Oracle11gR2, you can set the DDL_LOCK_TIMEOUT parameter for DDL wait.
For example, run
Alter session set ddl_lock_timeout = 30;
Let the drop table wait for 30 seconds. If the other session that locks the table to be deleted commits or rolls back the transaction within 30 seconds,
The drop table command will be executed, otherwise one ORA-00054 will be generated 30 seconds later: error.