............just a fucking note book !!!

Flashback table

上一篇 / 下一篇  2008-06-12 22:33:19

Flashback table

 

22:18:24 scan@LEE>conn scott/tiger

已连接。

22:18:30 scott@LEE>create table test_two

22:19:13  2 (id int)

22:19:19  3 tablespace spring;

 

表已创建。

 

已用时间: 00: 00: 00.04

22:19:23 scott@LEE>insert into test_one values(1);

insert into test_one values(1)

           *

1行出现错误:

ORA-00942:表或视图不存在

 

 

已用时间: 00: 00: 00.03

22:19:38 scott@LEE>insert into test_two values(1);

 

已创建1行。

 

已用时间: 00: 00: 00.10

22:19:48 scott@LEE>insert into test_two values(2);

 

已创建1行。

 

已用时间: 00: 00: 00.00

22:19:51scott@LEE>commit;

 

提交完成。

 

已用时间: 00: 00: 00.00

22:19:54 scott@LEE>alter session set nls_date_format='yyyy-mm-dd:hh24:mi:ss';

 

会话已更改。

 

已用时间: 00: 00: 00.01

22:20:08 scott@LEE>insert into test_two values(21);

 

已创建1行。

 

已用时间: 00: 00: 00.00

22:20:15 scott@LEE>insert into test_two values(22);

 

已创建1行。

 

已用时间: 00: 00: 00.00

22:20:20 scott@LEE>commit

22:20:28  2 ;

 

提交完成。

 

已用时间: 00: 00: 00.00

22:20:29 scott@LEE>select *from test_two;

 

       ID

----------

        1

        2

       21

       22

 

已用时间: 00: 00: 00.00

22:20:42scott@LEE>flashback table test_two to timestamp

22:21:05  2 to_timestamp('2008-06-12 22:19:38','yyyy-mm-dd hh24:mi:ss');

flashback table test_two to timestamp

               *

1行出现错误:

ORA-08189:因为未启用行移动功能,不能闪回表

 

 

已用时间: 00: 00: 00.04

22:21:39 scott@LEE>alter table test_two enable row movement;

 

表已更改。

 

已用时间: 00: 00: 00.03

22:22:09 scott@LEE>flashback table test_two to timestamp

22:22:14  2 to_timestamp('2008-06-1222:19:38','yyyy-mm-dd hh24:mi:ss');

 

闪回完成。

 

已用时间: 00: 00: 00.45

22:22:17 scott@LEE>select * from test_two;

 

未选定行              //回闪到没插入数据之前,显示空,正确!

 

已用时间: 00: 00: 00.01

22:22:29 scott@LEE>flashback table test_two to timestamp

22:22:47  2 to_timestamp('2008-06-1222:19:51','yyyy-mm-dd hh24:mi:ss');

 

闪回完成。

 

已用时间: 00: 00: 00.18

22:22:53 scott@LEE>select *from test_two;

 

未选定行            //回闪到第一次提交,未显示任何数据,说明commit是需要时间的!

 

已用时间: 00: 00: 00.00

22:23:01 scott@LEE>flashback table test_two to timestamp

22:23:08  2 to_timestamp('2008-06-12 22:20:15','yyyy-mm-dd hh24:mi:ss');

 

闪回完成。

 

已用时间: 00: 00: 00.37

22:23:37 scott@LEE>select *from test_two;

 

       ID

----------

        1

        2

 

已用时间: 00: 00: 00.00

22:23:44 scott@LEE>flashback table test_two to timestamp

22:23:52  2 to_timestamp('2008-06-12 22:20:40','yyyy-mm-dd hh24:mi:ss');

 

闪回完成。

 

已用时间: 00: 00: 00.40

22:24:19 scott@LEE>select *from test_two;

 

       ID

----------

        1

        2

       21

       22

 

已用时间: 00: 00: 00.01

22:24:29 scott@LEE>


TAG:

spring7777777的个人空间 引用 删除 spring7777777   /   2008-06-30 10:31:00
注意一下:
flashback里面的除了flashback database用的的 回闪日志,其他的都是用到了undo表空间。

-------------》也就是跟commit有关(一句话,除了flashback database,其他的只能回闪dml语句)
 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

我的栏目

日历

« 2008-08-30  
     12
3456789
10111213141516
17181920212223
24252627282930
31      

数据统计

  • 访问量: 254
  • 日志数: 24
  • 建立时间: 2008-06-10
  • 更新时间: 2008-07-02

RSS订阅

Open Toolbar