Flashback Data Archive feature is part of Oracle Total Recall technology. Flashback Data Archive feature lets you to track changes made in any number of tables for any given retention time. The retention time can be some days or months or years.

Flashback data archives retain historical data for the time duration specified using the RETENTIONparameter. Historical data can be queried using the Flashback Query AS OF clause. Archived historic data that has aged beyond the specified retention period is automatically purged.

This feature is supported only Oracle 11g Enterprise Edition. It is not available in Standard or Express editions.

Lets see an example.

Step 1:- Create Flashback data archive tablespace.

  1. SQL> select * from v$version;
  2. BANNER
  3. --------------------------------------------------------------------------------
  4. Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
  5. PL/SQL Release 11.2.0.4.0 - Production
  6. CORE 11.2.0.4.0 Production
  7. TNS for Linux: Version 11.2.0.4.0 - Production
  8. NLSRTL Version 11.2.0.4.0 - Production
  9. SQL> create tablespace FB_Storage datafile '/u01/app/oracle11g/oradata/DB11/datafile/fdstore.dbf'
  10. 2 size 100m autoextend on segment space management auto;
  11. Tablespace created.

Step 2:- Create Flashback Archive

  1. SQL> create flashback archive default FB_Arch1 tablespace FB_Storage quota 1g retention 1 year;
  2. Flashback archive created.

Step 3:- Turn on Flashback archive for tables you want to track.

For Example to enable flashback archive for table Scott.emp

(i) Grant Flashback archive privilege

  1. SQL> grant flashback archive on fb_arch1 to scott;
  2. Grant succeeded.
  3. SQL> connect scott/tiger
  4. Connected.

(ii) Enable flashback archive for table

  1. SQL> alter table emp flashback archive;
  2. Table altered.

Step 4:- Flashback Example.

Suppose a user has deleted rows from emp by giving a delete statement like this

  1. SQL> set time on
  2. 19:57:32 SQL> select * from emp;
  3. DEPTNO DNAME LOC
  4. ---------- -------------- -------------
  5. 20 RESEARCH DALLAS
  6. 30 SALES CHICAGO
  7. 40 OPERATIONS BOSTON
  8. 19:57:56 SQL>
  9. 19:57:59 SQL>
  10. 19:57:59 SQL>
  11. 19:57:59 SQL>
  12. 19:57:59 SQL> delete from emp where deptno=30;
  13. 1 row deleted.
  14. 19:58:25 SQL> commit;
  15. Commit complete.

To View the state of table emp 10 minutes before

  1. 19:58:29 SQL> select * from emp as of timestamp sysdate - 10 / (24*60);
  2. DEPTNO DNAME LOC
  3. ---------- -------------- -------------
  4. 10 ACCOUNTING NEW YORK
  5. 20 RESEARCH DALLAS
  6. 30 SALES CHICAGO
  7. 40 OPERATIONS BOSTON

Versions Query (11gR2 only) (To see what changes are made to Emp No. 7902 between last 15 minutes

  1. 22:18:34 SQL> select * from emp versions between
  2. timestamp sysdate- 15 /(24*60) and sysdate
  3. where empno=7902;

Flashback Data Archive ( Oracle Total Recall ) introduced in 11g的更多相关文章

  1. oracle闪回、闪回数据归档Flashback Data Archive (Oracle Total Recall)的真正强大之处、11gR2增强以及合理使用

    oracle的闪回很早就出来了,准确的说一直以来应该都较少被真正用户广为使用,除了dba和极少部分开发人员偶尔用于逻辑出错.误删恢复之外,较少被用于产生更有价值的用途. 各种闪回表flashback ...

  2. oracle flashback data archive闪回数据归档天坑之XID重用导致闪回查询数据重复

    我们有个系统使用了Oracle flashback data archive闪回数据归档特性来作为基于时间点的恢复机制,在频繁插入.更新期间发现SYS_FBA_HIST_NNNN表中的XID被两个事务 ...

  3. flashback data archive (转)

    闪回数据归档(Flashback Data Archive) 在Oracle 11g当中,对闪回技术再次进行了扩展,提供了一个全新的flashback方式,称之为闪回数据归档,本节我们将对闪回数据归档 ...

  4. [每日一题] 11gOCP 1z0-053 :2013-09-29 Flashback Data Archive ...................................6

    转载请注明出处:http://blog.csdn.net/guoyjoe/article/details/12205299 正确答案:A 具体请参考:http://blog.csdn.net/guoy ...

  5. 11G新特性 -- flashback data archive(2)

    创建Flashback Data Archive用户需要授予dba或flashback archive administer系统特权.flashback archive administer系统特权包 ...

  6. 11G新特性 -- flashback data archive(1)

    虽然可以依赖undo数据来查询row的旧版本数据,甚至可以执行逻辑恢复.但是你不能期待在undo中找到非常旧的数据.undo数据主要是用来提供读一致性. 在11G中,提供了Flashback Data ...

  7. 闪回之 Flashback Data Archive

    背景:Oracle 11g 中 Flashback Data Archive 特性.将变化数据另外存储到创建的闪回归档区(Flashback Archive)中,以和 undo 区别开来,这样就可以为 ...

  8. [每日一题] 11gOCP 1z0-053 :2013-10-11 Flashback Data Archive属性.........................43

    转载请注明出处:http://blog.csdn.net/guoyjoe/article/details/12656897 正确答案:BD 闪回数据归档请参考:http://blog.csdn.net ...

  9. Oracle 闪回归档(Flashback Data Archive)

    --检查权限 SELECT * FROM dba_sys_privs WHERE privilege LIKE '%FLASH%'; --设置权限 GRANT dba TO testuser;--设置 ...

随机推荐

  1. 精通css 高级web标准解决方案——可视化格式模型-定位模型

    CSS 中有三种定位机制:普通流.浮动.绝对定位.(默认为普通流) 改变文档流:display: inline-block; (支持到ie8及以上) 1-匿名块框: <div> 你好! & ...

  2. QQ远程桌面的使用

    腾讯QQ怎样使用远程桌面: ---------------------- ----------------------

  3. 为什么不用rxjava?

    rxjava等系列产品.思想是很好的,但是被大多数人用成了一坨屎! 就拿rx最经典的那个例子来说: 假设有这样一个需求:界面上有一个自定义的视图 imageCollectorView ,它的作用是显示 ...

  4. Linux知识:/root/.bashrc与/etc/profile的异同

    Linux知识:/root/.bashrc与/etc/profile的异同 要搞清bashrc与profile的区别,首先要弄明白什么是交互式shell和非交互式shell,什么是login shel ...

  5. CSS的选择器

    <div id="demo"> <div class="inner"> <p><a href="#" ...

  6. Ubuntu Server 14.04 集成

    方便工作出差显示项目整合了下平时常用软件: OS: Ubuntu Server 14.04 VM:VMware Workstation 12.1.0 (不同版本好像会不兼容) 已经安装软件: 1. s ...

  7. permission denied to create extension "hstore"解决方案

    首先 sudo -u postgres psql postgres 进入数据库后输入命令 ALTER USER mydb_user WITH SUPERUSER;        (把某个用户设置为超级 ...

  8. D3.js学习(四)

    上一节我们已经学习了线条样式和格栅的绘制,在这一节中我们将要根据之前绘制的线条对图表进行填充,首先来看一下我们的目标吧 在这个图表中,我们对位于线条下面的空间进行了填充,那么,如何改做到呢? 设置填充 ...

  9. ResultSet can not re-read row data for column 1.

    error:ResultSet can not re-read row data for column 1. 将数据类型改为varchar(max)后,查询数据错误 改正:将jdbc驱动改为jtds驱 ...

  10. Web干货存档

    今天看了某乎,介绍了web一些基本东西,讲的很好,随手留下https://www.zhihu.com/question/22689579 web开发者文档,纯干货   https://develope ...