Flashback Data Archive ( Oracle Total Recall ) introduced in 11g

时间:2022-02-10 17:10:36

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. tyvj1189 盖房子

    描述 永恒の灵魂最近得到了面积为n*m的一大块土地(高兴ING^_^),他想在这块土地上建造一所房子,这个房子必须是正方形的.但是,这块土地并非十全十美,上面有很多不平坦的地方(也可以叫瑕疵).这些瑕 ...

  2. 将页面打印成excel

    在servlet中调用 try { File fileWrite = new File("D:/Write.xls"); fileWrite.createNewFile(); Ou ...

  3. node代码片段

    /** * Created by Administrator on 2016/8/22 0022. * chat */ var net=require('net'); var chatServer=n ...

  4. ls按时间排序输出文件列表

    文件转自:http://www.2cto.com/os/201303/197829.html ls按时间排序输出文件列表   首先,ls --help查看ls相关的与时间排序相关的参数:   > ...

  5. php函数的引用返回

    <?php function &test(){ static $b = 1; $b += 2; return $b; } $a = &test(); $a =8; $c = te ...

  6. CSS&OpenCurlyDoubleQuote;反转”为LESS

    LESS(官网在此:http://lesscss.net/)的魅力相信大家都已明了,个人认为它最大的魅力在于能够清晰的展现嵌套关系. 针对现有的项目,它的应用难点主要在于—— 何时转换为css,即是否 ...

  7. &lbrack;Linux&rsqb;常用命令与目录全拼

    命令缩写: ls:list(列出目录内容)cd:Change Directory(改变目录)su:switch user 切换用户rpm:redhat package manager 红帽子打包管理器 ...

  8. ASP&period;NET网站中设置404自定义错误页面

    在用ASP.NET WebForm开发一个网站时,需要自定义404错误页面. 做法是这样的 在网站根目录下建立了一个404.html的错误页面,然后在Global.asax文件中,加入如下代码: &l ...

  9. &lbrack;转&rsqb;C&num; 获取系统文件图标

    //获取文件的图标 this.Icon = GetFileIcon(@"c:\gdiplus.dll"); //获取文件夹图标 this.Icon = GetDirectoryIc ...

  10. C&num;控件命名规范

    文档名称: C#控件命名规范 撰写作者: codefly 版本编号: V1.1 C#控件命名规范 一.Data Control 类型 前缀 示例 AccessDataSource ads adsPub ...