/******flashback archive*****/
http://docs.oracle.com/cd/E11882_01/server.112/e26088/statements_1008.htm#SQLRF20009
http://docs.oracle.com/cd/E11882_01/server.112/e26088/statements_5010.htm#BABIAECC
/***示例*****/
SQL> create flashback archive test_flashback tablespace tbs_16k quota 100 M retention 1 day;
Done
SQL> create table t_flashback(a int);
Table created
SQL> insert into t_flashback values(1);
1 row inserted
SQL> commit;
Commit complete
SQL> select current_scn from v$database;
CURRENT_SCN
-----------
11451980
/***此语法仅适用于默认的flashback archive****/
SQL> alter table t_flashback flashback archive;
alter table t_flashback flashback archive
ORA-55608: Default Flashback Archive does not exist
/*** 指定flashback archive***/
SQL> alter table t_flashback flashback archive test_flashback;
Table altered
SQL> insert into t_flashback values(2);
1 row inserted
SQL> commit;
Commit complete
/***flashback to before time***/
SQL> select * from t_flashback as of scn 11451980;
A
---------------------------------------
1
SQL> select current_scn from v$database;
CURRENT_SCN
-----------
11452186
/***ddl操作*****/
SQL> alter table t_flashback add b int;
Table altered
SQL> select * from t_flashback;
A B
--------------------------------------- ---------------------------------------
1
2
/***cross ddl依旧可以flashback to before time*****/
SQL> select * from t_flashback as of scn 11451980;
A
----------
1
/***下附一些各项操作语法****/
The next statement alters the default flashback data archive to extend the retention period to 1 month:
ALTER FLASHBACK ARCHIVE test_archive1
MODIFY RETENTION 1 MONTH;
The next statement specifies tracking for the oe.customers table. The flashback data archive is not specified, so data will be archived in the default flashback data archive, test_archive1:
ALTER TABLE oe.customers
FLASHBACK ARCHIVE;
The next statement specifies tracking for the oe.orders table. In this case, data will be archived in the specified flashback data archive, test_archive2:
ALTER TABLE oe.orders
FLASHBACK ARCHIVE test_archive2;
The next statement drops test_archive2 flashback data archive:
DROP FLASHBACK ARCHIVE test_archive2
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/9240380/viewspace-757602/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/9240380/viewspace-757602/