11g feature: Flashback Data Archive Guide. (Doc ID 470199.1)
文章簡單介紹了FDA,如何配置和使用FDA
Purpose
What is FDA (Flashback Data Archive) ?
How to enable Flashback Data Archive features?
What is the role of the new background process FBDA?
What is the Flashback Data Archive Workflow an Example?
How to configure a Default Flashback Data Archive as Example?
Scope
This feature can be used by DBA's and Support Analysts to understand and
configure Flashback Data Archive
Details
FDA的中文可以翻譯為閃回資料歸檔
What is FDA (Flashback Data Archive) ?
A new database object, a flashback data archive is a logical container for storing historical information. It is stored in one or more tablespaces and tracks the history for one or more tables.
FDA,一個新的資料庫物件,是一個用來儲存歷史資料資訊的邏輯容器。FDA儲存在一個或者多個表空間中,可以跟蹤多個錶的歷史資料,儲存一定的時限。
You specify retention duration for each flashback data archive (could be # of years).
SQL> create flashback archive fla1 tablespace tbs1 retention 2 year;
---上述SQL建立一個 FDA物件fla1,使用表空間tbs1 來儲存歷史資料,資料保留2年
With the "Oracle Total Recall" option, Oracle database 11g has been specifically enhanced to track history with minimal performance impact and to store historical data in compressed form to minimize storage requirements, completely transparent to applications, easy to setup . This efficiency cannot be duplicated by your own triggers, which also cost time and effort to set up and maintain.
To satisfy long-retention requirements that exceed the undo retention, create a flashback data archive.
How to enable Flashback Data Archive features?
To satisfy long-retention requirements, use flashback data archives. Begin with the following steps:
# For your archive administrator:
1:Create one or more tablespaces for data archives and grant QUOTA on the tablespaces.
2: Grant the FLASHBACK ARCHIVE ADMINISTER system privilege to create and maintain flashback archives.
# For archive users:
Grant the FLASHBACK ARCHIVE object privilege (to enable history tracking for specific tables in the given flashback archives).
>SCOTT (Archive user)
SQL> alter table emp flashback archive fla1;
alter table emp flashback archive fla1
*
ERROR at line 1:
ORA-55620: No privilege to use Flashback Archive
As SYS use or Archive Administrator (who granted FLASHBACK ARCHIVE ADMINISTER system privilege)
SQL> grant flashback archive on fla1 to scott;
Grant succeeded
Note:
Grant the FLASHBACK ARCHIVE ADMINISTER system privilege to your archive administrator,to allow execution of the following statements:
- CREATE FLASHBACK ARCHIVE
- ALTER FLASHBACK ARCHIVE
- DROP FLASHBACK ARCHIVE
What is the role of the new background process FBDA?
The Flashback Data Archive background process, FBDA, starts with the database.
1. FBDA operates first on the undo in the buffer cache.
2. In case the undo has already left the buffer cache, FBDA could also read the required values from the undo segments.
3. FBDA consolidates the modified rows of flashback archive???enabled tables and writes them into the appropriate history tables, which make up the flashback data
archive.
You can find the internally assigned names of the history tables by querying the *_FLASHBACK_ARCHIVE_TABLES view. History tables are compressed and internally partitioned. The database automatically purges all historical information on the day after the retention period expires. (It deletes the data, but does not destroy the flashback data archive.) For example, if the retention period is 10 days, then every day after the tenth day, the oldest information is deleted; thus
leaving only 10 days of information in the archive. This is a way to implement digital shredding.
Waht is the Flashback Data Archive Workflow an Exmaple?
1. Create the flashback data archive:
The archive administrator creates a flashback data archive named fla1, which uses up to unlimited of the tbs1 tablespace and whose data will be retained for two years. If you want to set up your database so that information in the fla1 is automatically deleted, the day after 2 years is complete.
SQL> create flashback archive fla1 tablespace tbs1 retention 2 year; << data will be retained for 2 years.!
Flashback archive created.
2- Grant Flashback Archive objects privilege on Flashback data archive (fla1) to Archive User (SCOTT).
SQL> grant flashback archive on fla1 to Scott;
Grant succeeded
3- Enable history tracking for a table in the FLA1 archive:
????As Flashback Archive User (SCOTT)
SQL> alter table EMP flashback archive fla1;
Table altered.
4- View the historical data:
SQL> select to_timestamp(sysdate) from dual;
TO_TIMESTAMP(SYSDATE)
---------------------------------------------------------------------------
02-DEC-07 12.00.00 AM
SQL> alter table EMP flashback archive fla1;
Table altered.
SQL> update emp set sal=sal+100 where empno=7788;
1 row updated.
SQL> select sal from emp as of timestamp to_timestamp('2007-12-02 00:00:00','yyyy-mm-dd hh24:mi:ss') 3 where empno=7788;
SAL
----------
3100
SQL> select sal from emp where empno=7788;
SAL
----------
3200
Note:
To use the flashback_archive_clause to enable/disable historical tracking for the table, you must have the FLASHBACK ARCHIVE ADMINISTER system privilege or you must be logged in as SYSDBA.
Flashback archiving is handled by fbda background process, and it checks for tablespace quota every 1 hour. If you run out of flashback archival space and must extend the tablespace you may also need to reset the quota for the tablespace.
總結下步驟如下:
---step1 create tablespace for FDA, this is optional,but recommened
create tablespace fdatbs
datafile '/u01/app/oradata/ORCL/flashbackarchive.dbf'
size 100M autoextend on maxsize 1G;
---step2 create FDA
create flashback archive fdone
tablespace fdatbs quota 900M retention 2 year;
--step3 grant privilege to user ANDREW
grant flashback archive on fdone to ANDREW;
--step4 enable track table emp
alter table andrew.emp flashback archive fdone;
--step5 do-some-DML to emp and then view historical data
begin
update andrew.emp e set e.sal=20000 where e.ename='KING';
commit;
end;
/
select empno,ename,job,mgr,hiredate,sal,comm,deptno
from andrew.emp
as of timestamp systimestamp-interval '10' minute
where ename='KING';
Purpose
What is FDA (Flashback Data Archive) ?
How to enable Flashback Data Archive features?
What is the role of the new background process FBDA?
What is the Flashback Data Archive Workflow an Example?
How to configure a Default Flashback Data Archive as Example?
Scope
This feature can be used by DBA's and Support Analysts to understand and
configure Flashback Data Archive
Details
FDA的中文可以翻譯為閃回資料歸檔
What is FDA (Flashback Data Archive) ?
A new database object, a flashback data archive is a logical container for storing historical information. It is stored in one or more tablespaces and tracks the history for one or more tables.
FDA,一個新的資料庫物件,是一個用來儲存歷史資料資訊的邏輯容器。FDA儲存在一個或者多個表空間中,可以跟蹤多個錶的歷史資料,儲存一定的時限。
You specify retention duration for each flashback data archive (could be # of years).
SQL> create flashback archive fla1 tablespace tbs1 retention 2 year;
---上述SQL建立一個 FDA物件fla1,使用表空間tbs1 來儲存歷史資料,資料保留2年
With the "Oracle Total Recall" option, Oracle database 11g has been specifically enhanced to track history with minimal performance impact and to store historical data in compressed form to minimize storage requirements, completely transparent to applications, easy to setup . This efficiency cannot be duplicated by your own triggers, which also cost time and effort to set up and maintain.
To satisfy long-retention requirements that exceed the undo retention, create a flashback data archive.
How to enable Flashback Data Archive features?
To satisfy long-retention requirements, use flashback data archives. Begin with the following steps:
# For your archive administrator:
1:Create one or more tablespaces for data archives and grant QUOTA on the tablespaces.
2: Grant the FLASHBACK ARCHIVE ADMINISTER system privilege to create and maintain flashback archives.
# For archive users:
Grant the FLASHBACK ARCHIVE object privilege (to enable history tracking for specific tables in the given flashback archives).
>SCOTT (Archive user)
SQL> alter table emp flashback archive fla1;
alter table emp flashback archive fla1
*
ERROR at line 1:
ORA-55620: No privilege to use Flashback Archive
As SYS use or Archive Administrator (who granted FLASHBACK ARCHIVE ADMINISTER system privilege)
SQL> grant flashback archive on fla1 to scott;
Grant succeeded
Note:
Grant the FLASHBACK ARCHIVE ADMINISTER system privilege to your archive administrator,to allow execution of the following statements:
- CREATE FLASHBACK ARCHIVE
- ALTER FLASHBACK ARCHIVE
- DROP FLASHBACK ARCHIVE
What is the role of the new background process FBDA?
The Flashback Data Archive background process, FBDA, starts with the database.
1. FBDA operates first on the undo in the buffer cache.
2. In case the undo has already left the buffer cache, FBDA could also read the required values from the undo segments.
3. FBDA consolidates the modified rows of flashback archive???enabled tables and writes them into the appropriate history tables, which make up the flashback data
archive.
You can find the internally assigned names of the history tables by querying the *_FLASHBACK_ARCHIVE_TABLES view. History tables are compressed and internally partitioned. The database automatically purges all historical information on the day after the retention period expires. (It deletes the data, but does not destroy the flashback data archive.) For example, if the retention period is 10 days, then every day after the tenth day, the oldest information is deleted; thus
leaving only 10 days of information in the archive. This is a way to implement digital shredding.
Waht is the Flashback Data Archive Workflow an Exmaple?
1. Create the flashback data archive:
The archive administrator creates a flashback data archive named fla1, which uses up to unlimited of the tbs1 tablespace and whose data will be retained for two years. If you want to set up your database so that information in the fla1 is automatically deleted, the day after 2 years is complete.
SQL> create flashback archive fla1 tablespace tbs1 retention 2 year; << data will be retained for 2 years.!
Flashback archive created.
2- Grant Flashback Archive objects privilege on Flashback data archive (fla1) to Archive User (SCOTT).
SQL> grant flashback archive on fla1 to Scott;
Grant succeeded
3- Enable history tracking for a table in the FLA1 archive:
????As Flashback Archive User (SCOTT)
SQL> alter table EMP flashback archive fla1;
Table altered.
4- View the historical data:
SQL> select to_timestamp(sysdate) from dual;
TO_TIMESTAMP(SYSDATE)
---------------------------------------------------------------------------
02-DEC-07 12.00.00 AM
SQL> alter table EMP flashback archive fla1;
Table altered.
SQL> update emp set sal=sal+100 where empno=7788;
1 row updated.
SQL> select sal from emp as of timestamp to_timestamp('2007-12-02 00:00:00','yyyy-mm-dd hh24:mi:ss') 3 where empno=7788;
SAL
----------
3100
SQL> select sal from emp where empno=7788;
SAL
----------
3200
Note:
To use the flashback_archive_clause to enable/disable historical tracking for the table, you must have the FLASHBACK ARCHIVE ADMINISTER system privilege or you must be logged in as SYSDBA.
Flashback archiving is handled by fbda background process, and it checks for tablespace quota every 1 hour. If you run out of flashback archival space and must extend the tablespace you may also need to reset the quota for the tablespace.
總結下步驟如下:
---step1 create tablespace for FDA, this is optional,but recommened
create tablespace fdatbs
datafile '/u01/app/oradata/ORCL/flashbackarchive.dbf'
size 100M autoextend on maxsize 1G;
---step2 create FDA
create flashback archive fdone
tablespace fdatbs quota 900M retention 2 year;
--step3 grant privilege to user ANDREW
grant flashback archive on fdone to ANDREW;
--step4 enable track table emp
alter table andrew.emp flashback archive fdone;
--step5 do-some-DML to emp and then view historical data
begin
update andrew.emp e set e.sal=20000 where e.ename='KING';
commit;
end;
/
select empno,ename,job,mgr,hiredate,sal,comm,deptno
from andrew.emp
as of timestamp systimestamp-interval '10' minute
where ename='KING';
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/21754115/viewspace-1179133/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【FLASHBACK】Oracle flashback data archive 介紹OracleHive
- Flashback Data Archive原理詳解Hive
- How To Replicate Data from Oracle to Postgres Using GoldenGate (Doc ID 1544137.1OracleGo
- 7.90 FEATURE_ID
- 12c DG新特性 - Active Data Guard Far Sync (Doc ID 2179719.1)
- 【DATAGUARD】Data Guard 12C 新特性:Far Sync Standby (Doc ID 2179719.1)
- v$archive_dest dataguard ORA-00439: feature not enabledHive
- Oracle 最新PSU (Doc ID 2118136.2)Oracle
- expdp/impdp變慢 (Doc ID 2469587.1)
- Reading and Understanding Systemstate Dumps (Doc ID 423153.1)
- RMAN -- Frequently Asked Question (FAQ) (Doc ID 469777.1)
- Oracle 下載最新psu (Doc ID 2118136.2)Oracle
- PRCT-1011 : Failed to run "oifcfg" (Doc ID 1380183.1)AI
- How to Collect Diagnostics for Database Hanging Issues (Doc ID 452358.1)Database
- [轉帖]Release Schedule of Current Database Releases (Doc ID 742060.1)Database
- 【CURSOR】How to Monitor and tune Open and Cached Cursors (Doc ID 1430255.1)
- oracle 11g data guard維護Oracle
- Oracle Data Guard Feature 12cR2系列(二)Oracle
- Oracle Data Guard Feature 12cR2系列(一)Oracle
- Physical Standby Switchover_status Showing Not Allowed. (Doc ID 1392763.1)
- oracle11g: Scheduler Maintenance Tasks or Autotasks (Doc ID 756734.1)OracleAINaN
- 【DBA】Relinking Oracle Home 常見問題 (Doc ID 2048232.1)Oracle
- QGRL: Quaternion Graph Representation Learning for Heterogeneous Feature Data Clustering翻譯
- ES 筆記三十五:排序及 Doc Values & Field Data筆記排序
- 11g-Reduce Transportable Tablespace Downtime using XTTS (Doc ID 1389592.1)TTS
- Oracle Data Pump 11G 資料泵元件Oracle元件
- Can GoldenGate Replicate An Oracle Table That Contains Only CLOB Column(s)? (Doc ID 971833.1)GoOracleAI
- 【GRID】Grid Infrastructure 啟動的五大問題 (Doc ID 1526147.1)ASTStruct
- ORA-04063: package body SYS.DBMS_REGISTRY_SYS has errors (Doc ID 2165402.1)PackageError
- Spring Data JDBC: 對映無ID列的表SpringJDBC
- 【Flashback】Flashback Drop閃回刪除功能實驗
- 【ASM】ORA-27504 ORA-27300 ORA-27303 while starting ASM (Doc ID 2281441.1)ASMWhile
- 【RAC】Oracle 12c以及以上版本的diagsnap是什麼? (Doc ID 2469643.1)Oracle
- Flashback Query(轉)
- 【Flashback】Flashback Database閃回資料庫功能實驗Database資料庫
- Swift iOS : ArchiveSwiftiOSHive
- sqlserver docSQLServer
- ORACLE Flashback Query偽列Oracle
- 2.6.2 Overview of Flashback PDB in a CDBView