A savepoint allows the sequence of DML
commands within a transaction to be partitioned so that it is possible to roll back one or more of
the DML commands after the savepoint, and subsequently submit additional DML commands or
commit the DML commands performed before the savepoint. Savepoints are created with the
savepoint savepoint_name command. To undo the DML commands since the last savepoint,
you use the command rollback to savepoint savepoint_name.
A transaction is implicitly committed if a user disconnects from Oracle normally; if the user
process terminates abnormally, the most recent transaction is rolled back.
Undo Basics
Undo tablespaces facilitate the rollback of logical transactions. In addition, undo tablespaces
support a number of other features, including read consistency, various database-recovery
operations, and Flashback functions.
Rollback
As described in the previous section, any DML command within a transaction??”whether the
transaction is one or one hundred DML commands??”may need to be rolled back. When a DML
command makes a change to a table, the old data values changed by the DML command are
recorded in the undo tablespace within a system-managed undo segment or a rollback segment.
When an entire transaction is rolled back (that is, a transaction without any savepoints),
Oracle undoes all the changes made by DML commands since the beginning of the transaction
using the corresponding undo records, releases the locks on the affected rows, if any, and the
transaction ends.
Pages:
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365