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. Jmeter响应内容为文件

    最近测试一个接口是文档转换的接口,比如说把rtf文件转换为PDF,这样的接口调用通过结果树只能查看接口响应是否成功,但是看不到转换后的文档.通过Jmeter监听中的Save Responses to  ...

  2. QT下调试基于ros的catkin项目

    1.首先告诉qt ros的搜索路径,通过修改qt creator 桌面启动程序来实现 sudo    gedit ~/.local/share/applications/DigiaQtOpenSour ...

  3. android开发注意事项

    写到哪里算哪里,从新项目 说说我怎样开发 1.新建项目,创建自己的application 在Application中初始化xutils3和自己的UncaughtExceptionHandler,添加 ...

  4. jQuery 中 jQuery(function(){})与(function(){})(jQuery) 的区别

    $(document).ready(function(){ // 在这里写你的代码... }); 在DOM加载完成时运行的代码 可以简写成 jQuery(function(){ // 在这里写你的代码 ...

  5. DEDEcms 在php5.4以上 后台登录空白解决办法

    本次环境php5.5 首先确定 dede data文件夹已经有写入权限 775 777都可以 然后再远程桌面或者FTP修改 include/userlogin.class.php 文件 注释掉下面六句 ...

  6. 关于编写性能高效的javascript事件的技术

    如何能做出高效的web前端程序是我每次做前端开发都会不自觉去考虑的问题.几年前雅虎里牛逼的前端工程师们出了一本关于提升web前端性能的书籍,轰动了整个web开发技术界,让神秘的web前端优化问题成为了 ...

  7. 实战动态PDF在线预览及带签名的PDF文件转换

    开篇语: 最近工作需要做一个借款合同,公司以前的合同都是通过app端下载,然后通过本地打开pdf文件,而喜欢创新的我,心想着为什么不能在线H5预览,正是这个想法,说干就干,实践过程总是艰难的,折腾了3 ...

  8. Python中的if __name__='__main__'语句的作用

    笔者在自学Python的过程中,对于if __name__='__main__'的用法感到很困惑,在think Python一书中原作者的源代码是这么解释if __name__='__main__'语 ...

  9. 【原创】CSS高效开发实战:CSS 3、LESS、SASS、Bootstrap、Foundation --读书笔记(5)使用放射渐变制作光影效果

    阴影效果通常用来表现光线投射在物体上的感觉,如果想制作一个如图5.19所示的文字光影效果,就可以使用背景的线性渐变进行构建. 图5.19可以看到有类似光束照射文字的效果,很好地突出了文字.这实现起来很 ...

  10. 第3月第19天 cxx_destruct dispatch_get_main_queue()死锁

    1. http://blog.jobbole.com/65028/ 2. - (void)viewDidLoad { [super viewDidLoad]; NSLog("); dispa ...