Open In App

Flashback Queries

Last Updated : 24 May, 2020
Improve
Improve
Like Article
Like
Save
Share
Report

Flashback Query allows users to see the view of past data, If in case some data or table is being deleted by the user, then the flashback query provides us an opportunity to view that data again and perform manipulations over it.

In flashback queries we have an concept of flash area, in flash area we store the deleted data which can be viewed if needed in future.

To use the feature of flashback query, our server must be configured according to automatic undo management.If our system supports the traditional approach of rollback then we can not perform flashback query on such systems.

We can enable the flashback query using the package DBMS_FLASHBACK. This package enables us to view the data in past by specifying the System change number or the exact time in the past.

How to use DBMS_FLASHBACK :

EXECUTE Dbms_Flashback.Enable_At_System_Change_Number(647392649);
EXECUTE Dbms_Flashback.Enable_At_Time('19-APR-2020 11:00:00); 

Example of Flashback Query :
If we want to view a past data which is being deleted by mistake.The data consists of students table and it is being deleted at 11:05 AM on 19-APR-2020.To access the data we can use flashback query either by giving exact time or by mentioning the system change number.

Limitations Flashback Query :

  1. Flashback query only works on those systems which supports automatic undo management.
  2. Systems having traditional approach of rollback does not supports flashback query.
  3. We can not use DDL (Data Definition Language) or DML (Data Manipulation Language) while performing flashback query.
  4. Flashback query does not reverse the DDL(Data Definition Language) commands.
  5. Flashback query can perform manipulations in DDL(Data Definition Language) commands.
  6. We can not apply flashback queries on functions, Packages, Procedures and triggers.

Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads