oracle11g flashback archive feature新特性

/******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/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值