ROLLBACK

1.    ROLLBACK in Oracle is used to undo changes made by DML statements such as INSERT, UPDATE, and DELETE that have not yet been committed in the current transaction.

 

2.    When ROLLBACK is executed, Oracle restores the data to its previous state using undo segments, ensuring database consistency.

 

3.    ROLLBACK ends the current transaction and starts a new one, just like COMMIT, but without saving the changes.

 

4.    After a ROLLBACK, all locks held by the transaction on rows or tables are released, allowing other users to access those resources.

 

5.    ROLLBACK is commonly used when an error occurs during a transaction or when the user decides not to save the changes.

 

6.    If a session terminates abnormally, such as due to a system crash or network failure, Oracle automatically performs a ROLLBACK of uncommitted changes.

 

7.    Oracle supports ROLLBACK TO SAVEPOINT, which allows partial undo of a transaction without rolling back all changes.

 

8.    ROLLBACK does not affect DDL statements because Oracle implicitly commits before and after executing DDL commands.

 

9.    Using ROLLBACK helps maintain data integrity by ensuring that only valid and complete transactions are committed to the database.

 

10.  ROLLBACK is an essential transaction control statement in Oracle, allowing users to safely reverse unwanted changes during database operations.

 

No comments:

Post a Comment