tags:

views:

246

answers:

3

I have some doubt as follows

We are UPDATING a field in SQL and ALTER the row also.After giving the COMMIT command the system is crashed.Wat will happen to the commands given,whether it will UPDATE and ALTER the table r not?

A: 

If the crash occurs before the transaction has been committed, your updates will not be done.

Chris J
+3  A: 

Oracle guarantees that the changes will happen entirely, or not at all. If you crash after commit but before the prompt returns, it's impossible to tell which of the two has happened.

Andomar
+2  A: 

Depends on timing and sequence of statements.
Oracle autocommits transaction when it encounters any DDL statement (CREATE, DROP, RENAME, or ALTER).
So if you have ALTER in middle of transaction, Oracle will commit and then each following statement will be executed as new single statement transaction.

After the crash, interrupted transactions will be rolled back.

In your case you will have at least two separate transactions, so if crash occurs after first transaction, you could get in situation where some number of statements is executed and committed and rest is rolled back.

See Oracle documentation: Overview of Transaction Management

zendar