enq: TM – contention

Oracle attempts  to put a lock on the table with the foreign key if a change is made to the main table with the primary key.

The enq: TM – contention wait event is usually seen during a DML operation on tables with non-indexed foreign key. Or “enq: TM – contention” waiting event can be seen when there is a lock that prevents the operation in the table.

The index must be created for the non-indexed foreign key field for the solution. If there is no foreign key, the session causing the lock should be detected and terminated as follows.

The session that causes the lock can be killed as follows.