Oracle9i SQL Reference Release 2 (9.2) Part Number A96540-02 |
|
|
View PDF |
Use the ROLLBACK
statement to undo work done in the current transaction, or to manually undo the work done by an in-doubt distributed transaction.
See Also:
|
To roll back your current transaction, no privileges are necessary.
To manually roll back an in-doubt distributed transaction that you originally committed, you must have the FORCE
TRANSACTION
system privilege. To manually roll back an in-doubt distributed transaction originally committed by another user, you must have the FORCE
ANY
TRANSACTION
system privilege.
rollback::=
The keyword WORK
is optional and is provided for ANSI compatibility.
Specify the savepoint to which you want to roll back the current transaction. If you omit this clause, then the ROLLBACK
statement rolls back the entire transaction.
Using ROLLBACK
without the TO
SAVEPOINT
clause performs the following operations:
Using ROLLBACK
with the TO
SAVEPOINT
clause performs the following operations:
You cannot manually roll back an in-doubt transaction to a savepoint.
Specify FORCE
to manually roll back an in-doubt distributed transaction. The transaction is identified by the 'text
' containing its local or global transaction ID. To find the IDs of such transactions, query the data dictionary view DBA_2PC_PENDING
.
A ROLLBACK
statement with a FORCE
clause rolls back only the specified transaction. Such a statement does not affect your current transaction.
ROLLBACK
statements with the FORCE
clause are not supported in PL/SQL.
See Also:
Oracle9i Heterogeneous Connectivity Administrator's Guide for more information on distributed transactions and rolling back in-doubt transactions |
The following statement rolls back your entire current transaction:
ROLLBACK;
The following statement rolls back your current transaction to savepoint banda_sal
:
ROLLBACK TO SAVEPOINT banda_sal;
See Also:
"Creating Savepoints: Example" for a full version of this example |
The following statement manually rolls back an in-doubt distributed transaction:
ROLLBACK WORK FORCE '25.32.87';