4 states of Things in Oracle:
commit--Submit
rollback--All rolls back
SavePoint name;--defines a point that rolls back to here: for example: SavePoint A;
Rollback to [savepoint]name--rollback to a specified point such as rollback to A; roll it back to a place like this.
Example:
--------------------------------------------example 1:--The first step: Copy an EMP's new table "Cemp" including data;//altogether 14 rows CREATE table Cemp as SELECT * FROM emp;--The second step: delete the delete from cemp where sal>2500;//delete some rows--step three: rollback;//all rolled back here, After the query is still 14 lines---------------------------------------------example 2:--first step: Delete the department number is 10 employee delete from Cemp where deptno=10;-- The second step: Delete the department number is 20 employee delete from Cemp where deptno=20;--step three: Set a rollback point asavepoint a;--4th step: Then delete the employee with the department number 30, and now the employee table is empty delete from Cemp where deptno=30;--5th step: Roll Back to "a" this rollback point rollback to A;select *from cemp;--will see deptno=30 employees still exist, which is to roll back to a point
Oracle's description of Things