Bo's Oracle Station

查看: 1719|回复: 2

课程第24/25次(2018-04-01星期日上下午)

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2018-4-1 10:09:54 | 显示全部楼层 |阅读模式
准备环境:
  1. SQL> create table t05311_g ( a  number )  ;

  2. Table created.

  3. SQL> insert into t05311_g values ( 0 ) ;

  4. 1 row created.

  5. SQL> commit;

  6. Commit complete.

  7. SQL> create table t05311_h( a number ) tablespace example;

  8. Table created.

  9. SQL> insert into t05311_h values ( 0 ) ;

  10. 1 row created.

  11. SQL> commit;

  12. Commit complete.

  13. SQL> drop table t05311_g;

  14. Table dropped.

  15. SQL> drop table t05311_h;

  16. Table dropped.


复制代码

DBA来purge:

  1. select  * from dba_recyclebin;

  2. purge  tablespace users user hr;
复制代码

Screenshot-PL-SQL Developer - sys@ORCL as SYSDBA - [SQL Window - select * from d.png

  1. Block images can be reused to quickly back out the data file changes to any time at which flashback logs are captured just before the desired target time. Then, changes from the redo log files are applied to fill in the gap. The Flashback Database logs are automatically created and managed in the flash recovery area.
复制代码
  1. select  d.FLASHBACK_ON
  2. from v_$database d;

  3. alter database flashback on ;

  4. select  * from v$flashback_database_log;

  5. select  * from v$flashback_database_logfile;

  6. select  * from v$flashback_database_stat;

  7. alter system set db_flashback_retention_target=2880;

复制代码
实验5:
  1. [root@station90 ~]# su - oracle
  2. [oracle@station90 ~]$ sqlplus /nolog

  3. SQL*Plus: Release 11.2.0.1.0 Production on Sun Apr 1 15:01:38 2018

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

  5. SQL> conn / as sysdba
  6. Connected.
  7. SQL> select * from hr.t32306;
  8. select * from hr.t32306
  9.                  *
  10. ERROR at line 1:
  11. ORA-00942: table or view does not exist


  12. SQL> select  * from dba_recyclebin;

  13. OWNER                               OBJECT_NAME
  14. ------------------------------ ------------------------------
  15. ORIGINAL_NAME                         OPERATION TYPE
  16. -------------------------------- --------- -------------------------
  17. TS_NAME                        CREATETIME           DROPTIME
  18. ------------------------------ ------------------- -------------------
  19.    DROPSCN PARTITION_NAME                    CAN CAN    RELATED BASE_OBJECT
  20. ---------- -------------------------------- --- --- ---------- -----------
  21. PURGE_OBJECT          SPACE
  22. ------------ ----------
  23. HR                               BIN$aMCjof82IyngUKjAWgAEQg==$0
  24. T05311_H                         DROP           TABLE
  25. EXAMPLE                        2018-04-01:10:06:36 2018-04-01:10:07:55

  26. OWNER                               OBJECT_NAME
  27. ------------------------------ ------------------------------
  28. ORIGINAL_NAME                         OPERATION TYPE
  29. -------------------------------- --------- -------------------------
  30. TS_NAME                        CREATETIME           DROPTIME
  31. ------------------------------ ------------------- -------------------
  32.    DROPSCN PARTITION_NAME                    CAN CAN    RELATED BASE_OBJECT
  33. ---------- -------------------------------- --- --- ---------- -----------
  34. PURGE_OBJECT          SPACE
  35. ------------ ----------
  36.    1426786                                    YES YES         74742             74742
  37.        74742              8


  38. SQL> select  count(*) from dba_recyclebin;

  39.   COUNT(*)
  40. ----------
  41.          1

  42. SQL> select  open_mode from v$database;

  43. OPEN_MODE
  44. --------------------
  45. READ WRITE

  46. SQL> shutdown abort
  47. ORACLE instance shut down.
  48. SQL> startup mount
  49. ORACLE instance started.

  50. Total System Global Area 6680915968 bytes
  51. Fixed Size                    2213936 bytes
  52. Variable Size                 3623880656 bytes
  53. Database Buffers         3019898880 bytes
  54. Redo Buffers                   34922496 bytes
  55. Database mounted.
  56. SQL> exit
  57. Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
  58. With the Partitioning, Automatic Storage Management, OLAP, Data Mining
  59. and Real Application Testing options
  60. [oracle@station90 ~]$ rman target  /

  61. Recovery Manager: Release 11.2.0.1.0 - Production on Sun Apr 1 15:04:37 2018

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

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

  64. RMAN> run {
  65. 2> sql "alter session set nls_date_format=''YYYY-MM-DD:HH24:MI:SS''";
  66. 3> set until time '2018-04-01:14:58:07';
  67. 4> restore database;
  68. 5> recover database;
  69. 6> }

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

  72. executing command: SET until clause

  73. Starting restore at 01-APR-18
  74. allocated channel: ORA_DISK_1
  75. channel ORA_DISK_1: SID=68 device type=DISK
  76. allocated channel: ORA_DISK_2
  77. channel ORA_DISK_2: SID=131 device type=DISK
  78. allocated channel: ORA_DISK_3
  79. channel ORA_DISK_3: SID=192 device type=DISK
  80. allocated channel: ORA_DISK_4
  81. channel ORA_DISK_4: SID=8 device type=DISK
  82. allocated channel: ORA_DISK_5
  83. channel ORA_DISK_5: SID=69 device type=DISK
  84. allocated channel: ORA_DISK_6
  85. channel ORA_DISK_6: SID=132 device type=DISK
  86. allocated channel: ORA_DISK_7
  87. channel ORA_DISK_7: SID=193 device type=DISK
  88. allocated channel: ORA_DISK_8
  89. channel ORA_DISK_8: SID=9 device type=DISK
  90. allocated channel: ORA_SBT_TAPE_1
  91. channel ORA_SBT_TAPE_1: SID=70 device type=SBT_TAPE
  92. channel ORA_SBT_TAPE_1: Oracle Secure Backup
  93. allocated channel: ORA_SBT_TAPE_2
  94. channel ORA_SBT_TAPE_2: SID=194 device type=SBT_TAPE
  95. channel ORA_SBT_TAPE_2: Oracle Secure Backup
  96. flashing back control file to SCN 1451907

  97. channel ORA_SBT_TAPE_1: starting datafile backup set restore
  98. channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
  99. channel ORA_SBT_TAPE_1: restoring datafile 00002 to +DATA/orcl/datafile/sysaux.257.816169553
  100. channel ORA_SBT_TAPE_1: restoring datafile 00003 to +DATA/orcl/datafile/undotbs1.258.816169553
  101. channel ORA_SBT_TAPE_1: restoring datafile 00004 to +DATA/orcl/datafile/users.259.816169553
  102. channel ORA_SBT_TAPE_1: reading from backup piece 13s4ih4j_1_1
  103. channel ORA_SBT_TAPE_2: starting datafile backup set restore
  104. channel ORA_SBT_TAPE_2: specifying datafile(s) to restore from backup set
  105. channel ORA_SBT_TAPE_2: restoring datafile 00001 to +DATA/orcl/datafile/system.256.816169553
  106. channel ORA_SBT_TAPE_2: restoring datafile 00005 to +DATA/orcl/datafile/example.265.816169651
  107. channel ORA_SBT_TAPE_2: reading from backup piece 12s4ih4j_1_1
  108. channel ORA_SBT_TAPE_1: piece handle=13s4ih4j_1_1 tag=0T_INCR0_WHOLE
  109. channel ORA_SBT_TAPE_1: restored backup piece 1
  110. channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:45
  111. channel ORA_SBT_TAPE_2: piece handle=12s4ih4j_1_1 tag=0T_INCR0_WHOLE
  112. channel ORA_SBT_TAPE_2: restored backup piece 1
  113. channel ORA_SBT_TAPE_2: restore complete, elapsed time: 00:00:55
  114. Finished restore at 01-APR-18

  115. Starting recover at 01-APR-18
  116. using channel ORA_DISK_1
  117. using channel ORA_DISK_2
  118. using channel ORA_DISK_3
  119. using channel ORA_DISK_4
  120. using channel ORA_DISK_5
  121. using channel ORA_DISK_6
  122. using channel ORA_DISK_7
  123. using channel ORA_DISK_8
  124. using channel ORA_SBT_TAPE_1
  125. using channel ORA_SBT_TAPE_2

  126. starting media recovery

  127. archived log for thread 1 with sequence 20 is already on disk as file +FRA/orcl/archivelog/2018_03_29/thread_1_seq_20.262.972060893
  128. archived log for thread 1 with sequence 21 is already on disk as file +FRA/orcl/archivelog/2018_03_29/thread_1_seq_21.261.972060939
  129. archived log for thread 1 with sequence 22 is already on disk as file +FRA/orcl/archivelog/2018_03_29/thread_1_seq_22.263.972070275
  130. archived log for thread 1 with sequence 23 is already on disk as file +FRA/orcl/archivelog/2018_03_29/thread_1_seq_23.264.972071759
  131. archived log for thread 1 with sequence 24 is already on disk as file +FRA/orcl/archivelog/2018_03_29/thread_1_seq_24.265.972072815
  132. archived log for thread 1 with sequence 25 is already on disk as file +FRA/orcl/archivelog/2018_03_29/thread_1_seq_25.266.972072905
  133. archived log for thread 1 with sequence 26 is already on disk as file +FRA/orcl/archivelog/2018_03_29/thread_1_seq_26.267.972073043
  134. archived log for thread 1 with sequence 27 is already on disk as file +FRA/orcl/archivelog/2018_03_29/thread_1_seq_27.268.972073051
  135. archived log for thread 1 with sequence 28 is already on disk as file +FRA/orcl/archivelog/2018_03_29/thread_1_seq_28.269.972073063
  136. archived log for thread 1 with sequence 29 is already on disk as file +FRA/orcl/archivelog/2018_03_29/thread_1_seq_29.270.972079239
  137. archived log for thread 1 with sequence 30 is already on disk as file +FRA/orcl/archivelog/2018_03_29/thread_1_seq_30.271.972079311
  138. archived log for thread 1 with sequence 31 is already on disk as file +FRA/orcl/archivelog/2018_03_29/thread_1_seq_31.272.972079365
  139. archived log for thread 1 with sequence 32 is already on disk as file +FRA/orcl/archivelog/2018_03_30/thread_1_seq_32.273.972119851
  140. archived log for thread 1 with sequence 33 is already on disk as file +FRA/orcl/archivelog/2018_03_30/thread_1_seq_33.274.972120503
  141. archived log for thread 1 with sequence 34 is already on disk as file +FRA/orcl/archivelog/2018_03_30/thread_1_seq_34.275.972126049
  142. archived log for thread 1 with sequence 35 is already on disk as file +FRA/orcl/archivelog/2018_03_30/thread_1_seq_35.276.972134249
  143. archived log for thread 1 with sequence 36 is already on disk as file +FRA/orcl/archivelog/2018_03_30/thread_1_seq_36.277.972142677
  144. archived log for thread 1 with sequence 37 is already on disk as file +FRA/orcl/archivelog/2018_03_30/thread_1_seq_37.278.972161139
  145. archived log for thread 1 with sequence 38 is already on disk as file +FRA/orcl/archivelog/2018_03_30/thread_1_seq_38.279.972162905
  146. archived log for thread 1 with sequence 39 is already on disk as file +FRA/orcl/archivelog/2018_03_30/thread_1_seq_39.280.972165649
  147. archived log for thread 1 with sequence 40 is already on disk as file +FRA/orcl/archivelog/2018_03_30/thread_1_seq_40.281.972166117
  148. archived log for thread 1 with sequence 41 is already on disk as file +FRA/orcl/archivelog/2018_03_31/thread_1_seq_41.282.972206295
  149. archived log for thread 1 with sequence 42 is already on disk as file +FRA/orcl/archivelog/2018_03_31/thread_1_seq_42.283.972208237
  150. archived log for thread 1 with sequence 43 is already on disk as file +FRA/orcl/archivelog/2018_03_31/thread_1_seq_43.284.972212455
  151. archived log for thread 1 with sequence 44 is already on disk as file +FRA/orcl/archivelog/2018_03_31/thread_1_seq_44.285.972224729
  152. archived log for thread 1 with sequence 45 is already on disk as file +FRA/orcl/archivelog/2018_03_31/thread_1_seq_45.286.972231635
  153. archived log for thread 1 with sequence 46 is already on disk as file +FRA/orcl/archivelog/2018_03_31/thread_1_seq_46.287.972237931
  154. archived log for thread 1 with sequence 47 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_47.288.972292287
  155. archived log for thread 1 with sequence 48 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_48.289.972292375
  156. archived log for thread 1 with sequence 49 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_49.290.972292459
  157. archived log for thread 1 with sequence 50 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_50.291.972293883
  158. archived log for thread 1 with sequence 51 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_51.292.972293981
  159. archived log for thread 1 with sequence 52 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_52.293.972294939
  160. archived log for thread 1 with sequence 53 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_53.295.972298807
  161. archived log for thread 1 with sequence 54 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_54.297.972306021
  162. archived log for thread 1 with sequence 55 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_55.299.972307191
  163. archived log for thread 1 with sequence 56 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_56.301.972309643
  164. archived log for thread 1 with sequence 57 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_57.302.972313083
  165. archived log for thread 1 with sequence 58 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_58.303.972313083
  166. archived log for thread 1 with sequence 59 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_59.304.972313093
  167. channel ORA_SBT_TAPE_1: starting archived log restore to default destination
  168. channel ORA_SBT_TAPE_1: restoring archived log
  169. archived log thread=1 sequence=19
  170. channel ORA_SBT_TAPE_1: reading from backup piece 14s4ih5n_1_1
  171. channel ORA_SBT_TAPE_1: piece handle=14s4ih5n_1_1 tag=0T_INCR0_WHOLE
  172. channel ORA_SBT_TAPE_1: restored backup piece 1
  173. channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:25
  174. archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_19.308.972313925 thread=1 sequence=19
  175. channel default: deleting archived log(s)
  176. archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_19.308.972313925 RECID=61 STAMP=972313930
  177. archived log file name=+FRA/orcl/archivelog/2018_03_29/thread_1_seq_20.262.972060893 thread=1 sequence=20
  178. archived log file name=+FRA/orcl/archivelog/2018_03_29/thread_1_seq_21.261.972060939 thread=1 sequence=21
  179. archived log file name=+FRA/orcl/archivelog/2018_03_29/thread_1_seq_22.263.972070275 thread=1 sequence=22
  180. archived log file name=+FRA/orcl/archivelog/2018_03_29/thread_1_seq_23.264.972071759 thread=1 sequence=23
  181. archived log file name=+FRA/orcl/archivelog/2018_03_29/thread_1_seq_24.265.972072815 thread=1 sequence=24
  182. archived log file name=+FRA/orcl/archivelog/2018_03_29/thread_1_seq_25.266.972072905 thread=1 sequence=25
  183. archived log file name=+FRA/orcl/archivelog/2018_03_29/thread_1_seq_26.267.972073043 thread=1 sequence=26
  184. archived log file name=+FRA/orcl/archivelog/2018_03_29/thread_1_seq_27.268.972073051 thread=1 sequence=27
  185. archived log file name=+FRA/orcl/archivelog/2018_03_29/thread_1_seq_28.269.972073063 thread=1 sequence=28
  186. archived log file name=+FRA/orcl/archivelog/2018_03_29/thread_1_seq_29.270.972079239 thread=1 sequence=29
  187. archived log file name=+FRA/orcl/archivelog/2018_03_29/thread_1_seq_30.271.972079311 thread=1 sequence=30
  188. archived log file name=+FRA/orcl/archivelog/2018_03_29/thread_1_seq_31.272.972079365 thread=1 sequence=31
  189. archived log file name=+FRA/orcl/archivelog/2018_03_30/thread_1_seq_32.273.972119851 thread=1 sequence=32
  190. archived log file name=+FRA/orcl/archivelog/2018_03_30/thread_1_seq_33.274.972120503 thread=1 sequence=33
  191. archived log file name=+FRA/orcl/archivelog/2018_03_30/thread_1_seq_34.275.972126049 thread=1 sequence=34
  192. archived log file name=+FRA/orcl/archivelog/2018_03_30/thread_1_seq_35.276.972134249 thread=1 sequence=35
  193. archived log file name=+FRA/orcl/archivelog/2018_03_30/thread_1_seq_36.277.972142677 thread=1 sequence=36
  194. archived log file name=+FRA/orcl/archivelog/2018_03_30/thread_1_seq_37.278.972161139 thread=1 sequence=37
  195. archived log file name=+FRA/orcl/archivelog/2018_03_30/thread_1_seq_38.279.972162905 thread=1 sequence=38
  196. archived log file name=+FRA/orcl/archivelog/2018_03_30/thread_1_seq_39.280.972165649 thread=1 sequence=39
  197. archived log file name=+FRA/orcl/archivelog/2018_03_30/thread_1_seq_40.281.972166117 thread=1 sequence=40
  198. archived log file name=+FRA/orcl/archivelog/2018_03_31/thread_1_seq_41.282.972206295 thread=1 sequence=41
  199. archived log file name=+FRA/orcl/archivelog/2018_03_31/thread_1_seq_42.283.972208237 thread=1 sequence=42
  200. archived log file name=+FRA/orcl/archivelog/2018_03_31/thread_1_seq_43.284.972212455 thread=1 sequence=43
  201. archived log file name=+FRA/orcl/archivelog/2018_03_31/thread_1_seq_44.285.972224729 thread=1 sequence=44
  202. archived log file name=+FRA/orcl/archivelog/2018_03_31/thread_1_seq_45.286.972231635 thread=1 sequence=45
  203. archived log file name=+FRA/orcl/archivelog/2018_03_31/thread_1_seq_46.287.972237931 thread=1 sequence=46
  204. archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_47.288.972292287 thread=1 sequence=47
  205. archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_48.289.972292375 thread=1 sequence=48
  206. archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_49.290.972292459 thread=1 sequence=49
  207. archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_50.291.972293883 thread=1 sequence=50
  208. archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_51.292.972293981 thread=1 sequence=51
  209. archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_52.293.972294939 thread=1 sequence=52
  210. archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_53.295.972298807 thread=1 sequence=53
  211. archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_54.297.972306021 thread=1 sequence=54
  212. archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_55.299.972307191 thread=1 sequence=55
  213. archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_56.301.972309643 thread=1 sequence=56
  214. archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_57.302.972313083 thread=1 sequence=57
  215. archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_58.303.972313083 thread=1 sequence=58
  216. archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_59.304.972313093 thread=1 sequence=59
  217. media recovery complete, elapsed time: 00:00:55
  218. Finished recover at 01-APR-18

  219. RMAN> alter database open ;

  220. RMAN-00571: ===========================================================
  221. RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
  222. RMAN-00571: ===========================================================
  223. RMAN-03002: failure of alter db command at 04/01/2018 15:14:11
  224. ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

  225. RMAN> exit


  226. Recovery Manager complete.
  227. [oracle@station90 ~]$ sqlplus /nolog

  228. SQL*Plus: Release 11.2.0.1.0 Production on Sun Apr 1 15:15:55 2018

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

  230. SQL> conn / as sysdba
  231. Connected.
  232. SQL> alter database open read only;

  233. Database altered.

  234. SQL> select * from hr.t32306;

  235.          A
  236. ----------
  237.          1

  238. SQL>
  239. SQL> shutdown immediate
  240. Database closed.
  241. Database dismounted.
  242. ORACLE instance shut down.
  243. SQL> exit
  244. Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
  245. With the Partitioning, Automatic Storage Management, OLAP, Data Mining
  246. and Real Application Testing options
  247. [oracle@station90 ~]$ rman target /

  248. Recovery Manager: Release 11.2.0.1.0 - Production on Sun Apr 1 15:16:47 2018

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

  250. connected to target database (not started)

  251. RMAN> list incarnation of database;

  252. using target database control file instead of recovery catalog
  253. RMAN-00571: ===========================================================
  254. RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
  255. RMAN-00571: ===========================================================
  256. RMAN-03002: failure of list command at 04/01/2018 15:16:53
  257. RMAN-06403: could not obtain a fully authorized session
  258. ORA-01034: ORACLE not available
  259. ORA-27101: shared memory realm does not exist
  260. Linux-x86_64 Error: 2: No such file or directory

  261. RMAN> startup mount

  262. Oracle instance started
  263. database mounted

  264. Total System Global Area    6680915968 bytes

  265. Fixed Size                     2213936 bytes
  266. Variable Size               3623880656 bytes
  267. Database Buffers            3019898880 bytes
  268. Redo Buffers                  34922496 bytes

  269. RMAN> list incarnation of database;


  270. List of Database Incarnations
  271. DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
  272. ------- ------- -------- ---------------- --- ---------- ----------
  273. 1       1       ORCL     1343950367       PARENT  1          15-AUG-09
  274. 2       2       ORCL     1343950367       CURRENT 945184     23-MAY-13

  275. RMAN> alter database open resetlogs;

  276. database opened

  277. RMAN> list incarnation of database;


  278. List of Database Incarnations
  279. DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
  280. ------- ------- -------- ---------------- --- ---------- ----------
  281. 1       1       ORCL     1343950367       PARENT  1          15-AUG-09
  282. 2       2       ORCL     1343950367       PARENT  945184     23-MAY-13
  283. 3       3       ORCL     1343950367       CURRENT 1451975    01-APR-18

  284. RMAN>
复制代码

实验六:

[root@station90 ~]# su - oracle
[oracle@station90 ~]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.1.0 Production on Sun Apr 1 16:27:54 2018

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

SQL> conn / as sysdba
Connected.
SQL> select * from  hr.t24394;
select * from  hr.t24394
                  *
ERROR at line 1:
ORA-00942: table or view does not exist


SQL> shutdown abort
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.

Total System Global Area 6680915968 bytes
Fixed Size            2213936 bytes
Variable Size         3623880656 bytes
Database Buffers     3019898880 bytes
Redo Buffers           34922496 bytes
Database mounted.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
[oracle@station90 ~]$ rman target  /

Recovery Manager: Release 11.2.0.1.0 - Production on Sun Apr 1 16:28:32 2018

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

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

RMAN> run {
2> set until sequence 48 thread 1;
3> restore database;
4> recover database;
5> }

executing command: SET until clause

Starting restore at 01-APR-18
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=68 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=131 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=192 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=8 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=69 device type=DISK
allocated channel: ORA_DISK_6
channel ORA_DISK_6: SID=132 device type=DISK
allocated channel: ORA_DISK_7
channel ORA_DISK_7: SID=193 device type=DISK
allocated channel: ORA_DISK_8
channel ORA_DISK_8: SID=9 device type=DISK
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: SID=70 device type=SBT_TAPE
channel ORA_SBT_TAPE_1: Oracle Secure Backup
allocated channel: ORA_SBT_TAPE_2
channel ORA_SBT_TAPE_2: SID=194 device type=SBT_TAPE
channel ORA_SBT_TAPE_2: Oracle Secure Backup
flashing back control file to SCN 1456351

channel ORA_SBT_TAPE_1: starting datafile backup set restore
channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
channel ORA_SBT_TAPE_1: restoring datafile 00002 to +DATA/orcl/datafile/sysaux.257.816169553
channel ORA_SBT_TAPE_1: restoring datafile 00003 to +DATA/orcl/datafile/undotbs1.258.816169553
channel ORA_SBT_TAPE_1: restoring datafile 00004 to +DATA/orcl/datafile/users.259.816169553
channel ORA_SBT_TAPE_1: reading from backup piece 13s4ih4j_1_1
channel ORA_SBT_TAPE_2: starting datafile backup set restore
channel ORA_SBT_TAPE_2: specifying datafile(s) to restore from backup set
channel ORA_SBT_TAPE_2: restoring datafile 00001 to +DATA/orcl/datafile/system.256.816169553
channel ORA_SBT_TAPE_2: restoring datafile 00005 to +DATA/orcl/datafile/example.265.816169651
channel ORA_SBT_TAPE_2: reading from backup piece 12s4ih4j_1_1
channel ORA_SBT_TAPE_1: piece handle=13s4ih4j_1_1 tag=0T_INCR0_WHOLE
channel ORA_SBT_TAPE_1: restored backup piece 1
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:45
channel ORA_SBT_TAPE_2: piece handle=12s4ih4j_1_1 tag=0T_INCR0_WHOLE
channel ORA_SBT_TAPE_2: restored backup piece 1
channel ORA_SBT_TAPE_2: restore complete, elapsed time: 00:00:45
Finished restore at 01-APR-18

Starting recover at 01-APR-18
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5
using channel ORA_DISK_6
using channel ORA_DISK_7
using channel ORA_DISK_8
using channel ORA_SBT_TAPE_1
using channel ORA_SBT_TAPE_2

starting media recovery

archived log for thread 1 with sequence 20 is already on disk as file +FRA/orcl/archivelog/2018_03_29/thread_1_seq_20.262.972060893
archived log for thread 1 with sequence 21 is already on disk as file +FRA/orcl/archivelog/2018_03_29/thread_1_seq_21.261.972060939
archived log for thread 1 with sequence 22 is already on disk as file +FRA/orcl/archivelog/2018_03_29/thread_1_seq_22.263.972070275
archived log for thread 1 with sequence 23 is already on disk as file +FRA/orcl/archivelog/2018_03_29/thread_1_seq_23.264.972071759
archived log for thread 1 with sequence 24 is already on disk as file +FRA/orcl/archivelog/2018_03_29/thread_1_seq_24.265.972072815
archived log for thread 1 with sequence 25 is already on disk as file +FRA/orcl/archivelog/2018_03_29/thread_1_seq_25.266.972072905
archived log for thread 1 with sequence 26 is already on disk as file +FRA/orcl/archivelog/2018_03_29/thread_1_seq_26.267.972073043
archived log for thread 1 with sequence 27 is already on disk as file +FRA/orcl/archivelog/2018_03_29/thread_1_seq_27.268.972073051
archived log for thread 1 with sequence 28 is already on disk as file +FRA/orcl/archivelog/2018_03_29/thread_1_seq_28.269.972073063
archived log for thread 1 with sequence 29 is already on disk as file +FRA/orcl/archivelog/2018_03_29/thread_1_seq_29.270.972079239
archived log for thread 1 with sequence 30 is already on disk as file +FRA/orcl/archivelog/2018_03_29/thread_1_seq_30.271.972079311
archived log for thread 1 with sequence 31 is already on disk as file +FRA/orcl/archivelog/2018_03_29/thread_1_seq_31.272.972079365
archived log for thread 1 with sequence 32 is already on disk as file +FRA/orcl/archivelog/2018_03_30/thread_1_seq_32.273.972119851
archived log for thread 1 with sequence 33 is already on disk as file +FRA/orcl/archivelog/2018_03_30/thread_1_seq_33.274.972120503
archived log for thread 1 with sequence 34 is already on disk as file +FRA/orcl/archivelog/2018_03_30/thread_1_seq_34.275.972126049
archived log for thread 1 with sequence 35 is already on disk as file +FRA/orcl/archivelog/2018_03_30/thread_1_seq_35.276.972134249
archived log for thread 1 with sequence 36 is already on disk as file +FRA/orcl/archivelog/2018_03_30/thread_1_seq_36.277.972142677
archived log for thread 1 with sequence 37 is already on disk as file +FRA/orcl/archivelog/2018_03_30/thread_1_seq_37.278.972161139
archived log for thread 1 with sequence 38 is already on disk as file +FRA/orcl/archivelog/2018_03_30/thread_1_seq_38.279.972162905
archived log for thread 1 with sequence 39 is already on disk as file +FRA/orcl/archivelog/2018_03_30/thread_1_seq_39.280.972165649
archived log for thread 1 with sequence 40 is already on disk as file +FRA/orcl/archivelog/2018_03_30/thread_1_seq_40.281.972166117
archived log for thread 1 with sequence 41 is already on disk as file +FRA/orcl/archivelog/2018_03_31/thread_1_seq_41.282.972206295
archived log for thread 1 with sequence 42 is already on disk as file +FRA/orcl/archivelog/2018_03_31/thread_1_seq_42.283.972208237
archived log for thread 1 with sequence 43 is already on disk as file +FRA/orcl/archivelog/2018_03_31/thread_1_seq_43.284.972212455
archived log for thread 1 with sequence 44 is already on disk as file +FRA/orcl/archivelog/2018_03_31/thread_1_seq_44.285.972224729
archived log for thread 1 with sequence 45 is already on disk as file +FRA/orcl/archivelog/2018_03_31/thread_1_seq_45.286.972231635
archived log for thread 1 with sequence 46 is already on disk as file +FRA/orcl/archivelog/2018_03_31/thread_1_seq_46.287.972237931
archived log for thread 1 with sequence 47 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_47.288.972292287
archived log for thread 1 with sequence 48 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_48.289.972292375
archived log for thread 1 with sequence 49 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_49.290.972292459
archived log for thread 1 with sequence 50 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_50.291.972293883
archived log for thread 1 with sequence 51 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_51.292.972293981
archived log for thread 1 with sequence 52 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_52.293.972294939
archived log for thread 1 with sequence 53 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_53.295.972298807
archived log for thread 1 with sequence 54 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_54.297.972306021
archived log for thread 1 with sequence 55 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_55.299.972307191
archived log for thread 1 with sequence 56 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_56.301.972309643
archived log for thread 1 with sequence 57 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_57.302.972313083
archived log for thread 1 with sequence 58 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_58.303.972313083
archived log for thread 1 with sequence 59 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_59.304.972313093
archived log for thread 1 with sequence 1 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_1.318.972317853
archived log for thread 1 with sequence 2 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_2.319.972317855
archived log for thread 1 with sequence 3 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_3.320.972317859
archived log for thread 1 with sequence 4 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_4.321.972317859
archived log for thread 1 with sequence 5 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_5.322.972317861
archived log for thread 1 with sequence 6 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_6.323.972317861
archived log for thread 1 with sequence 7 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_7.324.972317863
archived log for thread 1 with sequence 8 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_8.325.972317863
archived log for thread 1 with sequence 9 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_9.326.972317865
archived log for thread 1 with sequence 10 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_10.327.972317865
archived log for thread 1 with sequence 11 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_11.328.972317865
archived log for thread 1 with sequence 12 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_12.329.972317865
archived log for thread 1 with sequence 13 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_13.330.972317867
archived log for thread 1 with sequence 14 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_14.331.972317871
archived log for thread 1 with sequence 15 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_15.332.972317873
archived log for thread 1 with sequence 16 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_16.333.972317873
archived log for thread 1 with sequence 17 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_17.334.972317875
archived log for thread 1 with sequence 18 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_18.335.972317875
archived log for thread 1 with sequence 19 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_19.336.972317877
archived log for thread 1 with sequence 20 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_20.337.972317879
archived log for thread 1 with sequence 21 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_21.338.972317879
archived log for thread 1 with sequence 22 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_22.339.972317879
archived log for thread 1 with sequence 23 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_23.340.972317881
archived log for thread 1 with sequence 24 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_24.341.972317883
archived log for thread 1 with sequence 25 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_25.342.972317885
archived log for thread 1 with sequence 26 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_26.343.972317885
archived log for thread 1 with sequence 27 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_27.344.972317889
archived log for thread 1 with sequence 28 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_28.345.972317889
archived log for thread 1 with sequence 29 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_29.346.972317895
archived log for thread 1 with sequence 30 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_30.347.972317895
archived log for thread 1 with sequence 31 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_31.348.972317897
archived log for thread 1 with sequence 32 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_32.349.972317901
archived log for thread 1 with sequence 33 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_33.350.972317901
archived log for thread 1 with sequence 34 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_34.351.972317903
archived log for thread 1 with sequence 35 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_35.352.972317903
archived log for thread 1 with sequence 36 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_36.353.972317905
archived log for thread 1 with sequence 37 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_37.354.972317907
archived log for thread 1 with sequence 38 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_38.355.972317909
archived log for thread 1 with sequence 39 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_39.356.972317913
archived log for thread 1 with sequence 40 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_40.357.972317915
archived log for thread 1 with sequence 41 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_41.358.972317915
archived log for thread 1 with sequence 42 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_42.359.972317917
archived log for thread 1 with sequence 43 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_43.360.972317919
archived log for thread 1 with sequence 44 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_44.361.972318087
archived log for thread 1 with sequence 45 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_45.362.972318089
archived log for thread 1 with sequence 46 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_46.363.972318099
archived log for thread 1 with sequence 47 is already on disk as file +FRA/orcl/archivelog/2018_04_01/thread_1_seq_47.364.972318103
channel ORA_SBT_TAPE_1: starting archived log restore to default destination
channel ORA_SBT_TAPE_1: restoring archived log
archived log thread=1 sequence=19
channel ORA_SBT_TAPE_1: reading from backup piece 14s4ih5n_1_1
channel ORA_SBT_TAPE_1: piece handle=14s4ih5n_1_1 tag=0T_INCR0_WHOLE
channel ORA_SBT_TAPE_1: restored backup piece 1
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:25
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_19.367.972319107 thread=1 sequence=19
channel default: deleting archived log(s)
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_19.367.972319107 RECID=123 STAMP=972319112
archived log file name=+FRA/orcl/archivelog/2018_03_29/thread_1_seq_20.262.972060893 thread=1 sequence=20
archived log file name=+FRA/orcl/archivelog/2018_03_29/thread_1_seq_21.261.972060939 thread=1 sequence=21
archived log file name=+FRA/orcl/archivelog/2018_03_29/thread_1_seq_22.263.972070275 thread=1 sequence=22
archived log file name=+FRA/orcl/archivelog/2018_03_29/thread_1_seq_23.264.972071759 thread=1 sequence=23
archived log file name=+FRA/orcl/archivelog/2018_03_29/thread_1_seq_24.265.972072815 thread=1 sequence=24
archived log file name=+FRA/orcl/archivelog/2018_03_29/thread_1_seq_25.266.972072905 thread=1 sequence=25
archived log file name=+FRA/orcl/archivelog/2018_03_29/thread_1_seq_26.267.972073043 thread=1 sequence=26
archived log file name=+FRA/orcl/archivelog/2018_03_29/thread_1_seq_27.268.972073051 thread=1 sequence=27
archived log file name=+FRA/orcl/archivelog/2018_03_29/thread_1_seq_28.269.972073063 thread=1 sequence=28
archived log file name=+FRA/orcl/archivelog/2018_03_29/thread_1_seq_29.270.972079239 thread=1 sequence=29
archived log file name=+FRA/orcl/archivelog/2018_03_29/thread_1_seq_30.271.972079311 thread=1 sequence=30
archived log file name=+FRA/orcl/archivelog/2018_03_29/thread_1_seq_31.272.972079365 thread=1 sequence=31
archived log file name=+FRA/orcl/archivelog/2018_03_30/thread_1_seq_32.273.972119851 thread=1 sequence=32
archived log file name=+FRA/orcl/archivelog/2018_03_30/thread_1_seq_33.274.972120503 thread=1 sequence=33
archived log file name=+FRA/orcl/archivelog/2018_03_30/thread_1_seq_34.275.972126049 thread=1 sequence=34
archived log file name=+FRA/orcl/archivelog/2018_03_30/thread_1_seq_35.276.972134249 thread=1 sequence=35
archived log file name=+FRA/orcl/archivelog/2018_03_30/thread_1_seq_36.277.972142677 thread=1 sequence=36
archived log file name=+FRA/orcl/archivelog/2018_03_30/thread_1_seq_37.278.972161139 thread=1 sequence=37
archived log file name=+FRA/orcl/archivelog/2018_03_30/thread_1_seq_38.279.972162905 thread=1 sequence=38
archived log file name=+FRA/orcl/archivelog/2018_03_30/thread_1_seq_39.280.972165649 thread=1 sequence=39
archived log file name=+FRA/orcl/archivelog/2018_03_30/thread_1_seq_40.281.972166117 thread=1 sequence=40
archived log file name=+FRA/orcl/archivelog/2018_03_31/thread_1_seq_41.282.972206295 thread=1 sequence=41
archived log file name=+FRA/orcl/archivelog/2018_03_31/thread_1_seq_42.283.972208237 thread=1 sequence=42
archived log file name=+FRA/orcl/archivelog/2018_03_31/thread_1_seq_43.284.972212455 thread=1 sequence=43
archived log file name=+FRA/orcl/archivelog/2018_03_31/thread_1_seq_44.285.972224729 thread=1 sequence=44
archived log file name=+FRA/orcl/archivelog/2018_03_31/thread_1_seq_45.286.972231635 thread=1 sequence=45
archived log file name=+FRA/orcl/archivelog/2018_03_31/thread_1_seq_46.287.972237931 thread=1 sequence=46
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_47.288.972292287 thread=1 sequence=47
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_48.289.972292375 thread=1 sequence=48
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_49.290.972292459 thread=1 sequence=49
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_50.291.972293883 thread=1 sequence=50
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_51.292.972293981 thread=1 sequence=51
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_52.293.972294939 thread=1 sequence=52
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_53.295.972298807 thread=1 sequence=53
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_54.297.972306021 thread=1 sequence=54
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_55.299.972307191 thread=1 sequence=55
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_56.301.972309643 thread=1 sequence=56
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_57.302.972313083 thread=1 sequence=57
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_58.303.972313083 thread=1 sequence=58
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_59.304.972313093 thread=1 sequence=59
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_1.318.972317853 thread=1 sequence=1
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_2.319.972317855 thread=1 sequence=2
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_3.320.972317859 thread=1 sequence=3
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_4.321.972317859 thread=1 sequence=4
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_5.322.972317861 thread=1 sequence=5
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_6.323.972317861 thread=1 sequence=6
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_7.324.972317863 thread=1 sequence=7
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_8.325.972317863 thread=1 sequence=8
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_9.326.972317865 thread=1 sequence=9
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_10.327.972317865 thread=1 sequence=10
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_11.328.972317865 thread=1 sequence=11
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_12.329.972317865 thread=1 sequence=12
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_13.330.972317867 thread=1 sequence=13
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_14.331.972317871 thread=1 sequence=14
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_15.332.972317873 thread=1 sequence=15
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_16.333.972317873 thread=1 sequence=16
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_17.334.972317875 thread=1 sequence=17
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_18.335.972317875 thread=1 sequence=18
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_19.336.972317877 thread=1 sequence=19
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_20.337.972317879 thread=1 sequence=20
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_21.338.972317879 thread=1 sequence=21
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_22.339.972317879 thread=1 sequence=22
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_23.340.972317881 thread=1 sequence=23
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_24.341.972317883 thread=1 sequence=24
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_25.342.972317885 thread=1 sequence=25
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_26.343.972317885 thread=1 sequence=26
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_27.344.972317889 thread=1 sequence=27
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_28.345.972317889 thread=1 sequence=28
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_29.346.972317895 thread=1 sequence=29
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_30.347.972317895 thread=1 sequence=30
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_31.348.972317897 thread=1 sequence=31
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_32.349.972317901 thread=1 sequence=32
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_33.350.972317901 thread=1 sequence=33
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_34.351.972317903 thread=1 sequence=34
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_35.352.972317903 thread=1 sequence=35
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_36.353.972317905 thread=1 sequence=36
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_37.354.972317907 thread=1 sequence=37
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_38.355.972317909 thread=1 sequence=38
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_39.356.972317913 thread=1 sequence=39
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_40.357.972317915 thread=1 sequence=40
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_41.358.972317915 thread=1 sequence=41
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_42.359.972317917 thread=1 sequence=42
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_43.360.972317919 thread=1 sequence=43
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_44.361.972318087 thread=1 sequence=44
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_45.362.972318089 thread=1 sequence=45
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_46.363.972318099 thread=1 sequence=46
archived log file name=+FRA/orcl/archivelog/2018_04_01/thread_1_seq_47.364.972318103 thread=1 sequence=47
media recovery complete, elapsed time: 00:01:06
Finished recover at 01-APR-18

RMAN> exit


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

SQL*Plus: Release 11.2.0.1.0 Production on Sun Apr 1 16:40:24 2018

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

SQL> conn / as sysdba
Connected.
SQL> alter database open read only ;

Database altered.

SQL> select * from  hr.t24394;

     A
----------
     1

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.

Total System Global Area 6680915968 bytes
Fixed Size            2213936 bytes
Variable Size         3623880656 bytes
Database Buffers     3019898880 bytes
Redo Buffers           34922496 bytes
Database mounted.
SQL> alter database open resetlogs;

Database altered.

SQL>


对磁盘组里的归档日志进行时间排序:
[oracle@station90 ~]$ asmcmd ls +fra/ORCL/ARCHIVELOG/2018_04_01 | sort -n -t . -k 3
thread_1_seq_47.288.972292287
thread_1_seq_48.289.972292375
thread_1_seq_49.290.972292459
thread_1_seq_50.291.972293883
thread_1_seq_51.292.972293981
thread_1_seq_52.293.972294939
thread_1_seq_53.295.972298807
thread_1_seq_54.297.972306021
thread_1_seq_55.299.972307191
thread_1_seq_56.301.972309643
thread_1_seq_57.302.972313083
thread_1_seq_58.303.972313083
thread_1_seq_59.304.972313093
thread_1_seq_60.305.972313095
thread_1_seq_61.306.972313097
thread_1_seq_62.307.972313097
thread_1_seq_61.308.972314251
thread_1_seq_62.309.972314251
thread_1_seq_63.310.972314251
thread_1_seq_1.313.972315131
thread_1_seq_1.314.972316213
thread_1_seq_2.315.972316213
thread_1_seq_1.318.972317853
thread_1_seq_2.319.972317855
thread_1_seq_3.320.972317859
thread_1_seq_4.321.972317859
thread_1_seq_5.322.972317861
thread_1_seq_6.323.972317861
thread_1_seq_7.324.972317863
thread_1_seq_8.325.972317863
thread_1_seq_10.327.972317865
thread_1_seq_11.328.972317865
thread_1_seq_12.329.972317865
thread_1_seq_9.326.972317865
thread_1_seq_13.330.972317867
thread_1_seq_14.331.972317871
thread_1_seq_15.332.972317873
thread_1_seq_16.333.972317873
thread_1_seq_17.334.972317875
thread_1_seq_18.335.972317875
thread_1_seq_19.336.972317877
thread_1_seq_20.337.972317879
thread_1_seq_21.338.972317879
thread_1_seq_22.339.972317879
thread_1_seq_23.340.972317881
thread_1_seq_24.341.972317883
thread_1_seq_25.342.972317885
thread_1_seq_26.343.972317885
thread_1_seq_27.344.972317889
thread_1_seq_28.345.972317889
thread_1_seq_29.346.972317895
thread_1_seq_30.347.972317895
thread_1_seq_31.348.972317897
thread_1_seq_32.349.972317901
thread_1_seq_33.350.972317901
thread_1_seq_34.351.972317903
thread_1_seq_35.352.972317903
thread_1_seq_36.353.972317905
thread_1_seq_37.354.972317907
thread_1_seq_38.355.972317909
thread_1_seq_39.356.972317913
thread_1_seq_40.357.972317915
thread_1_seq_41.358.972317915
thread_1_seq_42.359.972317917
thread_1_seq_43.360.972317919
thread_1_seq_44.361.972318087
thread_1_seq_45.362.972318089
thread_1_seq_46.363.972318099
thread_1_seq_47.364.972318103
thread_1_seq_48.365.972318105
thread_1_seq_49.366.972318107
thread_1_seq_48.369.972319355
thread_1_seq_49.367.972319355
thread_1_seq_50.368.972319355
thread_1_seq_1.371.972320915
thread_1_seq_1.374.972321509
thread_1_seq_2.375.972321511
thread_1_seq_3.376.972321513
thread_1_seq_4.377.972321515
thread_1_seq_5.378.972321519
thread_1_seq_6.379.972321519
thread_1_seq_7.380.972321521
thread_1_seq_8.381.972321523
thread_1_seq_9.382.972321525
thread_1_seq_10.383.972321527
thread_1_seq_11.384.972321529
thread_1_seq_12.385.972321531
thread_1_seq_13.386.972321535
thread_1_seq_14.387.972321537
thread_1_seq_15.388.972321815
thread_1_seq_16.389.972321817
thread_1_seq_17.391.972321827
thread_1_seq_19.393.972321835
thread_1_seq_20.394.972321837
[oracle@station90 ~]$


实验6b:
  1. RMAN> run {
  2. 2> set until sequence 18 thread 1;
  3. 3> restore database;
  4. 4> }

  5. executing command: SET until clause

  6. Starting restore at 01-APR-18
  7. using channel ORA_DISK_1
  8. using channel ORA_DISK_2
  9. using channel ORA_DISK_3
  10. using channel ORA_DISK_4
  11. using channel ORA_DISK_5
  12. using channel ORA_DISK_6
  13. using channel ORA_DISK_7
  14. using channel ORA_DISK_8
  15. using channel ORA_SBT_TAPE_1
  16. using channel ORA_SBT_TAPE_2
  17. flashing back control file to SCN 1464172

  18. channel ORA_SBT_TAPE_1: starting datafile backup set restore
  19. channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
  20. channel ORA_SBT_TAPE_1: restoring datafile 00002 to +DATA/orcl/datafile/sysaux.257.816169553
  21. channel ORA_SBT_TAPE_1: restoring datafile 00003 to +DATA/orcl/datafile/undotbs1.258.816169553
  22. channel ORA_SBT_TAPE_1: restoring datafile 00004 to +DATA/orcl/datafile/users.259.816169553
  23. channel ORA_SBT_TAPE_1: reading from backup piece 13s4ih4j_1_1
  24. channel ORA_SBT_TAPE_2: starting datafile backup set restore
  25. channel ORA_SBT_TAPE_2: specifying datafile(s) to restore from backup set
  26. channel ORA_SBT_TAPE_2: restoring datafile 00001 to +DATA/orcl/datafile/system.256.816169553
  27. channel ORA_SBT_TAPE_2: restoring datafile 00005 to +DATA/orcl/datafile/example.265.816169651
  28. channel ORA_SBT_TAPE_2: reading from backup piece 12s4ih4j_1_1
  29. channel ORA_SBT_TAPE_1: piece handle=13s4ih4j_1_1 tag=0T_INCR0_WHOLE
  30. channel ORA_SBT_TAPE_1: restored backup piece 1
  31. channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:44
  32. channel ORA_SBT_TAPE_2: piece handle=12s4ih4j_1_1 tag=0T_INCR0_WHOLE
  33. channel ORA_SBT_TAPE_2: restored backup piece 1
  34. channel ORA_SBT_TAPE_2: restore complete, elapsed time: 00:00:54
  35. Finished restore at 01-APR-18

  36. RMAN>
复制代码

手工取回变成备份集的日志:
  1. [oracle@station90 ~]$ rman target /

  2. Recovery Manager: Release 11.2.0.1.0 - Production on Sun Apr 1 17:45:31 2018

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

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

  5. RMAN> list backup of archivelog sequence 19 thread 1 ;

  6. using target database control file instead of recovery catalog
  7. specification does not match any backup in the repository

  8. RMAN> reset database to incarnation 2;

  9. database reset to incarnation 2


  10. RMAN>
  11. RMAN> list incarnation of database;


  12. List of Database Incarnations
  13. DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
  14. ------- ------- -------- ---------------- --- ---------- ----------
  15. 1       1       ORCL     1343950367       PARENT  1          15-AUG-09
  16. 2       2       ORCL     1343950367       CURRENT 945184     23-MAY-13
  17. 3       3       ORCL     1343950367       ORPHAN  1451975    01-APR-18
  18. 4       4       ORCL     1343950367       ORPHAN  1451975    01-APR-18
  19. 5       5       ORCL     1343950367       ORPHAN  1456352    01-APR-18
  20. 6       6       ORCL     1343950367       ORPHAN  1456361    01-APR-18

  21. RMAN> list backup of archivelog sequence 19 thread 1 ;


  22. List of Backup Sets
  23. ===================


  24. BS Key  Size       Device Type Elapsed Time Completion Time
  25. ------- ---------- ----------- ------------ ---------------
  26. 36      2.00M      SBT_TAPE    00:00:15     18-MAY-17      
  27.         BP Key: 36   Status: AVAILABLE  Compressed: NO  Tag: 0T_INCR0_WHOLE
  28.         Handle: 14s4ih5n_1_1   Media: station90-000001

  29.   List of Archived Logs in backup set 36
  30.   Thrd Seq     Low SCN    Low Time  Next SCN   Next Time
  31.   ---- ------- ---------- --------- ---------- ---------
  32.   1    19      1057190    18-MAY-17 1057470    18-MAY-17

  33. RMAN> restore archivelog sequence 19 thread 1 ;

  34. Starting restore at 01-APR-18
  35. allocated channel: ORA_DISK_1
  36. channel ORA_DISK_1: SID=131 device type=DISK
  37. allocated channel: ORA_DISK_2
  38. channel ORA_DISK_2: SID=194 device type=DISK
  39. allocated channel: ORA_DISK_3
  40. channel ORA_DISK_3: SID=10 device type=DISK
  41. allocated channel: ORA_DISK_4
  42. channel ORA_DISK_4: SID=71 device type=DISK
  43. allocated channel: ORA_DISK_5
  44. channel ORA_DISK_5: SID=135 device type=DISK
  45. allocated channel: ORA_DISK_6
  46. channel ORA_DISK_6: SID=192 device type=DISK
  47. allocated channel: ORA_DISK_7
  48. channel ORA_DISK_7: SID=69 device type=DISK
  49. allocated channel: ORA_DISK_8
  50. channel ORA_DISK_8: SID=9 device type=DISK
  51. allocated channel: ORA_SBT_TAPE_1
  52. channel ORA_SBT_TAPE_1: SID=132 device type=SBT_TAPE
  53. channel ORA_SBT_TAPE_1: Oracle Secure Backup
  54. allocated channel: ORA_SBT_TAPE_2
  55. channel ORA_SBT_TAPE_2: SID=8 device type=SBT_TAPE
  56. channel ORA_SBT_TAPE_2: Oracle Secure Backup

  57. channel ORA_SBT_TAPE_1: starting archived log restore to default destination
  58. channel ORA_SBT_TAPE_1: restoring archived log
  59. archived log thread=1 sequence=19
  60. channel ORA_SBT_TAPE_1: reading from backup piece 14s4ih5n_1_1
  61. channel ORA_SBT_TAPE_1: piece handle=14s4ih5n_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:28
  64. Finished restore at 01-APR-18

  65. RMAN>


复制代码


回复

使用道具 举报

3

主题

12

帖子

83

积分

注册会员

Rank: 2

积分
83
发表于 2018-4-3 09:51:06 | 显示全部楼层
老师 6b的实验,
是用run块里只用写restore database ,
然后在sqlplus里执行recover database until cancel吗?
回复 支持 反对

使用道具 举报

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
 楼主| 发表于 2018-4-3 11:07:05 | 显示全部楼层
何帆 发表于 2018-4-3 09:51
老师 6b的实验,
是用run块里只用写restore database ,
然后在sqlplus里执行recover database until ca ...

是的,cancel可能更好判断。
回复 支持 反对

使用道具 举报

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

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-3-29 04:13 , Processed in 0.042839 second(s), 27 queries .

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