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. MySql 小记

    MySql  简单 小记 以备查看 1.sql概述 1.什么是sql? 2.sql发展过程? 3.sql标准与方言的关系? 4.常用数据库? 5.MySql数据库安装? 2.关键概念 表结构----- ...

  2. 【转】TCP/IP协议栈及OSI参考模型详解

    OSI参考模型 OSI RM:开放系统互连参考模型(open systeminterconnection reference model) OSI参考模型具有以下优点: 简化了相关的网络操作: 提供设 ...

  3. Windows下LATEX排版论文攻略—CTeX、JabRef使用介绍

    Windows下LATEX排版论文攻略—CTeX.JabRef使用介绍 一.工具介绍 TeX是一个很好排版工具,在学术界十分流行,特别是数学.物理学和计算机科学界. CTeX是TeX中的一个版本,指的 ...

  4. Django基础,Day6 - 单元测试tests

    在django项目app目录下,有个tests.py,我们通常可以直接在这文件中写我们的单元测试代码. test for a model 根据前面章节的操作步骤下来,在Question Model中有 ...

  5. 利用JS判断是否手机或pad访问

    <script type="text/javascript"> /* * 智能机浏览器版本信息: * */ var browser={ versions:functio ...

  6. 我的第一个wcf

    vs2012中新建一个解决方案 新建WCF项目RestApi 添加实体类 [DataContract] public class Employee { private Guid id; private ...

  7. 请注意,再次记住, centos7,fedora 24中 没有iptables服务, 而使用的firewalld, 也可以安装 iptables-services程序来实现

    原来写了一篇文章的, 忘了: http://www.cnblogs.com/bkylee/p/5837481.html 可以用 firewall-cmd 这个命令来管理 防火墙...

  8. 2016百度之星 资格赛ABCDE

    看题:http://bestcoder.hdu.edu.cn/contests/contest_show.php?cid=690 交题:http://acm.hdu.edu.cn/search.php ...

  9. RabbitMQ修改端口号和心跳时间

    定读者正在Windows系列的操纵体系中装置好了Rabbit MQ后,请找到装置途径下的etc文件夹下,将rabbitmq.config.example备份一份,并点窜为config范例的文件,即为] ...

  10. Java动态加载JAR包

    参考代码: package org; import java.io.File; import java.net.URL; import java.net.URLClassLoader; import ...