Home » RDBMS Server » Server Administration » Why archive should be turned ON before turning on flashback (2 threads merged by bb) (Oracle 10g)
Why archive should be turned ON before turning on flashback (2 threads merged by bb) [message #469807] Thu, 05 August 2010 20:12 Go to next message
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 Go to previous messageGo to next message
John Watson
Messages: 8932
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 #469844 is a reply to message #469835] Fri, 06 August 2010 02:14 Go to previous messageGo to next message
Michel Cadot
Messages: 68653
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
There are many flashback features that depend on different things:
- flashback database that allows to put the database in state it was before without having to restore and recover it and relies on flashback logs
- flashback drop that allows to retrieve a dropped table and relies on recycle bin
- flashback table that allows to put back the data in a table as they were back in the past and relies on undo data
- flashback query that allows to query the data as they were in the past and relies on undo data (and archived ones in 11g)
- flashback version query that allows to retrieve all the versions of the data of a table and relies on undo data
- flashback transaction query that allows a DBA to know the transaction stream on a table and relies on undo data.

Regards
Michel
Re: Why archive should be turned ON before turning on flashback (2 threads merged by bb) [message #469850 is a reply to message #469807] Fri, 06 August 2010 02:23 Go to previous messageGo to next message
Yasir Hashmi
Messages: 304
Registered: April 2006
Senior Member
Yes,
As flashback logs and undo data are all independent of archivelogs,there should not be any need to put the database in archivelog.
Re: Why archive should be turned ON before turning on flashback (2 threads merged by bb) [message #469853 is a reply to message #469850] Fri, 06 August 2010 02:30 Go to previous messageGo to next message
Michel Cadot
Messages: 68653
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
It depends on the question, you must be in archivelog mode to be able to activate flashback logs/database.

Regards
Michel

Re: Why archive should be turned ON before turning on flashback (2 threads merged by bb) [message #469870 is a reply to message #469853] Fri, 06 August 2010 03:25 Go to previous messageGo to next message
Yasir Hashmi
Messages: 304
Registered: April 2006
Senior Member
The question is :
Why do we need to put database in archivelog mode for activating flashback technology?
Re: Why archive should be turned ON before turning on flashback (2 threads merged by bb) [message #469875 is a reply to message #469870] Fri, 06 August 2010 03:53 Go to previous messageGo to next message
Michel Cadot
Messages: 68653
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
The answer is: because Oracle requires it (but only for database flashback). Wink

Regards
Michel
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 Go to previous messageGo to next message
John Watson
Messages: 8932
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.
Re: Why archive should be turned ON before turning on flashback (2 threads merged by bb) [message #469927 is a reply to message #469889] Fri, 06 August 2010 07:54 Go to previous message
Yasir Hashmi
Messages: 304
Registered: April 2006
Senior Member
So what version of block does flashback logs contain?
Previous Topic: To check tables located in which datafiles
Next Topic: Redo log generation
Goto Forum:
  


Current Time: Sun May 19 23:16:16 CDT 2024