Chinaunix首页 | 论坛 | 博客
  • 博客访问: 103545655
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类: Sybase

2008-05-17 22:13:55

  来源:

◆此处选择SCN向前恢复

SQL> select count(*) from hs_passport as of scn 12929970422;

  COUNT(*)
----------
    861686

◆尝试多个SCN,获取最佳值(注释:如果可以得知具体,那样则可以获得的数据闪回)

SQL> select count(*) from hs_passport as of scn &scn;
Enter value for scn: 12929941968
old   1: select count(*) from hs_passport as of scn &scn
new   1: select count(*) from hs_passport as of scn 12929941968

  COUNT(*)
----------
    861684

SQL> /
Enter value for scn: 12927633776
old   1: select count(*) from hs_passport as of scn &scn
new   1: select count(*) from hs_passport as of scn 12927633776
select count(*) from hs_passport as of scn 12927633776
                     *
ERROR at line 1:
ORA-01466: unable to read data - table definition has changed


SQL> /
Enter value for scn: 12929928784
old   1: select count(*) from hs_passport as of scn &scn
new   1: select count(*) from hs_passport as of scn 12929928784

  COUNT(*)
----------
    825110

SQL> /
Enter value for scn: 12928000000
old   1: select count(*) from hs_passport as of scn &scn
new   1: select count(*) from hs_passport as of scn 12928000000
select count(*) from hs_passport as of scn 12928000000
                     *
ERROR at line 1:
ORA-01466: unable to read data - table definition has changed

◆注意:最后选择恢复到SCN为12929941968的时间点

SQL> 
insert into hs_passport_recov 
select * from hs_passport as of scn 12929941968;

861684 rows created.

SQL> commit;

Commit complete.

注释:至此,则可以满足需要,找回误删除的部分数据,闪回恢复成功。

阅读(890) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~