And the bad news? There’s nothing it can do about your teenage haircut.
Oracle Flashback Technology is a suite of features that enables Oracle application developers and database administrators to wind the clock back and examine their database objects and data in a previous state without having to resort to backup media. Simply put, Oracle Flashback Technology is time travel for databases.
In this series of articles I intend to expound on the benefits of Oracle Flashback to application developers and to database administrators. This first installment will concentrate on the tools that will be of interest to application developers.
Oracle Flashback Technology is actually a collection of features that enables the developer to examine the database’s recent past in a number of ways:
Oracle Flashback Query:
Flashback query is a neat trick. It allows you run a query against your data as it was at past time. Imagine you accidentally delete a number of rows and commit your changes. With flashback query you can easily reach into the past and retrieve those lost rows. Using the SELECT... AS OF clause you can examine the ghost of data past by referencing its timestamp.
SELECT * FROM emp AS OF TIMESTAMP TO_TIMESTAMP('2012-04-21 17:00:00','YYYY-MM-DD HH24:MI:SS');And if you wanted to view those rows that you accidentally deleted 5 minutes ago?
SELECT * FROM emp AS OF TIMESTAMP (SYSTIMESTAMP - INTERVAL '6' MINUTE) MINUS SELECT * FROM emp;