11g Oracle Flashback Data Archives

February 13th, 2011 | Posted in 11G, Blog, flashback | 5 Comments


Introduction
With Oracle 11g, Oracle have improved the Flashback technologies and now it’s a solid part of the recovery solutions Oracle provides.
Oracle flashback data archives provides the ability to track changes made on a table over its lifetime.
Now, You can stop using your logging scripts built on previous versions of Oracle, and start using the flashback data archives.The flashback data archives can also be used for data analysis and within a decision support system (DSS) environment.
In this article, we are going to setup the Oracle flashback data archives and then how it can be used.

Before you start
Any user concerned by the flashback data archives must have the flashback archive administer privilege granted.
Grant FLASHBACK ARCHIVE ADMINISTER to WISSEM;

Example
In this example, we create the archive with a retention period of one day (in real world, this retention period may be in term of months, even years).
CAUTION Archives can get quite large. make sure you allocate enough space
1- We first create a flashback data tablespace.
2- We create a test table.
3- We enable the archive data on the test table.

Query the test table using the AS OF clause, specifying a timestamp prior to the delete timestamp.
Then, just to verify that we are using the flashback data archive and not the content of the undo tablespace, we create a new tablespace, make it the default, switch it it the default tablespace and drop the old undo tablespace.

CAUTION If you turn off the data archives using alter table fb_data_archive no flashback archive, you will lose all the historical data for that table. The same happens if you drop or purge all the flash back data archives.
Drop the flash back data archives:
Drop flashback archive default_flash_archive;
Purge all historical data from flash back data archive:
Alter flashback archive default_flash_archive PURGE ALL;

Note that when a table is in data archives mode, certain DDL statements may fail, especially the drop command;

<br />
SQL&amp;gt; alter table fb_data_archive add col number;<br />
Table altered.<br />
SQL&amp;gt; drop table fb_data_archive;<br />
drop table fb_data_archive<br />
*<br />
ERROR at line 1:<br />
&lt;strong&gt;ORA-55610: Invalid DDL statement on history-tracked table&lt;/strong&gt;<br />
SQL&amp;gt; truncate table fb_data_archive;<br />
Table truncated.<br />
SQL&amp;gt; alter table fb_data_archive rename to fb_data_archive_2;<br />
Table altered.<br />
SQL&amp;gt;<br />

To avoid this error, when dropping the table, you must first disable the flashback data archives on this table.

<br />
SQL&amp;gt; alter table fb_data_archive rename to fb_data_archive_2;<br />
Table altered.<br />
SQL&amp;gt; alter table fb_data_archive_2 no flashback archive;<br />
Table altered.<br />
SQL&amp;gt; drop table fb_data_archive_2;<br />
Table dropped.<br />

The Oracle Flashback data archive views
To administer the flashback data archives, you can use one of following views;
- DBA_FLASHBACK_ARCHIVE: All the flashback data archives information.
- USER_FLASHBACK_ARCHIVE: Your flashback data archives information.
- DBA_FLASHBACK_ARCHIVE_TS: All tablespaces related to the flashback data archives.
- DBA_FLASHBACK_ARCHIVE_TABLES: All tables with data archives enabled.
- USER_FLASHBACK_ARCHIVE_TABLES: Your tables with data archives enabled.

Nice reading,

Scridb filter


5 Comments to “11g Oracle Flashback Data Archives”

  1. Shamseer says:

    Nice documentation..Was indeed useful.
    Thanks for sharing

    Regards
    Shamseer

  2. pmarco says:

    Nice, clear & easy-to-read documentation. Thanks

  3. admin says:

    Pedro Marco Ortega says: Good extract. Simple, clear and easy-to-read. Thanks


Leave a Comment





Subscribe


Polls

which oracle topic interests you most?

View Results

Loading ... Loading ...


Oracle Class Tweets


Recent Posts


Recent Comments

  • Ravi: Hi, As above, I want to add a new column in to my production database (11g) that has millions of records but...
  • DACCorp: Thanks bro, it worked! XD
  • accutane: Hello there, just became alert to your blog through Google, and found that it is truly informative. I am...
  • Ayman Mohamed: Thanks for your nice article, it is very helpful
  • Moon: Thanks man you solved my problem. i was facing this error: ORA-19625: error identifying file while rman...
  • James: “To solve the issue, After fixing the /etc/hosts file, origin of this issue. I have deleted HAS, using...
  • Darrell Hanning: Awesome information, and very well presented! Stopped thinking I had screwed up in my migration, and...
  • Osama mustafa: Thanks for sharing, you need to confrim with Oracle Support about modify Hidden Parameter as you know...
  • Jaspreet: Brilliant explanation.
  • Yousuf: Very Nice… Just wanted to check you have done all patching at Node 1 only.. is there any thing need to...
  • Yousuf: Very Nice.. Thanks for sharing.. Once question.. You have executed all commands on Node 1 only.. Is there any...
  • Emir: Thanks… Great article
  • borse firmate: Thank you for another informative blog. The place else may just I am getting that kind of information...
  • leandro: why this parameter is systemwide? could you read from a asm instance from one failure group and from the...
  • Mohammad: paul, we create pfile from target database to source database and later we change database name, and...
  • Muhammad Ikram: Thanks Brother for sharing pearls of knowledge. May ALLAH reward you for this both here and...
  • rgrover: Thanks for the POST. I recently encounter similar issue. Your POST helped.
  • gopalredy: really its very use full to dbas
  • Vivian: This is awesome! Thank you so much!
  • henry zhong: CDB=DB, and PDB=SCHEMA but in a sub dictionary?