Why archive should be turned ON before turning on flashback (2 threads merged by bb) [message #469807] |
Thu, 05 August 2010 20:12 |
kseth42gmailcom
Messages: 1 Registered: August 2010 Location: India
|
Junior Member |
|
|
I have read it in books that flashback uses undo data to create the flashback data or to flashback the database to a time in the past.
Then, what is the role of archive files in flashback operation. Why it is mandatory to turn on archiving before turning on flashback. Also, if you remove the latest archive files, you can NOT flashback the data to a time in past (Oracle complains of missing archive files).
Regards,
Kunal
|
|
|
Re: Why archive should be turned ON before turning on flashback (2 threads merged by bb) [message #469835 is a reply to message #469807] |
Fri, 06 August 2010 01:59 |
John Watson
Messages: 8960 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
Which books did you read? They should have made it clear that there are 3 flashback technologies, that use completely different techniques:
Flashback query (also known as "flashback table" or "flashback transaction") uses undo segments.
Flashback database uses archive logs and flashback logs.
Flashback drop uses renaming of objects.
Your question shows that you are not yet clear on the difference between these technologies, can you go back to the books and then re-word the question?
|
|
|
|
|
|
|
|
Re: Why archive should be turned ON before turning on flashback (2 threads merged by bb) [message #469889 is a reply to message #469875] |
Fri, 06 August 2010 04:46 |
John Watson
Messages: 8960 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
OK, here's the answer. When flashback database is enabled, Oracle writes pre-update versions of blocks to the flashback buffer. The flashback buffer is not big, you can see it if you query v$sgastat. Then periodically the RVWR process writes the buffer to the flashback logs. This is similar to the Oracle release 5 structures used for rollback and redo, which were so slow. The reason it works now without performance problems is that the logging algorithm does not log blocks for every change: you might write to block a hundred times, and will be logged to flashback only once.
Then when you flashback, Oracle copies in the pre-update versions of blocks that are as close as possible to the time you want. But because it doesn't have version of every block, it cannot do this perfectly. So it uses redo to bring the blocks forward to exactly the time you want.
That is why archivelogs are needed.
|
|
|
|