Bo's Oracle Station

查看: 1862|回复: 0

课程第23/24次(2017-08-26星期六上下午)

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2017-8-26 10:43:37 | 显示全部楼层 |阅读模式
上完1Z0-053第12章
1Z0-05219章(上完10章),1Z0-05321章(上完5章)和1Z0-063多租户部分共9章(上完0章)
总共上完全部49章中的15
  1. select  * from v$flashback_database_log;

  2. select  * from v$restore_point;

  3. create restore point rsp1 ;

  4. create restore point rsp2 as of  scn 1104000;
复制代码

053的12-7幻灯注释里严重错误:

Screenshot.png

  1. RMAN> list incarnation of database;


  2. List of Database Incarnations
  3. DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
  4. ------- ------- -------- ---------------- --- ---------- ----------
  5. 1       1       ORCL     1343950367       PARENT  1          2009-08-15:00:16:43
  6. 2       2       ORCL     1343950367       PARENT  945184     2013-05-23:09:47:15
  7. 3       3       ORCL     1343950367       ORPHAN  1082671    2017-08-24:21:40:38
  8. 4       4       ORCL     1343950367       CURRENT 1082671    2017-08-26:09:25:11

  9. RMAN> shutdown abort

  10. Oracle instance shut down

  11. RMAN> startup mount

  12. connected to target database (not started)
  13. Oracle instance started
  14. database mounted

  15. Total System Global Area    6680915968 bytes

  16. Fixed Size                     2213936 bytes
  17. Variable Size               3556771792 bytes
  18. Database Buffers            3087007744 bytes
  19. Redo Buffers                  34922496 bytes

  20. RMAN> run {
  21. 2> set until sequence  7  thread 1 ;
  22. 3> restore database;
  23. 4> recover database;
  24. 5> }

  25. executing command: SET until clause

  26. Starting restore at 2017-08-26:10:16:45
  27. allocated channel: ORA_DISK_1
  28. channel ORA_DISK_1: SID=131 device type=DISK
  29. allocated channel: ORA_DISK_2
  30. channel ORA_DISK_2: SID=192 device type=DISK
  31. allocated channel: ORA_DISK_3
  32. channel ORA_DISK_3: SID=8 device type=DISK
  33. allocated channel: ORA_DISK_4
  34. channel ORA_DISK_4: SID=69 device type=DISK
  35. allocated channel: ORA_DISK_5
  36. channel ORA_DISK_5: SID=132 device type=DISK
  37. allocated channel: ORA_DISK_6
  38. channel ORA_DISK_6: SID=193 device type=DISK
  39. allocated channel: ORA_DISK_7
  40. channel ORA_DISK_7: SID=9 device type=DISK
  41. allocated channel: ORA_DISK_8
  42. channel ORA_DISK_8: SID=70 device type=DISK
  43. allocated channel: ORA_SBT_TAPE_1
  44. channel ORA_SBT_TAPE_1: SID=133 device type=SBT_TAPE
  45. channel ORA_SBT_TAPE_1: Oracle Secure Backup
  46. allocated channel: ORA_SBT_TAPE_2
  47. channel ORA_SBT_TAPE_2: SID=10 device type=SBT_TAPE
  48. channel ORA_SBT_TAPE_2: Oracle Secure Backup
  49. flashing back control file to SCN 1106318

  50. channel ORA_SBT_TAPE_1: starting datafile backup set restore
  51. channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
  52. channel ORA_SBT_TAPE_1: restoring datafile 00002 to +DATA/orcl/datafile/sysaux.257.816169553
  53. channel ORA_SBT_TAPE_1: restoring datafile 00003 to +DATA/orcl/datafile/undotbs1.258.816169553
  54. channel ORA_SBT_TAPE_1: restoring datafile 00004 to +DATA/orcl/datafile/users.259.816169553
  55. channel ORA_SBT_TAPE_1: reading from backup piece 13s4ih4j_1_1
  56. channel ORA_SBT_TAPE_2: starting datafile backup set restore
  57. channel ORA_SBT_TAPE_2: specifying datafile(s) to restore from backup set
  58. channel ORA_SBT_TAPE_2: restoring datafile 00001 to +DATA/orcl/datafile/system.256.816169553
  59. channel ORA_SBT_TAPE_2: restoring datafile 00005 to +DATA/orcl/datafile/example.265.816169651
  60. channel ORA_SBT_TAPE_2: reading from backup piece 12s4ih4j_1_1
  61. channel ORA_SBT_TAPE_1: piece handle=13s4ih4j_1_1 tag=0T_INCR0_WHOLE
  62. channel ORA_SBT_TAPE_1: restored backup piece 1
  63. channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:45
  64. channel ORA_SBT_TAPE_2: piece handle=12s4ih4j_1_1 tag=0T_INCR0_WHOLE
  65. channel ORA_SBT_TAPE_2: restored backup piece 1
  66. channel ORA_SBT_TAPE_2: restore complete, elapsed time: 00:00:55
  67. Finished restore at 2017-08-26:10:17:56

  68. Starting recover at 2017-08-26:10:17:56
  69. using channel ORA_DISK_1
  70. using channel ORA_DISK_2
  71. using channel ORA_DISK_3
  72. using channel ORA_DISK_4
  73. using channel ORA_DISK_5
  74. using channel ORA_DISK_6
  75. using channel ORA_DISK_7
  76. using channel ORA_DISK_8
  77. using channel ORA_SBT_TAPE_1
  78. using channel ORA_SBT_TAPE_2

  79. starting media recovery

  80. archived log for thread 1 with sequence 20 is already on disk as file +FRA/orcl/archivelog/2017_08_24/thread_1_seq_20.262.952876345
  81. archived log for thread 1 with sequence 21 is already on disk as file +FRA/orcl/archivelog/2017_08_24/thread_1_seq_21.261.952879097
  82. archived log for thread 1 with sequence 22 is already on disk as file +FRA/orcl/archivelog/2017_08_24/thread_1_seq_22.263.952888521
  83. archived log for thread 1 with sequence 23 is already on disk as file +FRA/orcl/archivelog/2017_08_24/thread_1_seq_23.264.952890379
  84. archived log for thread 1 with sequence 24 is already on disk as file +FRA/orcl/archivelog/2017_08_24/thread_1_seq_24.265.952890385
  85. archived log for thread 1 with sequence 25 is already on disk as file +FRA/orcl/archivelog/2017_08_24/thread_1_seq_25.266.952890395
  86. archived log for thread 1 with sequence 26 is already on disk as file +FRA/orcl/archivelog/2017_08_24/thread_1_seq_26.269.952895957
  87. archived log for thread 1 with sequence 27 is already on disk as file +FRA/orcl/archivelog/2017_08_24/thread_1_seq_27.270.952895959
  88. archived log for thread 1 with sequence 28 is already on disk as file +FRA/orcl/archivelog/2017_08_24/thread_1_seq_28.271.952895967
  89. archived log for thread 1 with sequence 1 is already on disk as file +FRA/orcl/archivelog/2017_08_26/thread_1_seq_1.302.953025979
  90. archived log for thread 1 with sequence 2 is already on disk as file +FRA/orcl/archivelog/2017_08_26/thread_1_seq_2.304.953026009
  91. archived log for thread 1 with sequence 3 is already on disk as file +FRA/orcl/archivelog/2017_08_26/thread_1_seq_3.305.953026153
  92. archived log for thread 1 with sequence 4 is already on disk as file +FRA/orcl/archivelog/2017_08_26/thread_1_seq_4.306.953027897
  93. archived log for thread 1 with sequence 5 is already on disk as file +FRA/orcl/archivelog/2017_08_26/thread_1_seq_5.307.953027897
  94. archived log for thread 1 with sequence 6 is already on disk as file +FRA/orcl/archivelog/2017_08_26/thread_1_seq_6.308.953027907
  95. channel ORA_SBT_TAPE_1: starting archived log restore to default destination
  96. channel ORA_SBT_TAPE_1: restoring archived log
  97. archived log thread=1 sequence=19
  98. channel ORA_SBT_TAPE_1: reading from backup piece 14s4ih5n_1_1
  99. channel ORA_SBT_TAPE_1: piece handle=14s4ih5n_1_1 tag=0T_INCR0_WHOLE
  100. channel ORA_SBT_TAPE_1: restored backup piece 1
  101. channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:28
  102. archived log file name=+FRA/orcl/archivelog/2017_08_26/thread_1_seq_19.312.953029095 thread=1 sequence=19
  103. channel default: deleting archived log(s)
  104. archived log file name=+FRA/orcl/archivelog/2017_08_26/thread_1_seq_19.312.953029095 RECID=63 STAMP=953029100
  105. archived log file name=+FRA/orcl/archivelog/2017_08_24/thread_1_seq_20.262.952876345 thread=1 sequence=20
  106. archived log file name=+FRA/orcl/archivelog/2017_08_24/thread_1_seq_21.261.952879097 thread=1 sequence=21
  107. archived log file name=+FRA/orcl/archivelog/2017_08_24/thread_1_seq_22.263.952888521 thread=1 sequence=22
  108. archived log file name=+FRA/orcl/archivelog/2017_08_24/thread_1_seq_23.264.952890379 thread=1 sequence=23
  109. archived log file name=+FRA/orcl/archivelog/2017_08_24/thread_1_seq_24.265.952890385 thread=1 sequence=24
  110. archived log file name=+FRA/orcl/archivelog/2017_08_24/thread_1_seq_25.266.952890395 thread=1 sequence=25
  111. archived log file name=+FRA/orcl/archivelog/2017_08_24/thread_1_seq_26.269.952895957 thread=1 sequence=26
  112. archived log file name=+FRA/orcl/archivelog/2017_08_24/thread_1_seq_27.270.952895959 thread=1 sequence=27
  113. archived log file name=+FRA/orcl/archivelog/2017_08_24/thread_1_seq_28.271.952895967 thread=1 sequence=28
  114. archived log file name=+FRA/orcl/archivelog/2017_08_26/thread_1_seq_1.302.953025979 thread=1 sequence=1
  115. archived log file name=+FRA/orcl/archivelog/2017_08_26/thread_1_seq_2.304.953026009 thread=1 sequence=2
  116. archived log file name=+FRA/orcl/archivelog/2017_08_26/thread_1_seq_3.305.953026153 thread=1 sequence=3
  117. archived log file name=+FRA/orcl/archivelog/2017_08_26/thread_1_seq_4.306.953027897 thread=1 sequence=4
  118. archived log file name=+FRA/orcl/archivelog/2017_08_26/thread_1_seq_5.307.953027897 thread=1 sequence=5
  119. archived log file name=+FRA/orcl/archivelog/2017_08_26/thread_1_seq_6.308.953027907 thread=1 sequence=6
  120. media recovery complete, elapsed time: 00:00:24
  121. Finished recover at 2017-08-26:10:18:51

  122. RMAN> list incarnation of database;

  123. RMAN-06900: WARNING: unable to generate V$RMAN_STATUS or V$RMAN_OUTPUT row
  124. RMAN-06901: WARNING: disabling update of the V$RMAN_STATUS and V$RMAN_OUTPUT rows
  125. ORACLE error from target database:
  126. ORA-03135: connection lost contact
  127. Process ID: 32253
  128. Session ID: 191 Serial number: 7

  129. RMAN-00571: ===========================================================
  130. RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
  131. RMAN-00571: ===========================================================
  132. RMAN-00601: fatal error in recovery manager
  133. RMAN-03004: fatal error during execution of command
  134. RMAN-04022: target database mount id 1480806535 does not match channel's mount id 1480831473
  135. RMAN-03002: failure of list command at 08/26/2017 10:21:32
  136. ORA-03114: not connected to ORACLE
  137. [oracle@station90 ~]$ rman target  /

  138. Recovery Manager: Release 11.2.0.1.0 - Production on Sat Aug 26 10:21:34 2017

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

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

  141. RMAN> list incarnation of database;

  142. using target database control file instead of recovery catalog

  143. List of Database Incarnations
  144. DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
  145. ------- ------- -------- ---------------- --- ---------- ----------
  146. 1       1       ORCL     1343950367       PARENT  1          2009-08-15:00:16:43
  147. 2       2       ORCL     1343950367       PARENT  945184     2013-05-23:09:47:15
  148. 3       3       ORCL     1343950367       ORPHAN  1082671    2017-08-24:21:40:38
  149. 4       4       ORCL     1343950367       PARENT  1082671    2017-08-26:09:25:11
  150. 5       5       ORCL     1343950367       CURRENT 1106319    2017-08-26:10:21:02

  151. RMAN> list incarnation of database;


  152. List of Database Incarnations
  153. DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
  154. ------- ------- -------- ---------------- --- ---------- ----------
  155. 1       1       ORCL     1343950367       PARENT  1          2009-08-15:00:16:43
  156. 2       2       ORCL     1343950367       PARENT  945184     2013-05-23:09:47:15
  157. 3       3       ORCL     1343950367       ORPHAN  1082671    2017-08-24:21:40:38
  158. 4       4       ORCL     1343950367       PARENT  1082671    2017-08-26:09:25:11
  159. 5       5       ORCL     1343950367       CURRENT 1106319    2017-08-26:10:21:02

  160. RMAN> exit

  161. RMAN-06900: WARNING: unable to generate V$RMAN_STATUS or V$RMAN_OUTPUT row
  162. RMAN-06901: WARNING: disabling update of the V$RMAN_STATUS and V$RMAN_OUTPUT rows
  163. ORACLE error from target database:
  164. ORA-03135: connection lost contact
  165. Process ID: 4457
  166. Session ID: 10 Serial number: 28


  167. Recovery Manager complete.
  168. [oracle@station90 ~]$ rman target  /

  169. Recovery Manager: Release 11.2.0.1.0 - Production on Sat Aug 26 10:35:58 2017

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

  171. connected to target database: ORCL (not mounted)

  172. RMAN> flashback database to sequence 8 thread 1 ;

  173. Starting flashback at 2017-08-26:10:36:50
  174. using target database control file instead of recovery catalog
  175. allocated channel: ORA_DISK_1
  176. channel ORA_DISK_1: SID=192 device type=DISK
  177. allocated channel: ORA_DISK_2
  178. channel ORA_DISK_2: SID=8 device type=DISK
  179. allocated channel: ORA_DISK_3
  180. channel ORA_DISK_3: SID=69 device type=DISK
  181. allocated channel: ORA_DISK_4
  182. channel ORA_DISK_4: SID=132 device type=DISK
  183. allocated channel: ORA_DISK_5
  184. channel ORA_DISK_5: SID=193 device type=DISK
  185. allocated channel: ORA_DISK_6
  186. channel ORA_DISK_6: SID=9 device type=DISK
  187. allocated channel: ORA_DISK_7
  188. channel ORA_DISK_7: SID=70 device type=DISK
  189. allocated channel: ORA_DISK_8
  190. channel ORA_DISK_8: SID=133 device type=DISK
  191. allocated channel: ORA_SBT_TAPE_1
  192. channel ORA_SBT_TAPE_1: SID=194 device type=SBT_TAPE
  193. channel ORA_SBT_TAPE_1: Oracle Secure Backup
  194. allocated channel: ORA_SBT_TAPE_2
  195. channel ORA_SBT_TAPE_2: SID=134 device type=SBT_TAPE
  196. channel ORA_SBT_TAPE_2: Oracle Secure Backup

  197. RMAN-00571: ===========================================================
  198. RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
  199. RMAN-00571: ===========================================================
  200. RMAN-03002: failure of flashback command at 08/26/2017 10:37:03
  201. RMAN-20206: log sequence not found in the repository

  202. RMAN> list  incarnation of database;


  203. List of Database Incarnations
  204. DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
  205. ------- ------- -------- ---------------- --- ---------- ----------
  206. 1       1       ORCL     1343950367       PARENT  1          2009-08-15:00:16:43
  207. 2       2       ORCL     1343950367       PARENT  945184     2013-05-23:09:47:15
  208. 3       3       ORCL     1343950367       ORPHAN  1082671    2017-08-24:21:40:38
  209. 4       4       ORCL     1343950367       PARENT  1082671    2017-08-26:09:25:11
  210. 5       5       ORCL     1343950367       CURRENT 1106319    2017-08-26:10:21:02

  211. RMAN> reset database to incarnation 4;

  212. database reset to incarnation 4

  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          2009-08-15:00:16:43
  218. 2       2       ORCL     1343950367       PARENT  945184     2013-05-23:09:47:15
  219. 3       3       ORCL     1343950367       ORPHAN  1082671    2017-08-24:21:40:38
  220. 4       4       ORCL     1343950367       CURRENT 1082671    2017-08-26:09:25:11
  221. 5       5       ORCL     1343950367       ORPHAN  1106319    2017-08-26:10:21:02

  222. RMAN> flashback database to sequence 8 thread 1 ;

  223. Starting flashback at 2017-08-26:10:38:23
  224. using channel ORA_DISK_1
  225. using channel ORA_DISK_2
  226. using channel ORA_DISK_3
  227. using channel ORA_DISK_4
  228. using channel ORA_DISK_5
  229. using channel ORA_DISK_6
  230. using channel ORA_DISK_7
  231. using channel ORA_DISK_8
  232. using channel ORA_SBT_TAPE_1
  233. using channel ORA_SBT_TAPE_2


  234. starting media recovery

  235. archived log for thread 1 with sequence 1 is already on disk as file +FRA/orcl/archivelog/2017_08_26/thread_1_seq_1.302.953025979
  236. archived log for thread 1 with sequence 2 is already on disk as file +FRA/orcl/archivelog/2017_08_26/thread_1_seq_2.304.953026009
  237. archived log for thread 1 with sequence 3 is already on disk as file +FRA/orcl/archivelog/2017_08_26/thread_1_seq_3.305.953026153
  238. archived log for thread 1 with sequence 4 is already on disk as file +FRA/orcl/archivelog/2017_08_26/thread_1_seq_4.306.953027897
  239. archived log for thread 1 with sequence 5 is already on disk as file +FRA/orcl/archivelog/2017_08_26/thread_1_seq_5.307.953027897
  240. archived log for thread 1 with sequence 6 is already on disk as file +FRA/orcl/archivelog/2017_08_26/thread_1_seq_6.308.953027907
  241. archived log for thread 1 with sequence 7 is already on disk as file +FRA/orcl/archivelog/2017_08_26/thread_1_seq_7.309.953027909
  242. archived log for thread 1 with sequence 8 is already on disk as file +FRA/orcl/archivelog/2017_08_26/thread_1_seq_8.313.953029263
  243. media recovery complete, elapsed time: 00:00:12
  244. Finished flashback at 2017-08-26:10:38:42

  245. RMAN> alter database open resetlogs;

  246. database opened

  247. RMAN>
复制代码
多化身环境下,判断日子断点:
  1. [oracle@station90 ~]$ asmcmd ls +FRA/ORCL/ARCHIVELOG/2017_08_26   > a.txt
复制代码
Screenshot-1.png

UNAMED00004:

Screenshot.png
回复

使用道具 举报

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

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-4-28 21:58 , Processed in 0.044319 second(s), 27 queries .

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