2.413 TXN_PRIORITY
TXN_PRIORITY
specifies the priority for all user transactions in a session.
Property | Description |
---|---|
Parameter type |
String |
Syntax |
|
Default value |
|
Modifiable |
|
Modifiable in a PDB |
No |
Basic |
No |
The Priority Transactions feature automatically rolls back low-priority transactions that are blocking higher priority transactions from obtaining row locks.
You can use the TXN_PRIORITY
parameter to assign a priority (HIGH
, MEDIUM
, or LOW
) to all transactions in a particular user session. Priority Transactions then operates as follows for the three priorities:
-
HIGH
- Priority Transactions never rolls back aHIGH
priority transaction in order to release a row lock for another transaction. This is the default. -
MEDIUM
- Priority Transactions will roll back aMEDIUM
priority transaction if it is holding a row lock required by aHIGH
priority transaction, and theHIGH
priority transaction has been waiting for the row lock longer than the time specified by thePRIORITY_TXNS_HIGH_WAIT_TARGET
parameter. -
LOW
- Priority Transactions will roll back aLOW
priority transaction if it is holding a row lock required by aHIGH
orMEDIUM
priority transaction, and theHIGH
orMEDIUM
priority transaction has been waiting for the row lock longer than the time specified by thePRIORITY_TXNS_HIGH_WAIT_TARGET
orPRIORITY_TXNS_MEDIUM_WAIT_TARGET
parameter, respectively.If a
LOW
priority transaction is blocked waiting for a row lock, Priority Transactions will not roll back the transaction holding the row lock, regardless of its priority.
You can view the priority and maximum wait time for a transaction by querying the TXN_PRIORITY
and PRIORITY_TXNS_WAIT_TARGET
columns in the V$TRANSACTION
view.
Note:
This parameter is available starting with Oracle Database 23ai.
See Also:
-
Oracle Database Administrator’s Guide for more information about Priority Transactions