Oracle flashback query feature lets you specify a target time and then run queries against your database. A user could choose a target time before the error and run a query to retrieve the contents of the lost rows.

Example of Oracle Flashback Query

You discover that at 12:30 PM, an employee 'JOHN' had been deleted from your EMP table, and you know that at 9:30AM that employee's data was correctly stored in the database, you could query the contents of the table as of a time before the deletion to find out what data had been lost, and, if appropriate, re-insert the lost data in the database.

For example, the following query retrieves the state of the employee record for 'JOHN' at 9:30AM, April 4, 2005:

SELECT * FROM EMP AS OF TIMESTAMP
TO_TIMESTAMP('2005-04-04 09:30:00', 'YYYY-MM-DD HH:MI:SS')
WHERE name = 'JOHN';

Restoring John's information to the table EMP requires the following update:

INSERT INTO EMP
(SELECT * FROM EMP AS OF TIMESTAMP
TO_TIMESTAMP('2005-04-04 09:30:00', 'YYYY-MM-DD HH:MI:SS')
WHERE name = 'JOHN');
Go to top
JSN Boot template designed by JoomlaShine.com