In the classic banking example, a transaction that transfers a dollar
amount from one account to another is successful only if both the debit of one account (an update
of the savings account balance) and the credit of another account (an update of the checking
account balance) are both successful. Failure of either or both statements invalidates the entire
transaction. When the application or SQL*Plus user issues a commit, if only one or the other update
statement is successful, the bank will have some very unhappy customers!
A transaction is initiated implicitly. After a commit of a previous transaction is completed, and
at least one row of a table is inserted, updated, or deleted, a new transaction is implicitly created.
Also, any DDL commands such as create table and alter index will commit an active transaction
and begin a new transaction. You can name a transaction by using the set transaction . . . name
???transaction_name??™ command. Although this provides no direct benefit to the application, the
name assigned to the transaction is available in the dynamic performance view V$TRANSACTION
and allows a DBA to monitor long-running transactions; in addition, the transaction name helps
I
Chapter 7: Managing Transactions with Undo Tablespaces 209
the DBA resolve in-doubt transactions in distributed database environments. The set transaction
command, if used, must be the first statement within the transaction.
Within a given transaction, you can define a savepoint.
Pages:
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364