SET TRANSACTION
SET TRANSACTIONtrans_typeNAMEname
Controls the type of transaction.
Keyword
- trans_type
Can be one of these values:
- READ ONLY
Marks the beginning of a read-only transaction. Tells the RDBMS to enforce a read-consistent view of the database for the transaction (the default is for the statement). The transaction is ended with either a COMMIT or a ROLLBACK. Only LOCK TABLE, SELECT, SELECT INTO, OPEN, FETCH, CLOSE, COMMIT, and ROLLBACK statements are permitted during a read-only transaction. Issuing other statements, such as INSERT or UPDATE, in a read-only transaction results in an ORA-1456 error.
- READ WRITE
Marks the beginning of a READ WRITE transaction; this is the default.
- ISOLATION LEVEL SERIALIZABLE
Similar to a READ ONLY transaction in that transaction-level read consistency is enforced instead of the default statement-level read consistency. Serializable transactions do allow changes to data. For more information about isolation levels, see Chapter 3.
- ISOLATION LEVEL READ COMMITTED
If the transaction requires rows that are locked by other transactions, will wait.
- USE ROLLBACK SEGMENT rbseg_name
Tells the RDBMS to use the specifically named rollback segment rbseg_name. Useful when only one rollback segment is large and a program knows that it needs to use the large rollback segment, such as during a month-end close operation.
- name
Name for the transaction, which is available for the duration of the transaction.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access