banner



Which Of The Following Commands Allows A User To "Undo" Uncommitted Changes To Data?

COMMIT

Purpose

Use the COMMIT statement to end your electric current transaction and brand permanent all changes performed in the transaction. A transaction is a sequence of SQL statements that Oracle Database treats as a single unit. This argument likewise erases all savepoints in the transaction and releases transaction locks.

Until you commit a transaction:

  • You can come across whatever changes you accept made during the transaction past querying the modified tables, but other users cannot see the changes. Subsequently yous commit the transaction, the changes are visible to other users' statements that execute afterward the commit.

  • You tin can roll back (undo) any changes made during the transaction with the ROLLBACK statement (meet ROLLBACK.

Oracle Database issues an implicit COMMIT before and later whatsoever data definition linguistic communication (DDL) statement.

You can also apply this statement to

  • Commit an in-doubt distributed transaction manually

  • Cease a read-only transaction begun by a SET TRANSACTION statement

Oracle recommends that you explicitly end every transaction in your application programs with a COMMIT or ROLLBACK statement, including the last transaction, before disconnecting from Oracle Database. If you do not explicitly commit the transaction and the program terminates abnormally, then the last uncommitted transaction is automatically rolled back.

A normal get out from nigh Oracle utilities and tools causes the current transaction to exist committed. A normal exit from an Oracle precompiler plan does not commit the transaction and relies on Oracle Database to ringlet back the current transaction.

Prerequisites

You lot need no privileges to commit your current transaction.

To manually commit a distributed in-doubt transaction that you originally committed, y'all must have FORCE TRANSACTION system privilege. To manually commit a distributed in-doubt transaction that was originally committed by another user, you must have FORCE Whatsoever TRANSACTION system privilege.

Syntax

commit::=

Description of commit.gif follows
Description of the analogy commit.gif

Semantics

COMMIT

All clauses afterwards the COMMIT keyword are optional. If y'all specify only COMMIT, then the default is COMMIT Piece of work WRITE IMMEDIATE WAIT.

Piece of work

The Piece of work keyword is supported for compliance with standard SQL. The statements COMMIT and COMMIT Piece of work are equivalent.

COMMENT Clause

Specify a comment to be associated with the current transaction. The ' text ' is a quoted literal of up to 255 bytes that Oracle Database stores in the data lexicon view DBA_2PC_PENDING along with the transaction ID if a distributed transaction becomes in doubt. This comment can aid you diagnose the failure of a distributed transaction.

See Also:

Comment for more information on adding comments to SQL statements

WRITE Clause

Employ this clause to specify the priority with which the redo information generated by the commit operation is written to the redo log. This clause tin can improve performance by reducing latency, thus eliminating the wait for an I/O to the redo log. Apply this clause to amend response time in environments with stringent response time requirements where the following atmospheric condition apply:

  • The volume of update transactions is large, requiring that the redo log be written to disk frequently.

  • The awarding can tolerate the loss of an asynchronously committed transaction.

  • The latency contributed by waiting for the redo log write to occur contributes significantly to overall response time.

Note:

if you omit this clause, and so the behavior of the commit functioning is controlled by the COMMIT_WRITE initialization parameter, if it as been set. The default value of the parameter is the same as the default for this clause. Therefore, if the parameter has not been set and you omit this clause, then commit records are written to disk before control is returned to the user.

IMMEDIATEThe Firsthand parameter initiates I/O, causing the redo for the commit of the transaction to be written out immediately by sending a message to the LGWR process. If yous specify neither Firsthand nor BATCH, then Immediate is the default.

BATCHThe BATCH parameter causes the redo to be buffered to the redo log. No I/O is initiated.

WaitThe Wait parameter ensures that the commit volition not return until the respective redo is persistent in the online redo log. If you specify neither WAIT nor NOWAIT, and so WAIT is the default.

NOWAITThe NOWAIT parameter allows the commit to return before the redo is persistent in the redo log.

Strength Clause

In a distributed database arrangement, the Forcefulness clause lets you manually commit an in-doubt distributed transaction. The transaction is identified by the ' string ' containing its local or global transaction ID. To find the IDs of such transactions, query the information lexicon view DBA_2PC_PENDING. You tin use integer to specifically assign the transaction a organisation change number (SCN). If you lot omit integer , so the transaction is committed using the current SCN.

Notation:

A COMMIT statement with a Forcefulness clause commits only the specified transaction. Such a argument does not affect your electric current transaction.

Examples

Committing an Insert: CaseThis argument inserts a row into the hour.regions table and commits this modify:

INSERT INTO regions VALUES (five, 'Antarctica');   COMMIT Piece of work;        

To commit the same insert operation and instruct the database to buffer the change to the redo log, without initiating disk I/O, use the post-obit COMMIT statement:

COMMIT WRITE BATCH;        

Commenting on COMMIT: ExampleThe following statement commits the current transaction and associates a annotate with it:

COMMIT      Comment 'In-doubt transaction Lawmaking 36, Call (415) 555-2637';        

If a network or machine failure prevents this distributed transaction from committing properly, so Oracle Database stores the comment in the data dictionary along with the transaction ID. The comment indicates the part of the awarding in which the failure occurred and provides information for contacting the administrator of the database where the transaction was committed.

Forcing an In-Doubt Transaction: ExampleThe post-obit argument manually commits an in-dubiousness distributed transaction:

COMMIT FORCE '22.57.53';        

Which Of The Following Commands Allows A User To "Undo" Uncommitted Changes To Data?,

Source: https://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_4010.htm

Posted by: sotocapts1955.blogspot.com

0 Response to "Which Of The Following Commands Allows A User To "Undo" Uncommitted Changes To Data?"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel