Bo's Oracle Station

查看: 1441|回复: 0

课程第11次(2018-06-12星期二)

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2018-6-12 19:50:10 | 显示全部楼层 |阅读模式
关于普通的restore point:
  1. select * from v$restore_point;

  2. create restore point rsp1 ;

  3. create restore point rsp2 as of scn 1050000;
复制代码

对照时间点不完全恢复的语句:
  1. RMAN> run {
  2. 2> sql "alter session set nls_date_format=''YYYY-MM-DD:HH24:MI:SS''";
  3. 3> set until time '2018-06-12:20:04:50';
  4. 4> restore database;
  5. 5> recover database;
  6. 6> }

复制代码

对照日志断点的不完全恢复的语句:
  1. RMAN> run {
  2. 2> set until sequence   5  thread  1;
  3. 3> restore database;
  4. 4> recover database;
  5. 5> }
复制代码

Screenshot.png


书上有错:
Screenshot-1.png

  1. [oracle@station86 ~]$ rman target /

  2. Recovery Manager: Release 11.2.0.1.0 - Production on Tue Jun 12 20:57:17 2018

  3. Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

  4. connected to target database: ORCL (DBID=1359978017, not open)

  5. RMAN> list incarnation of database;

  6. using target database control file instead of recovery catalog

  7. List of Database Incarnations
  8. DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
  9. ------- ------- -------- ---------------- --- ---------- ----------
  10. 1       1       ORCL     1359978017       PARENT  1          13-AUG-09
  11. 2       2       ORCL     1359978017       PARENT  754488     22-NOV-13
  12. 3       3       ORCL     1359978017       ORPHAN  1055998    12-JUN-18
  13. 4       4       ORCL     1359978017       PARENT  1055998    12-JUN-18
  14. 5       5       ORCL     1359978017       CURRENT 1058023    12-JUN-18

  15. RMAN> reset database to incarnation 4;

  16. database reset to incarnation 4

  17. RMAN> list incarnation of database;


  18. List of Database Incarnations
  19. DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
  20. ------- ------- -------- ---------------- --- ---------- ----------
  21. 1       1       ORCL     1359978017       PARENT  1          13-AUG-09
  22. 2       2       ORCL     1359978017       PARENT  754488     22-NOV-13
  23. 3       3       ORCL     1359978017       ORPHAN  1055998    12-JUN-18
  24. 4       4       ORCL     1359978017       CURRENT 1055998    12-JUN-18
  25. 5       5       ORCL     1359978017       ORPHAN  1058023    12-JUN-18

  26. RMAN> flashback database to sequence 5 thread 1 ;

  27. Starting flashback at 12-JUN-18
  28. allocated channel: ORA_DISK_1
  29. channel ORA_DISK_1: SID=68 device type=DISK
  30. allocated channel: ORA_DISK_2
  31. channel ORA_DISK_2: SID=130 device type=DISK
  32. allocated channel: ORA_DISK_3
  33. channel ORA_DISK_3: SID=194 device type=DISK
  34. allocated channel: ORA_DISK_4
  35. channel ORA_DISK_4: SID=6 device type=DISK
  36. allocated channel: ORA_DISK_5
  37. channel ORA_DISK_5: SID=70 device type=DISK
  38. allocated channel: ORA_DISK_6
  39. channel ORA_DISK_6: SID=131 device type=DISK
  40. allocated channel: ORA_DISK_7
  41. channel ORA_DISK_7: SID=195 device type=DISK
  42. allocated channel: ORA_DISK_8
  43. channel ORA_DISK_8: SID=7 device type=DISK


  44. starting media recovery

  45. archived log for thread 1 with sequence 1 is already on disk as file +FRA/orcl/archivelog/2018_06_12/thread_1_seq_1.308.978640963
  46. archived log for thread 1 with sequence 2 is already on disk as file +FRA/orcl/archivelog/2018_06_12/thread_1_seq_2.309.978640963
  47. archived log for thread 1 with sequence 3 is already on disk as file +FRA/orcl/archivelog/2018_06_12/thread_1_seq_3.310.978640973
  48. archived log for thread 1 with sequence 4 is already on disk as file +FRA/orcl/archivelog/2018_06_12/thread_1_seq_4.311.978640975
  49. archived log for thread 1 with sequence 5 is already on disk as file +FRA/orcl/archivelog/2018_06_12/thread_1_seq_5.316.978641659
  50. media recovery complete, elapsed time: 00:00:05
  51. Finished flashback at 12-JUN-18

  52. RMAN> list incarnation of database;


  53. List of Database Incarnations
  54. DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
  55. ------- ------- -------- ---------------- --- ---------- ----------
  56. 1       1       ORCL     1359978017       PARENT  1          13-AUG-09
  57. 2       2       ORCL     1359978017       PARENT  754488     22-NOV-13
  58. 3       3       ORCL     1359978017       ORPHAN  1055998    12-JUN-18
  59. 4       4       ORCL     1359978017       CURRENT 1055998    12-JUN-18
  60. 5       5       ORCL     1359978017       ORPHAN  1058023    12-JUN-18

  61. RMAN> alter database open resetlogs;

  62. database opened

  63. RMAN> list incarnation of database;


  64. List of Database Incarnations
  65. DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
  66. ------- ------- -------- ---------------- --- ---------- ----------
  67. 1       1       ORCL     1359978017       PARENT  1          13-AUG-09
  68. 2       2       ORCL     1359978017       PARENT  754488     22-NOV-13
  69. 3       3       ORCL     1359978017       ORPHAN  1055998    12-JUN-18
  70. 4       4       ORCL     1359978017       PARENT  1055998    12-JUN-18
  71. 5       5       ORCL     1359978017       ORPHAN  1058023    12-JUN-18
  72. 6       6       ORCL     1359978017       CURRENT 1058028    12-JUN-18

  73. RMAN>
复制代码


回复

使用道具 举报

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

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-11-22 12:02 , Processed in 0.040056 second(s), 28 queries .

快速回复 返回顶部 返回列表