What is rollback in oracle
Transaction is an atomic unit all changes either committed or rollback. At the end of the transaction that makes database changes, Oracle makes all the changes permanent save or may be undone. If your program fails in the middle of a transaction, Oracle detect the error and rollback the transaction and restoring the database. A single SQL statement executes successfully if the database parses and runs it without error as an atomic unit, as when all rows are changed in a multirow update.
If a SQL statement causes an error during execution, then it is not successful and so all effects of the statement are rolled back. This operation is a statement-level rollback. This operation has the following characteristics:. The unsuccessful statement does not cause the loss of any work that preceded it in the current transaction.
We rollback all transaction to the beginning, ie. So we are rolling back to the last commit, as before. This is tricky.
The rollback still goes to the last commit, as the syntax was not correct but no error reported by the 11g database. Stack Overflow for Teams — Collaborate and share knowledge with a private group.
Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 8 years, 5 months ago.
Active 3 years, 2 months ago. Let us look at the query. In the above query as we can see there are two SQL statements one is the insert statement and the next one sets the savepoint. As, we can see in the screenshot that the insert statement has been successfully executed and the savepoint has also being created. You can also go through our other related articles to learn more —. Submit Next Question.
0コメント