Bo's Oracle Station

查看: 1420|回复: 0

课程第18次(2018-07-17星期二)

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2018-7-17 20:10:01 | 显示全部楼层 |阅读模式
在做11a实验之前:
1. 检查磁带机。2.准备catalog。3.连接catalog做一个
  1. RMAN> backup tag '100T_WHOLE_FULL'  database plus archivelog delete all input;
复制代码
  1. [root@station90 桌面]# su - oracle
  2. [oracle@station90 ~]$ sqlplus /nolog

  3. SQL*Plus: Release 11.2.0.3.0 Production on Tue Jul 17 20:14:56 2018

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

  5. SQL> conn / as sysdba
  6. Connected to an idle instance.
  7. SQL> startup
  8. ORACLE instance started.

  9. Total System Global Area 6664212480 bytes
  10. Fixed Size                    2240944 bytes
  11. Variable Size                 3640659536 bytes
  12. Database Buffers         3003121664 bytes
  13. Redo Buffers                   18190336 bytes
  14. ORA-00205: error in identifying control file, check alert log for more info


  15. SQL> exit
  16. Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
  17. With the Partitioning, OLAP, Data Mining and Real Application Testing options
  18. [oracle@station90 ~]$ rman target /

  19. Recovery Manager: Release 11.2.0.3.0 - Production on Tue Jul 17 20:15:35 2018

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

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

  22. RMAN> list failure;

  23. using target database control file instead of recovery catalog
  24. List of Database Failures
  25. =========================

  26. Failure ID Priority Status    Time Detected Summary
  27. ---------- -------- --------- ------------- -------
  28. 645        CRITICAL OPEN      17-JUL-18     Control file +FRA/orcl/controlfile/current.256.816169633 is missing
  29. 642        CRITICAL OPEN      17-JUL-18     Control file +DATA/orcl/controlfile/current.260.816169631 is missing

  30. RMAN> advise failure;

  31. List of Database Failures
  32. =========================

  33. Failure ID Priority Status    Time Detected Summary
  34. ---------- -------- --------- ------------- -------
  35. 645        CRITICAL OPEN      17-JUL-18     Control file +FRA/orcl/controlfile/current.256.816169633 is missing
  36. 642        CRITICAL OPEN      17-JUL-18     Control file +DATA/orcl/controlfile/current.260.816169631 is missing

  37. analyzing automatic repair options; this may take some time
  38. allocated channel: ORA_DISK_1
  39. channel ORA_DISK_1: SID=131 device type=DISK
  40. analyzing automatic repair options complete

  41. Mandatory Manual Actions
  42. ========================
  43. 1. If file +FRA/orcl/controlfile/current.256.816169633 was unintentionally renamed or moved, restore it
  44. 2. If file +DATA/orcl/controlfile/current.260.816169631 was unintentionally renamed or moved, restore it
  45. 3. If this is a primary database and you have a CREATE CONTROLFILE script, use it to create a new control file
  46. 4. Contact Oracle Support Services if the preceding recommendations cannot be used, or if they do not fix the failures selected for repair

  47. Optional Manual Actions
  48. =======================
  49. 1. If this is a primary database and a standby database is available, then perform a Data Guard failover initiated from the standby

  50. Automated Repair Options
  51. ========================
  52. no automatic repair options available

  53. RMAN> exit


  54. Recovery Manager complete.
  55. [oracle@station90 ~]$ rman target /  catalog u90/oracle_4U@rcat

  56. Recovery Manager: Release 11.2.0.3.0 - Production on Tue Jul 17 20:16:23 2018

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

  58. connected to target database: ORCL (not mounted)
  59. RMAN-04007: WARNING from recovery catalog database: ORA-28002: the password will expire within 7 days

  60. connected to recovery catalog database

  61. RMAN> list backup of controlfile;


  62. List of Backup Sets
  63. ===================


  64. BS Key  Type LV Size       Device Type Elapsed Time Completion Time
  65. ------- ---- -- ---------- ----------- ------------ ---------------
  66. 248     Full    9.50M      SBT_TAPE    00:00:16     22-MAY-17      
  67.         BP Key: 259   Status: AVAILABLE  Compressed: NO  Tag: TAG20170522T204208
  68.         Handle: c-1343950367-20170522-00   Media: station90-000001
  69.   Control File Included: Ckp SCN: 2026879      Ckp time: 22-MAY-17

  70. BS Key  Type LV Size       Device Type Elapsed Time Completion Time
  71. ------- ---- -- ---------- ----------- ------------ ---------------
  72. 254     Full    9.50M      SBT_TAPE    00:00:16     17-JUL-18      
  73.         BP Key: 265   Status: AVAILABLE  Compressed: NO  Tag: TAG20180717T200543
  74.         Handle: c-1343950367-20180717-00   Media: station90-000001
  75.   Control File Included: Ckp SCN: 3896211      Ckp time: 17-JUL-18

  76. BS Key  Type LV Size       Device Type Elapsed Time Completion Time
  77. ------- ---- -- ---------- ----------- ------------ ---------------
  78. 352     Full    9.50M      SBT_TAPE    00:00:16     17-JUL-18      
  79.         BP Key: 356   Status: AVAILABLE  Compressed: NO  Tag: LABS-11A-CONTROLFILE
  80.         Handle: 1ut88jno_1_1   Media: station90-000001
  81.   Control File Included: Ckp SCN: 3896535      Ckp time: 17-JUL-18

  82. BS Key  Type LV Size       Device Type Elapsed Time Completion Time
  83. ------- ---- -- ---------- ----------- ------------ ---------------
  84. 353     Full    9.50M      SBT_TAPE    00:00:16     17-JUL-18      
  85.         BP Key: 357   Status: AVAILABLE  Compressed: NO  Tag: TAG20180717T201202
  86.         Handle: c-1343950367-20180717-01   Media: station90-000001
  87.   Control File Included: Ckp SCN: 3896555      Ckp time: 17-JUL-18

  88. RMAN> restore controlfile;

  89. Starting restore at 17-JUL-18
  90. allocated channel: ORA_DISK_1
  91. channel ORA_DISK_1: SID=131 device type=DISK
  92. allocated channel: ORA_DISK_2
  93. channel ORA_DISK_2: SID=192 device type=DISK
  94. allocated channel: ORA_DISK_3
  95. channel ORA_DISK_3: SID=8 device type=DISK
  96. allocated channel: ORA_DISK_4
  97. channel ORA_DISK_4: SID=69 device type=DISK
  98. allocated channel: ORA_DISK_5
  99. channel ORA_DISK_5: SID=132 device type=DISK
  100. allocated channel: ORA_DISK_6
  101. channel ORA_DISK_6: SID=193 device type=DISK
  102. allocated channel: ORA_DISK_7
  103. channel ORA_DISK_7: SID=9 device type=DISK
  104. allocated channel: ORA_DISK_8
  105. channel ORA_DISK_8: SID=70 device type=DISK
  106. allocated channel: ORA_SBT_TAPE_1
  107. channel ORA_SBT_TAPE_1: SID=133 device type=SBT_TAPE
  108. channel ORA_SBT_TAPE_1: Oracle Secure Backup
  109. allocated channel: ORA_SBT_TAPE_2
  110. channel ORA_SBT_TAPE_2: SID=10 device type=SBT_TAPE
  111. channel ORA_SBT_TAPE_2: Oracle Secure Backup

  112. channel ORA_SBT_TAPE_1: starting datafile backup set restore
  113. channel ORA_SBT_TAPE_1: restoring control file
  114. channel ORA_SBT_TAPE_1: reading from backup piece c-1343950367-20180717-01
  115. channel ORA_SBT_TAPE_1: piece handle=c-1343950367-20180717-01 tag=TAG20180717T201202
  116. channel ORA_SBT_TAPE_1: restored backup piece 1
  117. channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:25
  118. output file name=+DATA/orcl/controlfile/current.263.981749841
  119. output file name=+FRA/orcl/controlfile/current.259.981749847
  120. Finished restore at 17-JUL-18

  121. RMAN> alter database mount;

  122. database mounted
  123. released channel: ORA_DISK_1
  124. released channel: ORA_DISK_2
  125. released channel: ORA_DISK_3
  126. released channel: ORA_DISK_4
  127. released channel: ORA_DISK_5
  128. released channel: ORA_DISK_6
  129. released channel: ORA_DISK_7
  130. released channel: ORA_DISK_8
  131. released channel: ORA_SBT_TAPE_1
  132. released channel: ORA_SBT_TAPE_2

  133. RMAN> recover database;

  134. Starting recover at 17-JUL-18
  135. Starting implicit crosscheck backup at 17-JUL-18
  136. allocated channel: ORA_DISK_1
  137. channel ORA_DISK_1: SID=133 device type=DISK
  138. allocated channel: ORA_DISK_2
  139. channel ORA_DISK_2: SID=194 device type=DISK
  140. allocated channel: ORA_DISK_3
  141. channel ORA_DISK_3: SID=10 device type=DISK
  142. allocated channel: ORA_DISK_4
  143. channel ORA_DISK_4: SID=71 device type=DISK
  144. allocated channel: ORA_DISK_5
  145. channel ORA_DISK_5: SID=132 device type=DISK
  146. allocated channel: ORA_DISK_6
  147. channel ORA_DISK_6: SID=193 device type=DISK
  148. allocated channel: ORA_DISK_7
  149. channel ORA_DISK_7: SID=9 device type=DISK
  150. allocated channel: ORA_DISK_8
  151. channel ORA_DISK_8: SID=70 device type=DISK
  152. Finished implicit crosscheck backup at 17-JUL-18

  153. Starting implicit crosscheck copy at 17-JUL-18
  154. using channel ORA_DISK_1
  155. using channel ORA_DISK_2
  156. using channel ORA_DISK_3
  157. using channel ORA_DISK_4
  158. using channel ORA_DISK_5
  159. using channel ORA_DISK_6
  160. using channel ORA_DISK_7
  161. using channel ORA_DISK_8
  162. Finished implicit crosscheck copy at 17-JUL-18

  163. searching for all files in the recovery area
  164. cataloging files...
  165. no files cataloged

  166. using channel ORA_DISK_1
  167. using channel ORA_DISK_2
  168. using channel ORA_DISK_3
  169. using channel ORA_DISK_4
  170. using channel ORA_DISK_5
  171. using channel ORA_DISK_6
  172. using channel ORA_DISK_7
  173. using channel ORA_DISK_8
  174. allocated channel: ORA_SBT_TAPE_1
  175. channel ORA_SBT_TAPE_1: SID=131 device type=SBT_TAPE
  176. channel ORA_SBT_TAPE_1: Oracle Secure Backup
  177. allocated channel: ORA_SBT_TAPE_2
  178. channel ORA_SBT_TAPE_2: SID=8 device type=SBT_TAPE
  179. channel ORA_SBT_TAPE_2: Oracle Secure Backup

  180. starting media recovery

  181. archived log for thread 1 with sequence 164 is already on disk as file +FRA/orcl/archivelog/2018_07_17/thread_1_seq_164.287.981749483
  182. archived log for thread 1 with sequence 165 is already on disk as file +FRA/orcl/archivelog/2018_07_17/thread_1_seq_165.288.981749485
  183. archived log file name=+FRA/orcl/archivelog/2018_07_17/thread_1_seq_164.287.981749483 thread=1 sequence=164
  184. archived log file name=+FRA/orcl/archivelog/2018_07_17/thread_1_seq_165.288.981749485 thread=1 sequence=165
  185. unable to find archived log
  186. archived log thread=1 sequence=166
  187. RMAN-00571: ===========================================================
  188. RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
  189. RMAN-00571: ===========================================================
  190. RMAN-03002: failure of recover command at 07/17/2018 20:18:20
  191. RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 166 and starting SCN of 3896514

  192. RMAN> list failure ;

  193. List of Database Failures
  194. =========================

  195. Failure ID Priority Status    Time Detected Summary
  196. ---------- -------- --------- ------------- -------
  197. 676        CRITICAL OPEN      17-JUL-18     System datafile 1: '+DATA/orcl/datafile/system.256.816169553' needs media recovery
  198. 673        CRITICAL OPEN      17-JUL-18     Control file needs media recovery
  199. 8          HIGH     OPEN      17-JUL-18     One or more non-system datafiles need media recovery

  200. RMAN> advise failure;

  201. List of Database Failures
  202. =========================

  203. Failure ID Priority Status    Time Detected Summary
  204. ---------- -------- --------- ------------- -------
  205. 676        CRITICAL OPEN      17-JUL-18     System datafile 1: '+DATA/orcl/datafile/system.256.816169553' needs media recovery
  206. 673        CRITICAL OPEN      17-JUL-18     Control file needs media recovery
  207. 8          HIGH     OPEN      17-JUL-18     One or more non-system datafiles need media recovery

  208. analyzing automatic repair options; this may take some time
  209. using channel ORA_DISK_1
  210. using channel ORA_DISK_2
  211. using channel ORA_DISK_3
  212. using channel ORA_DISK_4
  213. using channel ORA_DISK_5
  214. using channel ORA_DISK_6
  215. using channel ORA_DISK_7
  216. using channel ORA_DISK_8
  217. using channel ORA_SBT_TAPE_1
  218. using channel ORA_SBT_TAPE_2
  219. analyzing automatic repair options complete

  220. Mandatory Manual Actions
  221. ========================
  222. no manual actions available

  223. Optional Manual Actions
  224. =======================
  225. 1. If you have the correct version of the control file, then shutdown the database and replace the old control file
  226. 2. If you restored the wrong version of data file +DATA/orcl/datafile/system.256.816169553, then replace it with the correct one
  227. 3. If you restored the wrong version of data file +DATA/orcl/datafile/sysaux.257.816169553, then replace it with the correct one
  228. 4. If you restored the wrong version of data file +DATA/orcl/datafile/undotbs1.258.816169553, then replace it with the correct one
  229. 5. If you restored the wrong version of data file +DATA/orcl/datafile/users.259.816169553, then replace it with the correct one
  230. 6. If you restored the wrong version of data file +DATA/orcl/datafile/example.265.816169651, then replace it with the correct one

  231. Automated Repair Options
  232. ========================
  233. Option Repair Description
  234. ------ ------------------
  235. 1      Perform incomplete database recovery  
  236.   Strategy: The repair includes point-in-time recovery with some data loss
  237.   Repair script: /u01/app/oracle/diag/rdbms/orcl/orcl/hm/reco_2346318570.hm

  238. RMAN> repair failure preview;

  239. Strategy: The repair includes point-in-time recovery with some data loss
  240. Repair script: /u01/app/oracle/diag/rdbms/orcl/orcl/hm/reco_2346318570.hm

  241. contents of repair script:
  242.    # database point-in-time recovery until a missing log
  243.    restore database until scn 3896514;
  244.    recover database until scn 3896514;
  245.    alter database open resetlogs;

  246. RMAN> run {
  247. 2> set until sequence  166  thread 1;
  248. 3> restore database;
  249. 4> recover database;
  250. 5> }

  251. executing command: SET until clause

  252. Starting restore at 17-JUL-18
  253. using channel ORA_DISK_1
  254. using channel ORA_DISK_2
  255. using channel ORA_DISK_3
  256. using channel ORA_DISK_4
  257. using channel ORA_DISK_5
  258. using channel ORA_DISK_6
  259. using channel ORA_DISK_7
  260. using channel ORA_DISK_8
  261. using channel ORA_SBT_TAPE_1
  262. using channel ORA_SBT_TAPE_2

  263. channel ORA_SBT_TAPE_1: starting datafile backup set restore
  264. channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
  265. channel ORA_SBT_TAPE_1: restoring datafile 00001 to +DATA/orcl/datafile/system.256.816169553
  266. channel ORA_SBT_TAPE_1: restoring datafile 00005 to +DATA/orcl/datafile/example.265.816169651
  267. channel ORA_SBT_TAPE_1: reading from backup piece 1rt88jb3_1_1
  268. channel ORA_SBT_TAPE_2: starting datafile backup set restore
  269. channel ORA_SBT_TAPE_2: specifying datafile(s) to restore from backup set
  270. channel ORA_SBT_TAPE_2: restoring datafile 00002 to +DATA/orcl/datafile/sysaux.257.816169553
  271. channel ORA_SBT_TAPE_2: restoring datafile 00003 to +DATA/orcl/datafile/undotbs1.258.816169553
  272. channel ORA_SBT_TAPE_2: restoring datafile 00004 to +DATA/orcl/datafile/users.259.816169553
  273. channel ORA_SBT_TAPE_2: reading from backup piece 1qt88jb3_1_1
  274. channel ORA_SBT_TAPE_1: piece handle=1rt88jb3_1_1 tag=100T_WHOLE_FULL
  275. channel ORA_SBT_TAPE_1: restored backup piece 1
  276. channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:55
  277. channel ORA_SBT_TAPE_2: piece handle=1qt88jb3_1_1 tag=100T_WHOLE_FULL
  278. channel ORA_SBT_TAPE_2: restored backup piece 1
  279. channel ORA_SBT_TAPE_2: restore complete, elapsed time: 00:01:05
  280. Finished restore at 17-JUL-18

  281. Starting recover at 17-JUL-18
  282. using channel ORA_DISK_1
  283. using channel ORA_DISK_2
  284. using channel ORA_DISK_3
  285. using channel ORA_DISK_4
  286. using channel ORA_DISK_5
  287. using channel ORA_DISK_6
  288. using channel ORA_DISK_7
  289. using channel ORA_DISK_8
  290. using channel ORA_SBT_TAPE_1
  291. using channel ORA_SBT_TAPE_2

  292. starting media recovery

  293. archived log for thread 1 with sequence 160 is already on disk as file +FRA/orcl/archivelog/2018_07_17/thread_1_seq_160.283.981749477
  294. archived log for thread 1 with sequence 161 is already on disk as file +FRA/orcl/archivelog/2018_07_17/thread_1_seq_161.284.981749479
  295. archived log for thread 1 with sequence 162 is already on disk as file +FRA/orcl/archivelog/2018_07_17/thread_1_seq_162.285.981749481
  296. archived log for thread 1 with sequence 163 is already on disk as file +FRA/orcl/archivelog/2018_07_17/thread_1_seq_163.286.981749481
  297. archived log for thread 1 with sequence 164 is already on disk as file +FRA/orcl/archivelog/2018_07_17/thread_1_seq_164.287.981749483
  298. archived log for thread 1 with sequence 165 is already on disk as file +FRA/orcl/archivelog/2018_07_17/thread_1_seq_165.288.981749485
  299. channel ORA_SBT_TAPE_1: starting archived log restore to default destination
  300. channel ORA_SBT_TAPE_1: restoring archived log
  301. archived log thread=1 sequence=159
  302. channel ORA_SBT_TAPE_1: reading from backup piece 1st88jbu_1_1
  303. channel ORA_SBT_TAPE_1: piece handle=1st88jbu_1_1 tag=100T_WHOLE_FULL
  304. channel ORA_SBT_TAPE_1: restored backup piece 1
  305. channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:25
  306. archived log file name=+FRA/orcl/archivelog/2018_07_17/thread_1_seq_159.258.981750195 thread=1 sequence=159
  307. channel default: deleting archived log(s)
  308. archived log file name=+FRA/orcl/archivelog/2018_07_17/thread_1_seq_159.258.981750195 RECID=158 STAMP=981750194
  309. archived log file name=+FRA/orcl/archivelog/2018_07_17/thread_1_seq_160.283.981749477 thread=1 sequence=160
  310. archived log file name=+FRA/orcl/archivelog/2018_07_17/thread_1_seq_161.284.981749479 thread=1 sequence=161
  311. archived log file name=+FRA/orcl/archivelog/2018_07_17/thread_1_seq_162.285.981749481 thread=1 sequence=162
  312. archived log file name=+FRA/orcl/archivelog/2018_07_17/thread_1_seq_163.286.981749481 thread=1 sequence=163
  313. archived log file name=+FRA/orcl/archivelog/2018_07_17/thread_1_seq_164.287.981749483 thread=1 sequence=164
  314. archived log file name=+FRA/orcl/archivelog/2018_07_17/thread_1_seq_165.288.981749485 thread=1 sequence=165
  315. media recovery complete, elapsed time: 00:00:02
  316. Finished recover at 17-JUL-18

  317. RMAN> alter database open resetlogs;

  318. database opened
  319. new incarnation of database registered in recovery catalog
  320. starting full resync of recovery catalog
  321. full resync complete

  322. RMAN>
复制代码






回复

使用道具 举报

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

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-3-28 21:50 , Processed in 0.034726 second(s), 24 queries .

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