Oracle数据库数据恢复、性能优化

找回密码
注册
搜索
热搜: 活动 交友 discuz
发新帖

133

积分

0

好友

17

主题
1#
发表于 2013-1-17 17:16:23 | 查看: 3903| 回复: 2
都在说flashback database 后,以resetlogs打开数据库后,不能向前闪回,只能往后闪回

实验如下:

注意,一旦resetlogs之后,将不能再flashback至resetlogs之前的时间点
我这个实验,好像可以,但如果涉及之后有表空间创建或数据文件添加。估计就不行了。

这是昨天的操作,和时间

17:47:09 sys@TEST10G> create tablespace test_flashback datafile '/u01/oradata/TEST10G/test_flashback.dbf' size 1M ;

Tablespace created.

17:48:59 sys@TEST10G> create table saup.flashback_recover1 tablespace test_flashback as select * from dba_objects where rownum<8000;

Table created.

这是今天的操作和时间
  1. 16:31:03 sys@TEST10G> flashback database to timestamp to_timestamp('2013-01-16 18:00:00','yyyy-mm-dd hh24:mi:ss');

  2. Flashback complete.


  3. 16:31:46 sys@TEST10G> alter database open resetlogs;

  4. Database altered.

  5. 16:32:17 sys@TEST10G> shutdown immediate;

  6. 16:32:49 sys@TEST10G> startup mount

  7. 16:32:57 sys@TEST10G> flashback database to timestamp to_timestamp('2013-01-16 20:00:00','yyyy-mm-dd hh24:mi:ss');

  8. Flashback complete.

  9. 16:33:12 sys@TEST10G> flashback database to timestamp to_timestamp('2013-01-16 17:00:00','yyyy-mm-dd hh24:mi:ss');

  10. Flashback complete.

  11. 16:33:59 sys@TEST10G> flashback database to timestamp to_timestamp('2013-01-16 16:30:00','yyyy-mm-dd hh24:mi:ss');

  12. Flashback complete.

  13. 16:34:10 sys@TEST10G>
  14. 16:34:10 sys@TEST10G> alter database open resetlogs;

  15. Database altered.

  16. 16:34:26 sys@TEST10G> select CREATED,RESETLOGS_CHANGE#,RESETLOGS_TIME from v$database;

  17. CREATED          RESETLOGS_CHANGE# RESETLOGS_TIME
  18. ------------------- ----------------- -------------------
  19. 2013-01-16 16:03:01            616073 2013-01-17 16:34:24


  20. 16:34:48 sys@TEST10G> shutdown immediate;

  21. 16:35:18 sys@TEST10G> startup mount

  22. 16:35:47 sys@TEST10G> select * from v$flashback_database_log;

  23. OLDEST_FLASHBACK_SCN OLDEST_FLASHBACK_TI RETENTION_TARGET FLASHBACK_SIZE ESTIMATED_FLASHBACK_SIZE
  24. -------------------- ------------------- ---------------- -------------- ------------------------
  25.            615690 2013-01-16 16:23:23          1440     36864000               0

  26. 16:36:13 sys@TEST10G> flashback database to timestamp to_timestamp('2013-01-16 16:25:00','yyyy-mm-dd hh24:mi:ss');

  27. Flashback complete.

  28. 16:36:46 sys@TEST10G> flashback database to timestamp to_timestamp('2013-01-16 17:25:00','yyyy-mm-dd hh24:mi:ss');

  29. Flashback complete.

  30. 16:37:10 sys@TEST10G> flashback database to timestamp to_timestamp('2013-01-16 16:25:00','yyyy-mm-dd hh24:mi:ss');

  31. Flashback complete.

  32. 16:37:22 sys@TEST10G> flashback database to timestamp to_timestamp('2013-01-16 18:25:00','yyyy-mm-dd hh24:mi:ss');
  33. flashback database to timestamp to_timestamp('2013-01-16 18:25:00','yyyy-mm-dd hh24:mi:ss')
  34. *
  35. ERROR at line 1:
  36. ORA-38795: warning: FLASHBACK succeeded but OPEN RESETLOGS would get error below
  37. ORA-01245: offline file 6 will be lost if RESETLOGS is done
  38. ORA-01111: name for data file 6 is unknown - rename to correct file
  39. ORA-01110: data file 6: '/u01/app/oracle/product/10.2.0/test_10g/dbs/UNNAMED00006'


  40. 16:37:31 sys@TEST10G>
  41. 16:38:00 sys@TEST10G>
  42. 16:38:00 sys@TEST10G> flashback database to scn 621452;
  43. flashback database to scn 621452
  44. *
  45. ERROR at line 1:
  46. ORA-38795: warning: FLASHBACK succeeded but OPEN RESETLOGS would get error below
  47. ORA-01245: offline file 6 will be lost if RESETLOGS is done
  48. ORA-01111: name for data file 6 is unknown - rename to correct file
  49. ORA-01110: data file 6: '/u01/app/oracle/product/10.2.0/test_10g/dbs/UNNAMED00006'
复制代码
2#
发表于 2013-1-17 17:33:02

名词解释
向前闪回  flash forward
往后闪回  flash back

回复 只看该作者 道具 举报

3#
发表于 2013-1-17 17:34:09

1. 从flashback的技术白皮书看 其具备一定的flash forward能力, 但oracle并不保证这种能力
2. 未来的版本中可能会加强,这需要在版本12c上测试一下

回复 只看该作者 道具 举报

您需要登录后才可以回帖 登录 | 注册

QQ|手机版|Archiver|Oracle数据库数据恢复、性能优化

GMT+8, 2024-12-26 16:07 , Processed in 0.046431 second(s), 20 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部
TEL/電話+86 13764045638
Email service@parnassusdata.com
QQ 47079569