设为首页收藏本站

Botang唐波's Oracle Station

查看: 604|回复: 0

课程第32次(2016-06-07星期二):【上完1Z0-052的第16章】:恢复,并做完实验1a和实验3

[复制链接]

744

主题

1117

帖子

8081

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
8081
发表于 2016-6-8 10:04:52 | 显示全部楼层 |阅读模式
【上完1Z0-052的第16章】:恢复,并做完实验1a和实验3
【1Z0-051】:共10章(0 1 2 3 4 5 6 7 8 9)
【1Z0-052】:共12章(0 1 2 3 4 5 6 9 10 14 15 16)
【1Z0-053】:共5章(0 1 10 11 12)

  1. [root@station90 桌面]# su - oracle
  2. [oracle@station90 ~]$ sqlplus /nolog

  3. SQL*Plus: Release 11.2.0.1.0 Production on Thu Jun 9 20:58:03 2016

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

  5. SQL> conn / as sysdba
  6. Connected.
  7. SQL> alter database datafile 4 offline ;

  8. Database altered.

  9. SQL> exit
  10. Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
  11. With the Partitioning, Automatic Storage Management, OLAP, Data Mining
  12. and Real Application Testing options
  13. [oracle@station90 ~]$ rman target /

  14. Recovery Manager: Release 11.2.0.1.0 - Production on Thu Jun 9 20:58:51 2016

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

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

  17. RMAN> list backup of datafile 4 ;

  18. using target database control file instead of recovery catalog

  19. List of Backup Sets
  20. ===================


  21. BS Key  Type LV Size       Device Type Elapsed Time Completion Time
  22. ------- ---- -- ---------- ----------- ------------ ---------------
  23. 88      Full    1.06M      SBT_TAPE    00:00:15     09-JUN-16      
  24.         BP Key: 88   Status: AVAILABLE  Compressed: NO  Tag: TAG20160609T202130
  25.         Handle: 33r7o2ma_1_1   Media: station90-000013
  26.   List of Datafiles in backup set 88
  27.   File LV Type Ckp SCN    Ckp Time  Name
  28.   ---- -- ---- ---------- --------- ----
  29.   4       Full 1577931    09-JUN-16 +DATA/orcl/datafile/users.259.914098875

  30. RMAN> crosscheck backupset 88;

  31. allocated channel: ORA_DISK_1
  32. channel ORA_DISK_1: SID=143 device type=DISK
  33. allocated channel: ORA_DISK_2
  34. channel ORA_DISK_2: SID=199 device type=DISK
  35. allocated channel: ORA_DISK_3
  36. channel ORA_DISK_3: SID=76 device type=DISK
  37. allocated channel: ORA_DISK_4
  38. channel ORA_DISK_4: SID=142 device type=DISK
  39. allocated channel: ORA_DISK_5
  40. channel ORA_DISK_5: SID=195 device type=DISK
  41. allocated channel: ORA_DISK_6
  42. channel ORA_DISK_6: SID=14 device type=DISK
  43. allocated channel: ORA_DISK_7
  44. channel ORA_DISK_7: SID=81 device type=DISK
  45. allocated channel: ORA_DISK_8
  46. channel ORA_DISK_8: SID=130 device type=DISK
  47. allocated channel: ORA_SBT_TAPE_1
  48. channel ORA_SBT_TAPE_1: SID=194 device type=SBT_TAPE
  49. channel ORA_SBT_TAPE_1: Oracle Secure Backup
  50. allocated channel: ORA_SBT_TAPE_2
  51. channel ORA_SBT_TAPE_2: SID=13 device type=SBT_TAPE
  52. channel ORA_SBT_TAPE_2: Oracle Secure Backup
  53. allocated channel: ORA_SBT_TAPE_3
  54. channel ORA_SBT_TAPE_3: SID=75 device type=SBT_TAPE
  55. channel ORA_SBT_TAPE_3: Oracle Secure Backup
  56. allocated channel: ORA_SBT_TAPE_4
  57. channel ORA_SBT_TAPE_4: SID=139 device type=SBT_TAPE
  58. channel ORA_SBT_TAPE_4: Oracle Secure Backup
  59. allocated channel: ORA_SBT_TAPE_5
  60. channel ORA_SBT_TAPE_5: SID=198 device type=SBT_TAPE
  61. channel ORA_SBT_TAPE_5: Oracle Secure Backup
  62. allocated channel: ORA_SBT_TAPE_6
  63. channel ORA_SBT_TAPE_6: SID=137 device type=SBT_TAPE
  64. channel ORA_SBT_TAPE_6: Oracle Secure Backup
  65. allocated channel: ORA_SBT_TAPE_7
  66. channel ORA_SBT_TAPE_7: SID=191 device type=SBT_TAPE
  67. channel ORA_SBT_TAPE_7: Oracle Secure Backup
  68. allocated channel: ORA_SBT_TAPE_8
  69. channel ORA_SBT_TAPE_8: SID=12 device type=SBT_TAPE
  70. channel ORA_SBT_TAPE_8: Oracle Secure Backup
  71. crosschecked backup piece: found to be 'AVAILABLE'
  72. backup piece handle=33r7o2ma_1_1 RECID=88 STAMP=914098890
  73. Crosschecked 1 objects


  74. RMAN> list backup of datafile 4;


  75. List of Backup Sets
  76. ===================


  77. BS Key  Type LV Size       Device Type Elapsed Time Completion Time
  78. ------- ---- -- ---------- ----------- ------------ ---------------
  79. 88      Full    1.06M      SBT_TAPE    00:00:15     09-JUN-16      
  80.         BP Key: 88   Status: AVAILABLE  Compressed: NO  Tag: TAG20160609T202130
  81.         Handle: 33r7o2ma_1_1   Media: station90-000013
  82.   List of Datafiles in backup set 88
  83.   File LV Type Ckp SCN    Ckp Time  Name
  84.   ---- -- ---- ---------- --------- ----
  85.   4       Full 1577931    09-JUN-16 +DATA/orcl/datafile/users.259.914098875

  86. RMAN> restore datafile 4;

  87. Starting restore at 09-JUN-16
  88. using channel ORA_DISK_1
  89. using channel ORA_DISK_2
  90. using channel ORA_DISK_3
  91. using channel ORA_DISK_4
  92. using channel ORA_DISK_5
  93. using channel ORA_DISK_6
  94. using channel ORA_DISK_7
  95. using channel ORA_DISK_8
  96. using channel ORA_SBT_TAPE_1
  97. using channel ORA_SBT_TAPE_2
  98. using channel ORA_SBT_TAPE_3
  99. using channel ORA_SBT_TAPE_4
  100. using channel ORA_SBT_TAPE_5
  101. using channel ORA_SBT_TAPE_6
  102. using channel ORA_SBT_TAPE_7
  103. using channel ORA_SBT_TAPE_8

  104. channel ORA_SBT_TAPE_1: starting datafile backup set restore
  105. channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
  106. channel ORA_SBT_TAPE_1: restoring datafile 00004 to +DATA/orcl/datafile/users.259.914098875
  107. channel ORA_SBT_TAPE_1: reading from backup piece 33r7o2ma_1_1
  108. channel ORA_SBT_TAPE_1: piece handle=33r7o2ma_1_1 tag=TAG20160609T202130
  109. channel ORA_SBT_TAPE_1: restored backup piece 1
  110. channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:25
  111. Finished restore at 09-JUN-16

  112. RMAN> recover datafile 4 ;

  113. Starting recover at 09-JUN-16
  114. using channel ORA_DISK_1
  115. using channel ORA_DISK_2
  116. using channel ORA_DISK_3
  117. using channel ORA_DISK_4
  118. using channel ORA_DISK_5
  119. using channel ORA_DISK_6
  120. using channel ORA_DISK_7
  121. using channel ORA_DISK_8
  122. using channel ORA_SBT_TAPE_1
  123. using channel ORA_SBT_TAPE_2
  124. using channel ORA_SBT_TAPE_3
  125. using channel ORA_SBT_TAPE_4
  126. using channel ORA_SBT_TAPE_5
  127. using channel ORA_SBT_TAPE_6
  128. using channel ORA_SBT_TAPE_7
  129. using channel ORA_SBT_TAPE_8

  130. starting media recovery

  131. archived log for thread 1 with sequence 36 is already on disk as file +FRA/orcl/archivelog/2016_06_09/thread_1_seq_36.292.914100303
  132. archived log for thread 1 with sequence 37 is already on disk as file +FRA/orcl/archivelog/2016_06_09/thread_1_seq_37.289.914100303
  133. archived log for thread 1 with sequence 38 is already on disk as file +FRA/orcl/archivelog/2016_06_09/thread_1_seq_38.293.914100305
  134. archived log for thread 1 with sequence 39 is already on disk as file +FRA/orcl/archivelog/2016_06_09/thread_1_seq_39.290.914100305
  135. archived log for thread 1 with sequence 40 is already on disk as file +FRA/orcl/archivelog/2016_06_09/thread_1_seq_40.291.914100309
  136. archived log for thread 1 with sequence 41 is already on disk as file +FRA/orcl/archivelog/2016_06_09/thread_1_seq_41.295.914100311
  137. archived log file name=+FRA/orcl/archivelog/2016_06_09/thread_1_seq_36.292.914100303 thread=1 sequence=36
  138. archived log file name=+FRA/orcl/archivelog/2016_06_09/thread_1_seq_37.289.914100303 thread=1 sequence=37
  139. archived log file name=+FRA/orcl/archivelog/2016_06_09/thread_1_seq_38.293.914100305 thread=1 sequence=38
  140. archived log file name=+FRA/orcl/archivelog/2016_06_09/thread_1_seq_39.290.914100305 thread=1 sequence=39
  141. media recovery complete, elapsed time: 00:00:00
  142. Finished recover at 09-JUN-16

  143. RMAN> list failure ;

  144. RMAN-06900: WARNING: unable to generate V$RMAN_STATUS or V$RMAN_OUTPUT row
  145. RMAN-06901: WARNING: disabling update of the V$RMAN_STATUS and V$RMAN_OUTPUT rows
  146. ORACLE error from target database:
  147. ORA-03135: connection lost contact
  148. Process ID: 17539
  149. Session ID: 196 Serial number: 825

  150. RMAN-00571: ===========================================================
  151. RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
  152. RMAN-00571: ===========================================================

  153. RMAN> exit


  154. Recovery Manager complete.
  155. [oracle@station90 ~]$ rman target /

  156. Recovery Manager: Release 11.2.0.1.0 - Production on Thu Jun 9 21:25:02 2016

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

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

  159. RMAN> list failure ;

  160. using target database control file instead of recovery catalog
  161. List of Database Failures
  162. =========================

  163. Failure ID Priority Status    Time Detected Summary
  164. ---------- -------- --------- ------------- -------
  165. 2122       CRITICAL OPEN      09-JUN-16     System datafile 1: '+DATA/orcl/datafile/system.256.816169553' is missing
  166. 2008       HIGH     OPEN      09-JUN-16     Tablespace 4: 'USERS' is offline

  167. RMAN> advise failure 2122;

  168. List of Database Failures
  169. =========================

  170. Failure ID Priority Status    Time Detected Summary
  171. ---------- -------- --------- ------------- -------
  172. 2122       CRITICAL OPEN      09-JUN-16     System datafile 1: '+DATA/orcl/datafile/system.256.816169553' is missing

  173. analyzing automatic repair options; this may take some time
  174. allocated channel: ORA_DISK_1
  175. channel ORA_DISK_1: SID=135 device type=DISK
  176. allocated channel: ORA_DISK_2
  177. channel ORA_DISK_2: SID=195 device type=DISK
  178. allocated channel: ORA_DISK_3
  179. channel ORA_DISK_3: SID=11 device type=DISK
  180. allocated channel: ORA_DISK_4
  181. channel ORA_DISK_4: SID=71 device type=DISK
  182. allocated channel: ORA_DISK_5
  183. channel ORA_DISK_5: SID=134 device type=DISK
  184. allocated channel: ORA_DISK_6
  185. channel ORA_DISK_6: SID=194 device type=DISK
  186. allocated channel: ORA_DISK_7
  187. channel ORA_DISK_7: SID=10 device type=DISK
  188. allocated channel: ORA_DISK_8
  189. channel ORA_DISK_8: SID=69 device type=DISK
  190. allocated channel: ORA_SBT_TAPE_1
  191. channel ORA_SBT_TAPE_1: SID=133 device type=SBT_TAPE
  192. channel ORA_SBT_TAPE_1: Oracle Secure Backup
  193. allocated channel: ORA_SBT_TAPE_2
  194. channel ORA_SBT_TAPE_2: SID=8 device type=SBT_TAPE
  195. channel ORA_SBT_TAPE_2: Oracle Secure Backup
  196. allocated channel: ORA_SBT_TAPE_3
  197. channel ORA_SBT_TAPE_3: SID=193 device type=SBT_TAPE
  198. channel ORA_SBT_TAPE_3: Oracle Secure Backup
  199. allocated channel: ORA_SBT_TAPE_4
  200. channel ORA_SBT_TAPE_4: SID=68 device type=SBT_TAPE
  201. channel ORA_SBT_TAPE_4: Oracle Secure Backup
  202. allocated channel: ORA_SBT_TAPE_5
  203. channel ORA_SBT_TAPE_5: SID=132 device type=SBT_TAPE
  204. channel ORA_SBT_TAPE_5: Oracle Secure Backup
  205. allocated channel: ORA_SBT_TAPE_6
  206. channel ORA_SBT_TAPE_6: SID=192 device type=SBT_TAPE
  207. channel ORA_SBT_TAPE_6: Oracle Secure Backup
  208. allocated channel: ORA_SBT_TAPE_7
  209. channel ORA_SBT_TAPE_7: SID=7 device type=SBT_TAPE
  210. channel ORA_SBT_TAPE_7: Oracle Secure Backup
  211. allocated channel: ORA_SBT_TAPE_8
  212. channel ORA_SBT_TAPE_8: SID=72 device type=SBT_TAPE
  213. channel ORA_SBT_TAPE_8: Oracle Secure Backup
  214. analyzing automatic repair options complete

  215. Mandatory Manual Actions
  216. ========================
  217. no manual actions available

  218. Optional Manual Actions
  219. =======================
  220. 1. If file +DATA/orcl/datafile/system.256.816169553 was unintentionally renamed or moved, restore it

  221. Automated Repair Options
  222. ========================
  223. Option Repair Description
  224. ------ ------------------
  225. 1      Restore and recover datafile 1  
  226.   Strategy: The repair includes complete media recovery with no data loss
  227.   Repair script: /u01/app/oracle/diag/rdbms/orcl/orcl/hm/reco_1742424864.hm

  228. RMAN> repair failure preview;

  229. Strategy: The repair includes complete media recovery with no data loss
  230. Repair script: /u01/app/oracle/diag/rdbms/orcl/orcl/hm/reco_1742424864.hm

  231. contents of repair script:
  232.    # restore and recover datafile
  233.    restore datafile 1;
  234.    recover datafile 1;

  235. RMAN> repair failure ;

  236. Strategy: The repair includes complete media recovery with no data loss
  237. Repair script: /u01/app/oracle/diag/rdbms/orcl/orcl/hm/reco_1742424864.hm

  238. contents of repair script:
  239.    # restore and recover datafile
  240.    restore datafile 1;
  241.    recover datafile 1;

  242. Do you really want to execute the above repair (enter YES or NO)? YES
  243. executing repair script

  244. Starting restore at 09-JUN-16
  245. using channel ORA_DISK_1
  246. using channel ORA_DISK_2
  247. using channel ORA_DISK_3
  248. using channel ORA_DISK_4
  249. using channel ORA_DISK_5
  250. using channel ORA_DISK_6
  251. using channel ORA_DISK_7
  252. using channel ORA_DISK_8
  253. using channel ORA_SBT_TAPE_1
  254. using channel ORA_SBT_TAPE_2
  255. using channel ORA_SBT_TAPE_3
  256. using channel ORA_SBT_TAPE_4
  257. using channel ORA_SBT_TAPE_5
  258. using channel ORA_SBT_TAPE_6
  259. using channel ORA_SBT_TAPE_7
  260. using channel ORA_SBT_TAPE_8

  261. channel ORA_SBT_TAPE_1: starting datafile backup set restore
  262. channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
  263. channel ORA_SBT_TAPE_1: restoring datafile 00001 to +DATA/orcl/datafile/system.256.816169553
  264. channel ORA_SBT_TAPE_1: reading from backup piece 31r7o2en_1_1
  265. channel ORA_SBT_TAPE_1: piece handle=31r7o2en_1_1 tag=TAG20160609T201727
  266. channel ORA_SBT_TAPE_1: restored backup piece 1
  267. channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:45
  268. Finished restore at 09-JUN-16

  269. Starting recover at 09-JUN-16
  270. using channel ORA_DISK_1
  271. using channel ORA_DISK_2
  272. using channel ORA_DISK_3
  273. using channel ORA_DISK_4
  274. using channel ORA_DISK_5
  275. using channel ORA_DISK_6
  276. using channel ORA_DISK_7
  277. using channel ORA_DISK_8
  278. using channel ORA_SBT_TAPE_1
  279. using channel ORA_SBT_TAPE_2
  280. using channel ORA_SBT_TAPE_3
  281. using channel ORA_SBT_TAPE_4
  282. using channel ORA_SBT_TAPE_5
  283. using channel ORA_SBT_TAPE_6
  284. using channel ORA_SBT_TAPE_7
  285. using channel ORA_SBT_TAPE_8

  286. starting media recovery

  287. archived log for thread 1 with sequence 36 is already on disk as file +FRA/orcl/archivelog/2016_06_09/thread_1_seq_36.292.914100303
  288. archived log for thread 1 with sequence 37 is already on disk as file +FRA/orcl/archivelog/2016_06_09/thread_1_seq_37.289.914100303
  289. archived log for thread 1 with sequence 38 is already on disk as file +FRA/orcl/archivelog/2016_06_09/thread_1_seq_38.293.914100305
  290. archived log for thread 1 with sequence 39 is already on disk as file +FRA/orcl/archivelog/2016_06_09/thread_1_seq_39.290.914100305
  291. archived log for thread 1 with sequence 40 is already on disk as file +FRA/orcl/archivelog/2016_06_09/thread_1_seq_40.291.914100309
  292. archived log for thread 1 with sequence 41 is already on disk as file +FRA/orcl/archivelog/2016_06_09/thread_1_seq_41.295.914100311
  293. archived log for thread 1 with sequence 42 is already on disk as file +FRA/orcl/archivelog/2016_06_09/thread_1_seq_42.301.914102245
  294. archived log for thread 1 with sequence 43 is already on disk as file +FRA/orcl/archivelog/2016_06_09/thread_1_seq_43.300.914102245
  295. archived log for thread 1 with sequence 44 is already on disk as file +FRA/orcl/archivelog/2016_06_09/thread_1_seq_44.303.914102245
  296. archived log for thread 1 with sequence 45 is already on disk as file +FRA/orcl/archivelog/2016_06_09/thread_1_seq_45.305.914102249
  297. archived log for thread 1 with sequence 46 is already on disk as file +FRA/orcl/archivelog/2016_06_09/thread_1_seq_46.306.914102249
  298. archived log for thread 1 with sequence 47 is already on disk as file +FRA/orcl/archivelog/2016_06_09/thread_1_seq_47.316.914102253
  299. archived log file name=+FRA/orcl/archivelog/2016_06_09/thread_1_seq_36.292.914100303 thread=1 sequence=36
  300. archived log file name=+FRA/orcl/archivelog/2016_06_09/thread_1_seq_37.289.914100303 thread=1 sequence=37
  301. archived log file name=+FRA/orcl/archivelog/2016_06_09/thread_1_seq_38.293.914100305 thread=1 sequence=38
  302. archived log file name=+FRA/orcl/archivelog/2016_06_09/thread_1_seq_39.290.914100305 thread=1 sequence=39
  303. archived log file name=+FRA/orcl/archivelog/2016_06_09/thread_1_seq_40.291.914100309 thread=1 sequence=40
  304. archived log file name=+FRA/orcl/archivelog/2016_06_09/thread_1_seq_41.295.914100311 thread=1 sequence=41
  305. archived log file name=+FRA/orcl/archivelog/2016_06_09/thread_1_seq_42.301.914102245 thread=1 sequence=42
  306. archived log file name=+FRA/orcl/archivelog/2016_06_09/thread_1_seq_43.300.914102245 thread=1 sequence=43
  307. archived log file name=+FRA/orcl/archivelog/2016_06_09/thread_1_seq_44.303.914102245 thread=1 sequence=44
  308. archived log file name=+FRA/orcl/archivelog/2016_06_09/thread_1_seq_45.305.914102249 thread=1 sequence=45
  309. media recovery complete, elapsed time: 00:00:01
  310. Finished recover at 09-JUN-16
  311. repair failure complete

  312. RMAN> exit


  313. Recovery Manager complete.
  314. [oracle@station90 ~]$ sqlplus /nolog

  315. SQL*Plus: Release 11.2.0.1.0 Production on Thu Jun 9 21:29:11 2016

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

  317. SQL> conn / as sysdba
  318. Connected.
  319. SQL> select  open_mode from v$database;

  320. OPEN_MODE
  321. --------------------
  322. MOUNTED

  323. SQL> alter database open ;

  324. Database altered.

  325. SQL>
复制代码

Screenshot.png

回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2018-11-19 14:48 , Processed in 0.185532 second(s), 27 queries .

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