vendredi 2 décembre 2011

Oracle11g: Flashback Transaction Query, Flashback Transaction


Flashback transaction allows the user to rollback an entire transaction.
This technology is based on undo data and redo logs availables.

Pre-requisite
You need to :
  1.  Activate supplemental log data
  2.  Activate supplemental log data primary key
  3.  Grant execute on DBMS_FLASHBACK package
  4.  Grant SELECT ANY TRANSACTION priviledge to user

These can be done like this :
SQL> alter database add supplemental log data;
SQL> alter database add supplemental log data (primary key) columns;
SQL> grant execute on DBMS_FLASHBACK to <user>;
SQL> grant SELECT ANY TRANSACTION to <user>;

Transaction back-out
See the excellent example from this oracle blog to perform a transaction backout.
For Oracle documentation.