Flashback Data Archive ( Oracle Total Recall ) introduced in 11g
2015-06-23 18:54
681 查看
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
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.
[/code]Step 2:- Create Flashback Archive
[/code]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
[/code](ii) Enable flashback archive for table
[/code]Step 4:- Flashback Example.
Suppose a user has deleted rows from emp by giving a delete statement like this
[/code]To View the state of table emp 10 minutes before
[/code]Versions Query (11gR2 only) (To see what changes are made to Emp No. 7902 between last 15 minutes
[/code]
来自为知笔记(Wiz)
Flashback data archives retain historical data for the time duration specified using the
RETENTIONparameter. Historical data can be queried using the Flashback Query
AS
OFclause. 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.
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE 11.2.0.4.0 Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production
SQL> create tablespace FB_Storage datafile '/u01/app/oracle11g/oradata/DB11/datafile/fdstore.dbf'
2 size 100m autoextend on segment space management auto;
Tablespace created.
[/code]Step 2:- Create Flashback Archive
SQL> create flashback archive default FB_Arch1 tablespace FB_Storage quota 1g retention 1 year;
Flashback archive created.
[/code]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
SQL> grant flashback archive on fb_arch1 to scott;
Grant succeeded.
SQL> connect scott/tiger
Connected.
[/code](ii) Enable flashback archive for table
SQL> alter table emp flashback archive;
Table altered.
[/code]Step 4:- Flashback Example.
Suppose a user has deleted rows from emp by giving a delete statement like this
SQL> set time on
19:57:32 SQL> select * from emp;
DEPTNO DNAME LOC
---------- -------------- -------------
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
19:57:56 SQL>
19:57:59 SQL>
19:57:59 SQL>
19:57:59 SQL>
19:57:59 SQL>delete from emp where deptno=30;
1 row deleted.
19:58:25 SQL> commit;
Commit complete.
[/code]To View the state of table emp 10 minutes before
19:58:29 SQL> select * from emp as of timestamp sysdate - 10 / (24*60);
DEPTNO DNAME LOC
---------- -------------- -------------
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
[/code]Versions Query (11gR2 only) (To see what changes are made to Emp No. 7902 between last 15 minutes
22:18:34 SQL> select * from emp versions between
timestamp sysdate- 15 /(24*60) and sysdate
where empno=7902;
[/code]
来自为知笔记(Wiz)
相关文章推荐
- Oracle基础1 — sequence 序列
- 脚本 - Oracle10g PSU后升级数据字典(RAC)
- 脚本 - Oracle10g PSU后升级数据字典(单实例)
- 结合使用 Oracle 和 Ruby on Rails 的补充
- oracle10.2.0.4 dbvault 安装篇
- Oracle、MySql、SQLServer 数据分页查询
- 关于win7 x64 连接oracle 客户端 VS2010调试 提示“ORA-12154: TNS: 无法解析指定的连接标识符 ”
- Oracle Flashback Technologies - 闪回查询
- Oracle数据库之动态SQL
- Redhat 5.8 ORACLE 11gR2 RAC安装文档4-grid 安装验证
- oracle表执行更新操作的时候,那些字段被更新了
- Oracle 11g ORA-12514:TNS:监听程序当前无法识别连接描述符中请求的服务
- Oracle Flashback Technologies - 闪回被drop的表
- Oracle Flashback Technologies - 估算不同时间段闪回日志的产生量
- Oracle Latch 管理
- Oracle 11g 分区表
- Oracle 索引组织表 IOT
- Oracle 锁管理
- Oracle Dataguard 基本原理
- Oracle Dataguard 参数详解