Site icon Database Tutorials

Oracle Flashback Query

 

Oracle Flashback Query allows us to query as much as possible of the past committed data. We can query the data in the past over the time stamp or system change number (SCN).

For Flashback Query use, the flashback feature of the database does not need to be turned on.

Oracle flashback query usage areas:

The data you query with Flashback Query is undo data. So the past time you can access is related to the size of the undo tablespace and how high your undo retention parameter is.

For Flashback Query, AS OF SCN and AS OF TIMESTAMP usages are available.

AS OF SCN:

By specifying the System Change Number (SCN), we can query the history of the data.

You can learn the SCN information before and after a data change with the following query. To query with SCN, SCN information will be required before the change.

We can query the past data by specifying SCN with the following sample query.

AS OF TIMESTAMP :

By giving a specific date, we can query the history of the data. We can query the history of data by specifying the date with the example query below.

We can also specify the condition in queries.

Exit mobile version