设为首页收藏本站

Botang唐波's Oracle Station

查看: 755|回复: 0

课程第27次(2016-05-27星期五):闪回数据库和不完全恢复的对比

[复制链接]

58

主题

96

帖子

1439

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1439
发表于 2016-5-28 09:50:33 | 显示全部楼层 |阅读模式
课程第27次(2016-05-27星期五):闪回数据库和不完全恢复的对比:

磁带机列出备份:
  1. [root@station90 ~]# crs_stat -t
  2. Name           Type           Target    State     Host        
  3. ------------------------------------------------------------
  4. ora.DATA.dg    ora....up.type ONLINE    ONLINE    station90   
  5. ora.FRA.dg     ora....up.type ONLINE    ONLINE    station90   
  6. ora....ER.lsnr ora....er.type ONLINE    ONLINE    station90   
  7. ora.asm        ora.asm.type   ONLINE    ONLINE    station90   
  8. ora.cssd       ora.cssd.type  ONLINE    ONLINE    station90   
  9. ora.diskmon    ora....on.type ONLINE    ONLINE    station90   
  10. ora.orcl.db    ora....se.type ONLINE    ONLINE    station90   
  11. [root@station90 ~]# lsscsi -g
  12. [0:0:0:0]    disk    ATA      M4-CT128M4SSD2   040H  /dev/sda   /dev/sg0
  13. [6:0:0:0]    mediumx STK      L700             550V  /dev/sch0  /dev/sg9
  14. [6:0:1:0]    tape    IBM      ULT3580-TD5      550V  /dev/st0   /dev/sg1
  15. [6:0:2:0]    tape    IBM      ULT3580-TD5      550V  /dev/st1   /dev/sg2
  16. [6:0:3:0]    tape    IBM      ULT3580-TD4      550V  /dev/st2   /dev/sg3
  17. [6:0:4:0]    tape    IBM      ULT3580-TD4      550V  /dev/st3   /dev/sg4
  18. [6:0:8:0]    mediumx SPECTRA  PYTHON           550V  /dev/sch1  /dev/sg10
  19. [6:0:9:0]    tape    IBM      ULT3580-TD4      550V  /dev/st4   /dev/sg5
  20. [6:0:10:0]   tape    IBM      ULT3580-TD4      550V  /dev/st5   /dev/sg6
  21. [6:0:11:0]   tape    IBM      ULT3580-TD4      550V  /dev/st6   /dev/sg7
  22. [6:0:12:0]   tape    IBM      ULT3580-TD4      550V  /dev/st7   /dev/sg8
  23. [root@station90 ~]# su - oracle
  24. [oracle@station90 ~]$ rman target  /  

  25. Recovery Manager: Release 11.2.0.1.0 - Production on Fri May 27 19:54:32 2016

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

  27. connected to target database: ORCL (DBID=1343950367)

  28. RMAN> list backup of database ;

  29. using target database control file instead of recovery catalog

  30. List of Backup Sets
  31. ===================


  32. BS Key  Type LV Size       Device Type Elapsed Time Completion Time
  33. ------- ---- -- ---------- ----------- ------------ ---------------
  34. 2       Incr 0  69.06M     SBT_TAPE    00:00:20     20-OCT-13      
  35.         BP Key: 2   Status: AVAILABLE  Compressed: NO  Tag: 1T_WHOLE_INCR0
  36.         Handle: 05omt45l_1_1   Media: station90-000010
  37.   List of Datafiles in backup set 2
  38.   File LV Type Ckp SCN    Ckp Time  Name
  39.   ---- -- ---- ---------- --------- ----
  40.   5    0  Incr 1041758    20-OCT-13 +DATA/orcl/datafile/example.265.816169651

  41. BS Key  Type LV Size       Device Type Elapsed Time Completion Time
  42. ------- ---- -- ---------- ----------- ------------ ---------------
  43. 3       Incr 0  588.69M    SBT_TAPE    00:00:40     20-OCT-13      
  44.         BP Key: 3   Status: AVAILABLE  Compressed: NO  Tag: 1T_WHOLE_INCR0
  45.         Handle: 02omt45k_1_1   Media: station90-000009
  46.   List of Datafiles in backup set 3
  47.   File LV Type Ckp SCN    Ckp Time  Name
  48.   ---- -- ---- ---------- --------- ----
  49.   1    0  Incr 1041748    20-OCT-13 +DATA/orcl/datafile/system.256.816169553

  50. BS Key  Type LV Size       Device Type Elapsed Time Completion Time
  51. ------- ---- -- ---------- ----------- ------------ ---------------
  52. 4       Incr 0  3.31M      SBT_TAPE    00:00:55     20-OCT-13      
  53.         BP Key: 4   Status: AVAILABLE  Compressed: NO  Tag: 1T_WHOLE_INCR0
  54.         Handle: 06omt45l_1_1   Media: station90-000009
  55.   List of Datafiles in backup set 4
  56.   File LV Type Ckp SCN    Ckp Time  Name
  57.   ---- -- ---- ---------- --------- ----
  58.   4    0  Incr 1041761    20-OCT-13 +DATA/orcl/datafile/users.259.816169553

  59. BS Key  Type LV Size       Device Type Elapsed Time Completion Time
  60. ------- ---- -- ---------- ----------- ------------ ---------------
  61. 5       Incr 0  380.38M    SBT_TAPE    00:01:08     20-OCT-13      
  62.         BP Key: 5   Status: AVAILABLE  Compressed: NO  Tag: 1T_WHOLE_INCR0
  63.         Handle: 03omt45k_1_1   Media: station90-000010
  64.   List of Datafiles in backup set 5
  65.   File LV Type Ckp SCN    Ckp Time  Name
  66.   ---- -- ---- ---------- --------- ----
  67.   2    0  Incr 1041751    20-OCT-13 +DATA/orcl/datafile/sysaux.257.816169553

  68. BS Key  Type LV Size       Device Type Elapsed Time Completion Time
  69. ------- ---- -- ---------- ----------- ------------ ---------------
  70. 6       Incr 0  94.69M     SBT_TAPE    00:01:22     20-OCT-13      
  71.         BP Key: 6   Status: AVAILABLE  Compressed: NO  Tag: 1T_WHOLE_INCR0
  72.         Handle: 04omt45k_1_1   Media: station90-000009
  73.   List of Datafiles in backup set 6
  74.   File LV Type Ckp SCN    Ckp Time  Name
  75.   ---- -- ---- ---------- --------- ----
  76.   3    0  Incr 1041755    20-OCT-13 +DATA/orcl/datafile/undotbs1.258.816169553

  77. BS Key  Type LV Size       Device Type Elapsed Time Completion Time
  78. ------- ---- -- ---------- ----------- ------------ ---------------
  79. 10      Incr 1  128.00K    SBT_TAPE    00:00:16     20-OCT-13      
  80.         BP Key: 10   Status: AVAILABLE  Compressed: NO  Tag: 2T_WHOLE_INCR1
  81.         Handle: 0aomt4ce_1_1   Media: station90-000009
  82.   List of Datafiles in backup set 10
  83.   File LV Type Ckp SCN    Ckp Time  Name
  84.   ---- -- ---- ---------- --------- ----
  85.   1    1  Incr 1042472    20-OCT-13 +DATA/orcl/datafile/system.256.816169553

  86. BS Key  Type LV Size       Device Type Elapsed Time Completion Time
  87. ------- ---- -- ---------- ----------- ------------ ---------------
  88. 11      Incr 1  1.50M      SBT_TAPE    00:00:16     20-OCT-13      
  89.         BP Key: 11   Status: AVAILABLE  Compressed: NO  Tag: 2T_WHOLE_INCR1
  90.         Handle: 0comt4ce_1_1   Media: station90-000010
  91.   List of Datafiles in backup set 11
  92.   File LV Type Ckp SCN    Ckp Time  Name
  93.   ---- -- ---- ---------- --------- ----
  94.   3    1  Incr 1042478    20-OCT-13 +DATA/orcl/datafile/undotbs1.258.816169553

  95. BS Key  Type LV Size       Device Type Elapsed Time Completion Time
  96. ------- ---- -- ---------- ----------- ------------ ---------------
  97. 12      Incr 1  64.00K     SBT_TAPE    00:00:35     20-OCT-13      
  98.         BP Key: 12   Status: AVAILABLE  Compressed: NO  Tag: 2T_WHOLE_INCR1
  99.         Handle: 0eomt4ce_1_1   Media: station90-000010
  100.   List of Datafiles in backup set 12
  101.   File LV Type Ckp SCN    Ckp Time  Name
  102.   ---- -- ---- ---------- --------- ----
  103.   4    1  Incr 1042484    20-OCT-13 +DATA/orcl/datafile/users.259.816169553

  104. BS Key  Type LV Size       Device Type Elapsed Time Completion Time
  105. ------- ---- -- ---------- ----------- ------------ ---------------
  106. 13      Incr 1  64.00K     SBT_TAPE    00:00:41     20-OCT-13      
  107.         BP Key: 13   Status: AVAILABLE  Compressed: NO  Tag: 2T_WHOLE_INCR1
  108.         Handle: 0domt4ce_1_1   Media: station90-000009
  109.   List of Datafiles in backup set 13
  110.   File LV Type Ckp SCN    Ckp Time  Name
  111.   ---- -- ---- ---------- --------- ----
  112.   5    1  Incr 1042481    20-OCT-13 +DATA/orcl/datafile/example.265.816169651

  113. BS Key  Type LV Size       Device Type Elapsed Time Completion Time
  114. ------- ---- -- ---------- ----------- ------------ ---------------
  115. 14      Incr 1  7.44M      SBT_TAPE    00:00:57     20-OCT-13      
  116.         BP Key: 14   Status: AVAILABLE  Compressed: NO  Tag: 2T_WHOLE_INCR1
  117.         Handle: 0bomt4ce_1_1   Media: station90-000010
  118.   List of Datafiles in backup set 14
  119.   File LV Type Ckp SCN    Ckp Time  Name
  120.   ---- -- ---- ---------- --------- ----
  121.   2    1  Incr 1042475    20-OCT-13 +DATA/orcl/datafile/sysaux.257.816169553

  122. BS Key  Type LV Size       Device Type Elapsed Time Completion Time
  123. ------- ---- -- ---------- ----------- ------------ ---------------
  124. 18      Incr 1  128.00K    SBT_TAPE    00:00:15     20-OCT-13      
  125.         BP Key: 18   Status: AVAILABLE  Compressed: NO  Tag: 3TCUMU_WHOLE_INCR1
  126.         Handle: 0iomt4hq_1_1   Media: station90-000009
  127.   List of Datafiles in backup set 18
  128.   File LV Type Ckp SCN    Ckp Time  Name
  129.   ---- -- ---- ---------- --------- ----
  130.   1    1  Incr 1042619    20-OCT-13 +DATA/orcl/datafile/system.256.816169553

  131. BS Key  Type LV Size       Device Type Elapsed Time Completion Time
  132. ------- ---- -- ---------- ----------- ------------ ---------------
  133. 19      Incr 1  7.44M      SBT_TAPE    00:00:24     20-OCT-13      
  134.         BP Key: 19   Status: AVAILABLE  Compressed: NO  Tag: 3TCUMU_WHOLE_INCR1
  135.         Handle: 0jomt4hq_1_1   Media: station90-000010
  136.   List of Datafiles in backup set 19
  137.   File LV Type Ckp SCN    Ckp Time  Name
  138.   ---- -- ---- ---------- --------- ----
  139.   2    1  Incr 1042622    20-OCT-13 +DATA/orcl/datafile/sysaux.257.816169553

  140. BS Key  Type LV Size       Device Type Elapsed Time Completion Time
  141. ------- ---- -- ---------- ----------- ------------ ---------------
  142. 20      Incr 1  1.50M      SBT_TAPE    00:00:39     20-OCT-13      
  143.         BP Key: 20   Status: AVAILABLE  Compressed: NO  Tag: 3TCUMU_WHOLE_INCR1
  144.         Handle: 0komt4hq_1_1   Media: station90-000010
  145.   List of Datafiles in backup set 20
  146.   File LV Type Ckp SCN    Ckp Time  Name
  147.   ---- -- ---- ---------- --------- ----
  148.   3    1  Incr 1042625    20-OCT-13 +DATA/orcl/datafile/undotbs1.258.816169553

  149. BS Key  Type LV Size       Device Type Elapsed Time Completion Time
  150. ------- ---- -- ---------- ----------- ------------ ---------------
  151. 21      Incr 1  64.00K     SBT_TAPE    00:00:40     20-OCT-13      
  152.         BP Key: 21   Status: AVAILABLE  Compressed: NO  Tag: 3TCUMU_WHOLE_INCR1
  153.         Handle: 0lomt4hq_1_1   Media: station90-000009
  154.   List of Datafiles in backup set 21
  155.   File LV Type Ckp SCN    Ckp Time  Name
  156.   ---- -- ---- ---------- --------- ----
  157.   5    1  Incr 1042629    20-OCT-13 +DATA/orcl/datafile/example.265.816169651

  158. BS Key  Type LV Size       Device Type Elapsed Time Completion Time
  159. ------- ---- -- ---------- ----------- ------------ ---------------
  160. 22      Incr 1  64.00K     SBT_TAPE    00:00:53     20-OCT-13      
  161.         BP Key: 22   Status: AVAILABLE  Compressed: NO  Tag: 3TCUMU_WHOLE_INCR1
  162.         Handle: 0momt4hr_1_1   Media: station90-000010
  163.   List of Datafiles in backup set 22
  164.   File LV Type Ckp SCN    Ckp Time  Name
  165.   ---- -- ---- ---------- --------- ----
  166.   4    1  Incr 1042632    20-OCT-13 +DATA/orcl/datafile/users.259.816169553

  167. RMAN>






  168. RMAN>


复制代码


5号实验的恢复过程:
  1. [root@station90 桌面]# su - orace
  2. su: 用户orace 不存在
  3. [root@station90 桌面]# su - oracle
  4. [oracle@station90 ~]$ sqlplus /nolog

  5. SQL*Plus: Release 11.2.0.1.0 Production on Fri May 27 20:33:35 2016

  6. Copyright (c) 1982, 2009, Oracle.  All rights reserved.

  7. SQL> conn hr/oracle_4U
  8. ERROR:
  9. ORA-28002: the password will expire within 7 days


  10. Connected.
  11. SQL> select  * from  hr.t806;
  12. select        * from        hr.t806
  13.                    *
  14. ERROR at line 1:
  15. ORA-00942: table or view does not exist


  16. SQL> conn / as sysdba
  17. Connected.
  18. SQL> select  open_mode from v$database;

  19. OPEN_MODE
  20. --------------------
  21. READ WRITE

  22. SQL> shutdown abort
  23. ORACLE instance shut down.
  24. SQL> startup mount
  25. ORACLE instance started.

  26. Total System Global Area 6680915968 bytes
  27. Fixed Size                    2213936 bytes
  28. Variable Size                 3556771792 bytes
  29. Database Buffers         3087007744 bytes
  30. Redo Buffers                   34922496 bytes
  31. Database mounted.
  32. SQL> exit
  33. Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
  34. With the Partitioning, Automatic Storage Management, OLAP, Data Mining
  35. and Real Application Testing options
  36. [oracle@station90 ~]$ rman target /

  37. Recovery Manager: Release 11.2.0.1.0 - Production on Fri May 27 20:36:06 2016

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

  39. connected to target database: ORCL (DBID=1343950367, not open)

  40. RMAN> run {
  41. 2> sql "alter session set nls_date_format=''YYYY-MM-DD:HH24:MI:SS''";
  42. 3> set until time '2016-05-27:20:26:34';
  43. 4> restore database;
  44. 5> recover database;
  45. 6> }

  46. using target database control file instead of recovery catalog
  47. sql statement: alter session set nls_date_format=''YYYY-MM-DD:HH24:MI:SS''

  48. executing command: SET until clause

  49. Starting restore at 27-MAY-16
  50. allocated channel: ORA_DISK_1
  51. channel ORA_DISK_1: SID=7 device type=DISK
  52. allocated channel: ORA_DISK_2
  53. channel ORA_DISK_2: SID=68 device type=DISK
  54. allocated channel: ORA_DISK_3
  55. channel ORA_DISK_3: SID=131 device type=DISK
  56. allocated channel: ORA_DISK_4
  57. channel ORA_DISK_4: SID=192 device type=DISK
  58. allocated channel: ORA_DISK_5
  59. channel ORA_DISK_5: SID=8 device type=DISK
  60. allocated channel: ORA_DISK_6
  61. channel ORA_DISK_6: SID=69 device type=DISK
  62. allocated channel: ORA_DISK_7
  63. channel ORA_DISK_7: SID=132 device type=DISK
  64. allocated channel: ORA_DISK_8
  65. channel ORA_DISK_8: SID=193 device type=DISK
  66. allocated channel: ORA_SBT_TAPE_1
  67. channel ORA_SBT_TAPE_1: SID=9 device type=SBT_TAPE
  68. channel ORA_SBT_TAPE_1: Oracle Secure Backup
  69. allocated channel: ORA_SBT_TAPE_2
  70. channel ORA_SBT_TAPE_2: SID=70 device type=SBT_TAPE
  71. channel ORA_SBT_TAPE_2: Oracle Secure Backup
  72. allocated channel: ORA_SBT_TAPE_3
  73. channel ORA_SBT_TAPE_3: SID=133 device type=SBT_TAPE
  74. channel ORA_SBT_TAPE_3: Oracle Secure Backup
  75. allocated channel: ORA_SBT_TAPE_4
  76. channel ORA_SBT_TAPE_4: SID=194 device type=SBT_TAPE
  77. channel ORA_SBT_TAPE_4: Oracle Secure Backup
  78. allocated channel: ORA_SBT_TAPE_5
  79. channel ORA_SBT_TAPE_5: SID=10 device type=SBT_TAPE
  80. channel ORA_SBT_TAPE_5: Oracle Secure Backup
  81. allocated channel: ORA_SBT_TAPE_6
  82. channel ORA_SBT_TAPE_6: SID=71 device type=SBT_TAPE
  83. channel ORA_SBT_TAPE_6: Oracle Secure Backup
  84. allocated channel: ORA_SBT_TAPE_7
  85. channel ORA_SBT_TAPE_7: SID=134 device type=SBT_TAPE
  86. channel ORA_SBT_TAPE_7: Oracle Secure Backup
  87. allocated channel: ORA_SBT_TAPE_8
  88. channel ORA_SBT_TAPE_8: SID=195 device type=SBT_TAPE
  89. channel ORA_SBT_TAPE_8: Oracle Secure Backup

  90. channel ORA_SBT_TAPE_1: starting datafile backup set restore
  91. channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
  92. channel ORA_SBT_TAPE_1: restoring datafile 00005 to +DATA/orcl/datafile/example.265.816169651
  93. channel ORA_SBT_TAPE_1: reading from backup piece 05omt45l_1_1
  94. channel ORA_SBT_TAPE_2: starting datafile backup set restore
  95. channel ORA_SBT_TAPE_2: specifying datafile(s) to restore from backup set
  96. channel ORA_SBT_TAPE_2: restoring datafile 00001 to +DATA/orcl/datafile/system.256.816169553
  97. channel ORA_SBT_TAPE_2: reading from backup piece 02omt45k_1_1
  98. channel ORA_SBT_TAPE_1: piece handle=05omt45l_1_1 tag=1T_WHOLE_INCR0
  99. channel ORA_SBT_TAPE_1: restored backup piece 1
  100. channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:37
  101. channel ORA_SBT_TAPE_1: starting datafile backup set restore
  102. channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
  103. channel ORA_SBT_TAPE_1: restoring datafile 00002 to +DATA/orcl/datafile/sysaux.257.816169553
  104. channel ORA_SBT_TAPE_1: reading from backup piece 03omt45k_1_1
  105. channel ORA_SBT_TAPE_2: piece handle=02omt45k_1_1 tag=1T_WHOLE_INCR0
  106. channel ORA_SBT_TAPE_2: restored backup piece 1
  107. channel ORA_SBT_TAPE_2: restore complete, elapsed time: 00:00:52
  108. channel ORA_SBT_TAPE_2: starting datafile backup set restore
  109. channel ORA_SBT_TAPE_2: specifying datafile(s) to restore from backup set
  110. channel ORA_SBT_TAPE_2: restoring datafile 00004 to +DATA/orcl/datafile/users.259.816169553
  111. channel ORA_SBT_TAPE_2: reading from backup piece 06omt45l_1_1
  112. channel ORA_SBT_TAPE_1: piece handle=03omt45k_1_1 tag=1T_WHOLE_INCR0
  113. channel ORA_SBT_TAPE_1: restored backup piece 1
  114. channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:40
  115. channel ORA_SBT_TAPE_2: piece handle=06omt45l_1_1 tag=1T_WHOLE_INCR0
  116. channel ORA_SBT_TAPE_2: restored backup piece 1
  117. channel ORA_SBT_TAPE_2: restore complete, elapsed time: 00:00:25
  118. channel ORA_SBT_TAPE_2: starting datafile backup set restore
  119. channel ORA_SBT_TAPE_2: specifying datafile(s) to restore from backup set
  120. channel ORA_SBT_TAPE_2: restoring datafile 00003 to +DATA/orcl/datafile/undotbs1.258.816169553
  121. channel ORA_SBT_TAPE_2: reading from backup piece 04omt45k_1_1
  122. channel ORA_SBT_TAPE_2: piece handle=04omt45k_1_1 tag=1T_WHOLE_INCR0
  123. channel ORA_SBT_TAPE_2: restored backup piece 1
  124. channel ORA_SBT_TAPE_2: restore complete, elapsed time: 00:00:25
  125. Finished restore at 27-MAY-16

  126. Starting recover at 27-MAY-16
  127. using channel ORA_DISK_1
  128. using channel ORA_DISK_2
  129. using channel ORA_DISK_3
  130. using channel ORA_DISK_4
  131. using channel ORA_DISK_5
  132. using channel ORA_DISK_6
  133. using channel ORA_DISK_7
  134. using channel ORA_DISK_8
  135. using channel ORA_SBT_TAPE_1
  136. using channel ORA_SBT_TAPE_2
  137. using channel ORA_SBT_TAPE_3
  138. using channel ORA_SBT_TAPE_4
  139. using channel ORA_SBT_TAPE_5
  140. using channel ORA_SBT_TAPE_6
  141. using channel ORA_SBT_TAPE_7
  142. using channel ORA_SBT_TAPE_8
  143. channel ORA_SBT_TAPE_1: starting incremental datafile backup set restore
  144. channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
  145. destination for restore of datafile 00001: +DATA/orcl/datafile/system.256.816169553
  146. channel ORA_SBT_TAPE_1: reading from backup piece 0iomt4hq_1_1
  147. channel ORA_SBT_TAPE_2: starting incremental datafile backup set restore
  148. channel ORA_SBT_TAPE_2: specifying datafile(s) to restore from backup set
  149. destination for restore of datafile 00002: +DATA/orcl/datafile/sysaux.257.816169553
  150. channel ORA_SBT_TAPE_2: reading from backup piece 0jomt4hq_1_1
  151. channel ORA_SBT_TAPE_1: piece handle=0iomt4hq_1_1 tag=3TCUMU_WHOLE_INCR1
  152. channel ORA_SBT_TAPE_1: restored backup piece 1
  153. channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:35
  154. channel ORA_SBT_TAPE_1: starting incremental datafile backup set restore
  155. channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
  156. destination for restore of datafile 00005: +DATA/orcl/datafile/example.265.816169651
  157. channel ORA_SBT_TAPE_1: reading from backup piece 0lomt4hq_1_1
  158. channel ORA_SBT_TAPE_2: piece handle=0jomt4hq_1_1 tag=3TCUMU_WHOLE_INCR1
  159. channel ORA_SBT_TAPE_2: restored backup piece 1
  160. channel ORA_SBT_TAPE_2: restore complete, elapsed time: 00:00:35
  161. channel ORA_SBT_TAPE_2: starting incremental datafile backup set restore
  162. channel ORA_SBT_TAPE_2: specifying datafile(s) to restore from backup set
  163. destination for restore of datafile 00003: +DATA/orcl/datafile/undotbs1.258.816169553
  164. channel ORA_SBT_TAPE_2: reading from backup piece 0komt4hq_1_1
  165. channel ORA_SBT_TAPE_1: piece handle=0lomt4hq_1_1 tag=3TCUMU_WHOLE_INCR1
  166. channel ORA_SBT_TAPE_1: restored backup piece 1
  167. channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:35
  168. channel ORA_SBT_TAPE_2: piece handle=0komt4hq_1_1 tag=3TCUMU_WHOLE_INCR1
  169. channel ORA_SBT_TAPE_2: restored backup piece 1
  170. channel ORA_SBT_TAPE_2: restore complete, elapsed time: 00:00:36
  171. channel ORA_SBT_TAPE_2: starting incremental datafile backup set restore
  172. channel ORA_SBT_TAPE_2: specifying datafile(s) to restore from backup set
  173. destination for restore of datafile 00004: +DATA/orcl/datafile/users.259.816169553
  174. channel ORA_SBT_TAPE_2: reading from backup piece 0momt4hr_1_1
  175. channel ORA_SBT_TAPE_2: piece handle=0momt4hr_1_1 tag=3TCUMU_WHOLE_INCR1
  176. channel ORA_SBT_TAPE_2: restored backup piece 1
  177. channel ORA_SBT_TAPE_2: restore complete, elapsed time: 00:00:25

  178. starting media recovery

  179. archived log for thread 1 with sequence 15 is already on disk as file +FRA/orcl/archivelog/2013_12_11/thread_1_seq_15.261.833878627
  180. archived log for thread 1 with sequence 16 is already on disk as file +FRA/orcl/archivelog/2013_12_11/thread_1_seq_16.262.833879059
  181. archived log for thread 1 with sequence 17 is already on disk as file +FRA/orcl/archivelog/2016_05_27/thread_1_seq_17.263.912957557
  182. archived log for thread 1 with sequence 18 is already on disk as file +FRA/orcl/archivelog/2016_05_27/thread_1_seq_18.264.912959275
  183. archived log for thread 1 with sequence 19 is already on disk as file +FRA/orcl/archivelog/2016_05_27/thread_1_seq_19.265.912964019
  184. archived log for thread 1 with sequence 20 is already on disk as file +FRA/orcl/archivelog/2016_05_27/thread_1_seq_20.266.912975989
  185. archived log for thread 1 with sequence 21 is already on disk as file +FRA/orcl/archivelog/2016_05_27/thread_1_seq_21.267.912975989
  186. archived log for thread 1 with sequence 22 is already on disk as file +FRA/orcl/archivelog/2016_05_27/thread_1_seq_22.268.912975999
  187. channel ORA_SBT_TAPE_1: starting archived log restore to default destination
  188. channel ORA_SBT_TAPE_1: restoring archived log
  189. archived log thread=1 sequence=14
  190. channel ORA_SBT_TAPE_1: reading from backup piece 0nomt4ji_1_1
  191. channel ORA_SBT_TAPE_1: piece handle=0nomt4ji_1_1 tag=3TCUMU_WHOLE_INCR1
  192. channel ORA_SBT_TAPE_1: restored backup piece 1
  193. channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:24
  194. archived log file name=+FRA/orcl/archivelog/2016_05_27/thread_1_seq_14.272.912977425 thread=1 sequence=14
  195. channel default: deleting archived log(s)
  196. archived log file name=+FRA/orcl/archivelog/2016_05_27/thread_1_seq_14.272.912977425 RECID=18 STAMP=912977425
  197. archived log file name=+FRA/orcl/archivelog/2013_12_11/thread_1_seq_15.261.833878627 thread=1 sequence=15
  198. archived log file name=+FRA/orcl/archivelog/2013_12_11/thread_1_seq_16.262.833879059 thread=1 sequence=16
  199. archived log file name=+FRA/orcl/archivelog/2016_05_27/thread_1_seq_17.263.912957557 thread=1 sequence=17
  200. archived log file name=+FRA/orcl/archivelog/2016_05_27/thread_1_seq_18.264.912959275 thread=1 sequence=18
  201. archived log file name=+FRA/orcl/archivelog/2016_05_27/thread_1_seq_19.265.912964019 thread=1 sequence=19
  202. archived log file name=+FRA/orcl/archivelog/2016_05_27/thread_1_seq_20.266.912975989 thread=1 sequence=20
  203. archived log file name=+FRA/orcl/archivelog/2016_05_27/thread_1_seq_21.267.912975989 thread=1 sequence=21
  204. archived log file name=+FRA/orcl/archivelog/2016_05_27/thread_1_seq_22.268.912975999 thread=1 sequence=22
  205. media recovery complete, elapsed time: 00:00:25
  206. Finished recover at 27-MAY-16

  207. RMAN> alter database open ;

  208. RMAN-00571: ===========================================================
  209. RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
  210. RMAN-00571: ===========================================================
  211. RMAN-03002: failure of alter db command at 05/27/2016 20:51:47
  212. ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

  213. RMAN> list incarnation of database ;


  214. List of Database Incarnations
  215. DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
  216. ------- ------- -------- ---------------- --- ---------- ----------
  217. 1       1       ORCL     1343950367       PARENT  1          15-AUG-09
  218. 2       2       ORCL     1343950367       CURRENT 945184     23-MAY-13

  219. RMAN> alter database open resetlogs;

  220. database opened

  221. RMAN> exit


  222. Recovery Manager complete.
  223. [oracle@station90 ~]$ sqlplus /nolog

  224. SQL*Plus: Release 11.2.0.1.0 Production on Fri May 27 20:53:46 2016

  225. Copyright (c) 1982, 2009, Oracle.  All rights reserved.

  226. SQL> conn / as sysdba
  227. Connected.
  228. SQL> archive log list;
  229. Database log mode               Archive Mode
  230. Automatic archival               Enabled
  231. Archive destination               USE_DB_RECOVERY_FILE_DEST
  232. Oldest online log sequence     1
  233. Next log sequence to archive   1
  234. Current log sequence               1
  235. SQL> exit
  236. Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
  237. With the Partitioning, Automatic Storage Management, OLAP, Data Mining
  238. and Real Application Testing options
  239. [oracle@station90 ~]$ rman target /

  240. Recovery Manager: Release 11.2.0.1.0 - Production on Fri May 27 20:53:57 2016

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

  242. connected to target database: ORCL (DBID=1343950367)

  243. RMAN> list incarnation of database;

  244. using target database control file instead of recovery catalog

  245. List of Database Incarnations
  246. DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
  247. ------- ------- -------- ---------------- --- ---------- ----------
  248. 1       1       ORCL     1343950367       PARENT  1          15-AUG-09
  249. 2       2       ORCL     1343950367       PARENT  945184     23-MAY-13
  250. 3       3       ORCL     1343950367       CURRENT 1068604    27-MAY-16

  251. RMAN> exit
复制代码

刚打开的闪回日志的大小:
[root@station90 mymachine]# watch -n 0.1 "ps aux | grep rvwr"
[root@station90 mymachine]# watch -n 0.1 "ps aux | grep rvwr"
[root@station90 mymachine]# bc
bc 1.06.95
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
scale=4
33*1024*1024*8
276824064
33*1024*1024*8/1000000
276.8240(说明闪回日志刚开始时有2亿7千万比特,我叫“基底位图”)



  1. [oracle@station90 ~]$ . oraenv
  2. ORACLE_SID = [orcl] ? +ASM
  3. The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.2.0/grid is /u01/app/oracle
  4. [oracle@station90 ~]$ asmcmd
  5. ASMCMD> ls
  6. DATA/
  7. FRA/
  8. ASMCMD> cd FRA/
  9. ASMCMD> ls
  10. ORCL/
  11. ASMCMD> cd ORCL/
  12. ASMCMD> ls
  13. ARCHIVELOG/
  14. AUTOBACKUP/
  15. CHANGETRACKING/
  16. CONTROLFILE/
  17. ONLINELOG/
  18. ASMCMD> ls
  19. ARCHIVELOG/
  20. AUTOBACKUP/
  21. CHANGETRACKING/
  22. CONTROLFILE/
  23. FLASHBACK/
  24. ONLINELOG/
  25. ASMCMD> cd FLASHBACK/
  26. ASMCMD> ls
  27. log_1.274.912980547
  28. ASMCMD> du -sh
  29. Unknown option: s
  30. Unknown option: h
  31. usage: du [-H] [dir]
  32. help:  help du
  33. ASMCMD> du  
  34. Used_MB      Mirror_used_MB
  35.      33                  33
  36. ASMCMD>
复制代码

PL/SQL窗口:

  1. select  * from v$flashback_database_log;

  2. select  * from v$flashback_database_stat;
复制代码


回复

使用道具 举报

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

本版积分规则

QQ|手机版|Botang唐波's Oracle Station   

GMT+8, 2018-11-19 14:47 , Processed in 0.165576 second(s), 28 queries .

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