0% found this document useful (0 votes)
76 views2 pages

Oracle-Flash Back Query

Flashback query allows retrieving data that has already been committed without performing recovery. There are two types of flashback: time-based flashback, which uses a timestamp to view previous data; and SCN-based flashback, which uses a System Change Number to roll back to a previous state. SCN-based flashback involves declaring a variable to store the SCN, getting the SCN, enabling flashback using the SCN, and disabling flashback.

Uploaded by

prashaanth55
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
76 views2 pages

Oracle-Flash Back Query

Flashback query allows retrieving data that has already been committed without performing recovery. There are two types of flashback: time-based flashback, which uses a timestamp to view previous data; and SCN-based flashback, which uses a System Change Number to roll back to a previous state. SCN-based flashback involves declaring a variable to store the SCN, getting the SCN, enabling flashback using the SCN, and disabling flashback.

Uploaded by

prashaanth55
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

FLASHBACK QUERY

Used to retrieve the data which has been already committed with out going for
recovery.

Flashbacks are of two types

 Time base flashback


 SCN based flashback (SCN stands for System Change Number)

Ex:

1) Using time based flashback

a) SQL> Select *from student;

-- This will display all the rows

b) SQL> Delete student;

c) SQL> Commit; -- this will commit the work.

d) SQL> Select *from student;

-- Here it will display nothing

e) Then execute the following procedures

SQL> Exec dbms_flashback.enable_at_time(sysdate-2/1440)

f) SQL> Select *from student;

-- Here it will display the lost data

-- The lost data will come but the current system time was used

g) SQL> Exec dbms_flashback.disable


-- Here we have to disable the flashback to enable it again

2) Using SCN based flashback

a) Declare a variable to store SCN

SQL> Variable s number

b) Get the SCN

SQL> Exec :s := exec dbms_flashback.get_system_change_number

c) To see the SCN

SQL> Print s

d) Then execute the following procedures

SQL> Exec dbms_flashback.enable_at_system_change_number(:s)

SQL> Exec dbms_flashback.disable

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy