Bo's Oracle Station

查看: 2011|回复: 0

课程第69次(2017-12-16星期六上午)课程结束

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2017-12-16 09:32:03 | 显示全部楼层 |阅读模式
书上P206页去关闭:
  1. DROP TRIGGER open_all_pdbs;
复制代码

实验:Practice 7-13: TSPITR on PDB Tablespaces 同样适用于11g的普通的数据库:
在表空间PITR时,结合了物理备份和数据泵传送表空间两个技术,但是命令很简单(auxiliary destination),同时会启动随机四个英文字符的auxiliary实例:
SQL> !ps aux | grep ora_smon
oracle    2102  0.0  0.2 523720 40572 ?        Ss   09:53   0:00 ora_smon_cfkC
oracle    2220  0.0  0.0 106148  2568 pts/14   S+   09:53   0:00 /bin/bash -c ps aux | grep ora_smon
oracle    2222  0.0  0.0 103308  2004 pts/14   S+   09:53   0:00 grep ora_smon
oracle   23233  0.0  1.5 6799168 254088 ?      Ss   09:21   0:00 ora_smon_orcl

如果你要TSPITR恢复的表空间是默认表空间,请在做TSPITR前设置成非默认表空间:

以下是11g普通数据库的TSPITR恢复过程:
  1. [oracle@station90 ~]$ rman target /  

  2. Recovery Manager: Release 11.2.0.3.0 - Production on Sat Dec 16 10:00:45 2017

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

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

  5. RMAN> recover tablespace users until time '2017-12-16:09:34:24'
  6. 2> auxiliary destination '/u01/app/oracle/oradata';

  7. Starting recover at 2017-12-16:10:00:51
  8. using target database control file instead of recovery catalog
  9. allocated channel: ORA_DISK_1
  10. channel ORA_DISK_1: SID=204 device type=DISK
  11. allocated channel: ORA_DISK_2
  12. channel ORA_DISK_2: SID=16 device type=DISK
  13. allocated channel: ORA_DISK_3
  14. channel ORA_DISK_3: SID=79 device type=DISK
  15. allocated channel: ORA_DISK_4
  16. channel ORA_DISK_4: SID=141 device type=DISK
  17. allocated channel: ORA_DISK_5
  18. channel ORA_DISK_5: SID=198 device type=DISK
  19. allocated channel: ORA_DISK_6
  20. channel ORA_DISK_6: SID=15 device type=DISK
  21. allocated channel: ORA_DISK_7
  22. channel ORA_DISK_7: SID=7 device type=DISK
  23. allocated channel: ORA_DISK_8
  24. channel ORA_DISK_8: SID=145 device type=DISK
  25. allocated channel: ORA_SBT_TAPE_1
  26. channel ORA_SBT_TAPE_1: SID=197 device type=SBT_TAPE
  27. channel ORA_SBT_TAPE_1: Oracle Secure Backup
  28. allocated channel: ORA_SBT_TAPE_2
  29. channel ORA_SBT_TAPE_2: SID=81 device type=SBT_TAPE
  30. channel ORA_SBT_TAPE_2: Oracle Secure Backup
  31. RMAN-05026: WARNING: presuming following set of tablespaces applies to specified point-in-time

  32. List of tablespaces expected to have UNDO segments
  33. Tablespace SYSTEM
  34. Tablespace UNDOTBS1

  35. Creating automatic instance, with SID='rxlF'

  36. initialization parameters used for automatic instance:
  37. db_name=ORCL
  38. db_unique_name=rxlF_tspitr_ORCL
  39. compatible=11.2.0.0.0
  40. db_block_size=8192
  41. db_files=200
  42. sga_target=280M
  43. processes=50
  44. db_create_file_dest=/u01/app/oracle/oradata
  45. log_archive_dest_1='location=/u01/app/oracle/oradata'
  46. #No auxiliary parameter file used


  47. starting up automatic instance ORCL

  48. Oracle instance started

  49. Total System Global Area     292278272 bytes

  50. Fixed Size                     2227744 bytes
  51. Variable Size                100663776 bytes
  52. Database Buffers             184549376 bytes
  53. Redo Buffers                   4837376 bytes
  54. Automatic instance created
  55. Running TRANSPORT_SET_CHECK on recovery set tablespaces
  56. TRANSPORT_SET_CHECK completed successfully

  57. contents of Memory Script:
  58. {
  59. # set requested point in time
  60. set until  time "2017-12-16:09:34:24";
  61. # restore the controlfile
  62. restore clone controlfile;
  63. # mount the controlfile
  64. sql clone 'alter database mount clone database';
  65. # archive current online log
  66. sql 'alter system archive log current';
  67. # avoid unnecessary autobackups for structural changes during TSPITR
  68. sql 'begin dbms_backup_restore.AutoBackupFlag(FALSE); end;';
  69. }
  70. executing Memory Script

  71. executing command: SET until clause

  72. Starting restore at 2017-12-16:10:01:40
  73. allocated channel: ORA_AUX_DISK_1
  74. channel ORA_AUX_DISK_1: SID=80 device type=DISK
  75. allocated channel: ORA_AUX_DISK_2
  76. channel ORA_AUX_DISK_2: SID=5 device type=DISK
  77. allocated channel: ORA_AUX_DISK_3
  78. channel ORA_AUX_DISK_3: SID=30 device type=DISK
  79. allocated channel: ORA_AUX_DISK_4
  80. channel ORA_AUX_DISK_4: SID=56 device type=DISK
  81. allocated channel: ORA_AUX_DISK_5
  82. channel ORA_AUX_DISK_5: SID=82 device type=DISK
  83. allocated channel: ORA_AUX_DISK_6
  84. channel ORA_AUX_DISK_6: SID=6 device type=DISK
  85. allocated channel: ORA_AUX_DISK_7
  86. channel ORA_AUX_DISK_7: SID=31 device type=DISK
  87. allocated channel: ORA_AUX_DISK_8
  88. channel ORA_AUX_DISK_8: SID=57 device type=DISK
  89. allocated channel: ORA_AUX_SBT_TAPE_1
  90. channel ORA_AUX_SBT_TAPE_1: SID=83 device type=SBT_TAPE
  91. channel ORA_AUX_SBT_TAPE_1: Oracle Secure Backup
  92. allocated channel: ORA_AUX_SBT_TAPE_2
  93. channel ORA_AUX_SBT_TAPE_2: SID=7 device type=SBT_TAPE
  94. channel ORA_AUX_SBT_TAPE_2: Oracle Secure Backup

  95. channel ORA_AUX_SBT_TAPE_1: starting datafile backup set restore
  96. channel ORA_AUX_SBT_TAPE_1: restoring control file
  97. channel ORA_AUX_SBT_TAPE_1: reading from backup piece c-1343950367-20170522-00
  98. channel ORA_AUX_SBT_TAPE_1: piece handle=c-1343950367-20170522-00 tag=TAG20170522T204208
  99. channel ORA_AUX_SBT_TAPE_1: restored backup piece 1
  100. channel ORA_AUX_SBT_TAPE_1: restore complete, elapsed time: 00:00:25
  101. output file name=/u01/app/oracle/oradata/ORCL/controlfile/o1_mf_f38znrdf_.ctl
  102. Finished restore at 2017-12-16:10:02:09

  103. sql statement: alter database mount clone database

  104. sql statement: alter system archive log current

  105. sql statement: begin dbms_backup_restore.AutoBackupFlag(FALSE); end;

  106. contents of Memory Script:
  107. {
  108. # set requested point in time
  109. set until  time "2017-12-16:09:34:24";
  110. # set destinations for recovery set and auxiliary set datafiles
  111. set newname for clone datafile  1 to new;
  112. set newname for clone datafile  3 to new;
  113. set newname for clone datafile  2 to new;
  114. set newname for clone tempfile  1 to new;
  115. set newname for datafile  4 to
  116. "+DATA/orcl/datafile/users.259.816169553";
  117. # switch all tempfiles
  118. switch clone tempfile all;
  119. # restore the tablespaces in the recovery set and the auxiliary set
  120. restore clone datafile  1, 3, 2, 4;
  121. switch clone datafile all;
  122. }
  123. executing Memory Script

  124. executing command: SET until clause

  125. executing command: SET NEWNAME

  126. executing command: SET NEWNAME

  127. executing command: SET NEWNAME

  128. executing command: SET NEWNAME

  129. executing command: SET NEWNAME

  130. renamed tempfile 1 to /u01/app/oracle/oradata/ORCL/datafile/o1_mf_temp_%u_.tmp in control file

  131. Starting restore at 2017-12-16:10:02:15
  132. using channel ORA_AUX_DISK_1
  133. using channel ORA_AUX_DISK_2
  134. using channel ORA_AUX_DISK_3
  135. using channel ORA_AUX_DISK_4
  136. using channel ORA_AUX_DISK_5
  137. using channel ORA_AUX_DISK_6
  138. using channel ORA_AUX_DISK_7
  139. using channel ORA_AUX_DISK_8
  140. using channel ORA_AUX_SBT_TAPE_1
  141. using channel ORA_AUX_SBT_TAPE_2

  142. channel ORA_AUX_SBT_TAPE_1: starting datafile backup set restore
  143. channel ORA_AUX_SBT_TAPE_1: specifying datafile(s) to restore from backup set
  144. channel ORA_AUX_SBT_TAPE_1: restoring datafile 00003 to /u01/app/oracle/oradata/ORCL/datafile/o1_mf_undotbs1_%u_.dbf
  145. channel ORA_AUX_SBT_TAPE_1: reading from backup piece 1ls4tgjd_1_1
  146. channel ORA_AUX_SBT_TAPE_2: starting datafile backup set restore
  147. channel ORA_AUX_SBT_TAPE_2: specifying datafile(s) to restore from backup set
  148. channel ORA_AUX_SBT_TAPE_2: restoring datafile 00001 to /u01/app/oracle/oradata/ORCL/datafile/o1_mf_system_%u_.dbf
  149. channel ORA_AUX_SBT_TAPE_2: restoring datafile 00002 to /u01/app/oracle/oradata/ORCL/datafile/o1_mf_sysaux_%u_.dbf
  150. channel ORA_AUX_SBT_TAPE_2: restoring datafile 00004 to +DATA/orcl/datafile/users.259.816169553
  151. channel ORA_AUX_SBT_TAPE_2: reading from backup piece 1ks4tgjd_1_1
  152. channel ORA_AUX_SBT_TAPE_1: piece handle=1ls4tgjd_1_1 tag=0T_INCR0_WHOLE
  153. channel ORA_AUX_SBT_TAPE_1: restored backup piece 1
  154. channel ORA_AUX_SBT_TAPE_1: restore complete, elapsed time: 00:00:35
  155. channel ORA_AUX_SBT_TAPE_2: piece handle=1ks4tgjd_1_1 tag=0T_INCR0_WHOLE
  156. channel ORA_AUX_SBT_TAPE_2: restored backup piece 1
  157. channel ORA_AUX_SBT_TAPE_2: restore complete, elapsed time: 00:00:35
  158. Finished restore at 2017-12-16:10:02:54

  159. datafile 1 switched to datafile copy
  160. input datafile copy RECID=6 STAMP=962877774 file name=/u01/app/oracle/oradata/ORCL/datafile/o1_mf_system_f38zozco_.dbf
  161. datafile 3 switched to datafile copy
  162. input datafile copy RECID=7 STAMP=962877774 file name=/u01/app/oracle/oradata/ORCL/datafile/o1_mf_undotbs1_f38zoy8c_.dbf
  163. datafile 2 switched to datafile copy
  164. input datafile copy RECID=8 STAMP=962877774 file name=/u01/app/oracle/oradata/ORCL/datafile/o1_mf_sysaux_f38zozdd_.dbf

  165. contents of Memory Script:
  166. {
  167. # set requested point in time
  168. set until  time "2017-12-16:09:34:24";
  169. # online the datafiles restored or switched
  170. sql clone "alter database datafile  1 online";
  171. sql clone "alter database datafile  3 online";
  172. sql clone "alter database datafile  2 online";
  173. sql clone "alter database datafile  4 online";
  174. # recover and open resetlogs
  175. recover clone database tablespace  "USERS", "SYSTEM", "UNDOTBS1", "SYSAUX" delete archivelog;
  176. alter clone database open resetlogs;
  177. }
  178. executing Memory Script

  179. executing command: SET until clause

  180. sql statement: alter database datafile  1 online

  181. sql statement: alter database datafile  3 online

  182. sql statement: alter database datafile  2 online

  183. sql statement: alter database datafile  4 online

  184. Starting recover at 2017-12-16:10:02:54
  185. using channel ORA_AUX_DISK_1
  186. using channel ORA_AUX_DISK_2
  187. using channel ORA_AUX_DISK_3
  188. using channel ORA_AUX_DISK_4
  189. using channel ORA_AUX_DISK_5
  190. using channel ORA_AUX_DISK_6
  191. using channel ORA_AUX_DISK_7
  192. using channel ORA_AUX_DISK_8
  193. using channel ORA_AUX_SBT_TAPE_1
  194. using channel ORA_AUX_SBT_TAPE_2

  195. starting media recovery

  196. archived log for thread 1 with sequence 108 is already on disk as file +FRA/orcl/archivelog/2017_12_15/thread_1_seq_108.330.962789117
  197. archived log for thread 1 with sequence 109 is already on disk as file +FRA/orcl/archivelog/2017_12_15/thread_1_seq_109.331.962790099
  198. archived log for thread 1 with sequence 110 is already on disk as file +FRA/orcl/archivelog/2017_12_15/thread_1_seq_110.329.962802097
  199. archived log for thread 1 with sequence 111 is already on disk as file +FRA/orcl/archivelog/2017_12_15/thread_1_seq_111.332.962816533
  200. archived log for thread 1 with sequence 112 is already on disk as file +FRA/orcl/archivelog/2017_12_15/thread_1_seq_112.333.962825453
  201. archived log for thread 1 with sequence 113 is already on disk as file +FRA/orcl/archivelog/2017_12_15/thread_1_seq_113.328.962829675
  202. archived log for thread 1 with sequence 114 is already on disk as file +FRA/orcl/archivelog/2017_12_15/thread_1_seq_114.327.962833705
  203. archived log for thread 1 with sequence 115 is already on disk as file +FRA/orcl/archivelog/2017_12_16/thread_1_seq_115.326.962875305
  204. archived log for thread 1 with sequence 116 is already on disk as file +FRA/orcl/archivelog/2017_12_16/thread_1_seq_116.325.962875373
  205. archived log for thread 1 with sequence 117 is already on disk as file +FRA/orcl/archivelog/2017_12_16/thread_1_seq_117.324.962876059
  206. archived log for thread 1 with sequence 118 is already on disk as file +FRA/orcl/archivelog/2017_12_16/thread_1_seq_118.323.962876059
  207. archived log for thread 1 with sequence 119 is already on disk as file +FRA/orcl/archivelog/2017_12_16/thread_1_seq_119.322.962876071
  208. channel ORA_AUX_SBT_TAPE_1: starting archived log restore to default destination
  209. channel ORA_AUX_SBT_TAPE_1: restoring archived log
  210. archived log thread=1 sequence=107
  211. channel ORA_AUX_SBT_TAPE_1: reading from backup piece 1ms4tgk7_1_1
  212. channel ORA_AUX_SBT_TAPE_1: piece handle=1ms4tgk7_1_1 tag=0T_INCR0_WHOLE
  213. channel ORA_AUX_SBT_TAPE_1: restored backup piece 1
  214. channel ORA_AUX_SBT_TAPE_1: restore complete, elapsed time: 00:00:25
  215. archived log file name=/u01/app/oracle/oradata/1_107_816169635.dbf thread=1 sequence=107
  216. channel clone_default: deleting archived log(s)
  217. archived log file name=/u01/app/oracle/oradata/1_107_816169635.dbf RECID=100 STAMP=962877792
  218. archived log file name=+FRA/orcl/archivelog/2017_12_15/thread_1_seq_108.330.962789117 thread=1 sequence=108
  219. archived log file name=+FRA/orcl/archivelog/2017_12_15/thread_1_seq_109.331.962790099 thread=1 sequence=109
  220. archived log file name=+FRA/orcl/archivelog/2017_12_15/thread_1_seq_110.329.962802097 thread=1 sequence=110
  221. archived log file name=+FRA/orcl/archivelog/2017_12_15/thread_1_seq_111.332.962816533 thread=1 sequence=111
  222. archived log file name=+FRA/orcl/archivelog/2017_12_15/thread_1_seq_112.333.962825453 thread=1 sequence=112
  223. archived log file name=+FRA/orcl/archivelog/2017_12_15/thread_1_seq_113.328.962829675 thread=1 sequence=113
  224. archived log file name=+FRA/orcl/archivelog/2017_12_15/thread_1_seq_114.327.962833705 thread=1 sequence=114
  225. archived log file name=+FRA/orcl/archivelog/2017_12_16/thread_1_seq_115.326.962875305 thread=1 sequence=115
  226. archived log file name=+FRA/orcl/archivelog/2017_12_16/thread_1_seq_116.325.962875373 thread=1 sequence=116
  227. archived log file name=+FRA/orcl/archivelog/2017_12_16/thread_1_seq_117.324.962876059 thread=1 sequence=117
  228. archived log file name=+FRA/orcl/archivelog/2017_12_16/thread_1_seq_118.323.962876059 thread=1 sequence=118
  229. archived log file name=+FRA/orcl/archivelog/2017_12_16/thread_1_seq_119.322.962876071 thread=1 sequence=119
  230. media recovery complete, elapsed time: 00:01:15
  231. Finished recover at 2017-12-16:10:04:37

  232. database opened

  233. contents of Memory Script:
  234. {
  235. # make read only the tablespace that will be exported
  236. sql clone 'alter tablespace  USERS read only';
  237. # create directory for datapump import
  238. sql "create or replace directory TSPITR_DIROBJ_DPDIR as ''
  239. /u01/app/oracle/oradata''";
  240. # create directory for datapump export
  241. sql clone "create or replace directory TSPITR_DIROBJ_DPDIR as ''
  242. /u01/app/oracle/oradata''";
  243. }
  244. executing Memory Script

  245. sql statement: alter tablespace  USERS read only

  246. sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''/u01/app/oracle/oradata''

  247. sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''/u01/app/oracle/oradata''

  248. Performing export of metadata...
  249.    EXPDP> Starting "SYS"."TSPITR_EXP_rxlF":  
  250.    EXPDP> Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
  251.    EXPDP> Processing object type TRANSPORTABLE_EXPORT/TYPE/TYPE_SPEC
  252.    EXPDP> Processing object type TRANSPORTABLE_EXPORT/TYPE/TYPE_BODY
  253.    EXPDP> Processing object type TRANSPORTABLE_EXPORT/XMLSCHEMA/XMLSCHEMA
  254.    EXPDP> Processing object type TRANSPORTABLE_EXPORT/TABLE
  255.    EXPDP> Processing object type TRANSPORTABLE_EXPORT/INDEX/INDEX
  256.    EXPDP> Processing object type TRANSPORTABLE_EXPORT/CONSTRAINT/CONSTRAINT
  257.    EXPDP> Processing object type TRANSPORTABLE_EXPORT/INDEX_STATISTICS
  258.    EXPDP> Processing object type TRANSPORTABLE_EXPORT/CONSTRAINT/REF_CONSTRAINT
  259.    EXPDP> Processing object type TRANSPORTABLE_EXPORT/TABLE_STATISTICS
  260.    EXPDP> Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
  261.    EXPDP> Master table "SYS"."TSPITR_EXP_rxlF" successfully loaded/unloaded
  262.    EXPDP> ******************************************************************************
  263.    EXPDP> Dump file set for SYS.TSPITR_EXP_rxlF is:
  264.    EXPDP>   /u01/app/oracle/oradata/tspitr_rxlF_49355.dmp
  265.    EXPDP> ******************************************************************************
  266.    EXPDP> Datafiles required for transportable tablespace USERS:
  267.    EXPDP>   +DATA/orcl/datafile/users.259.816169553
  268.    EXPDP> Job "SYS"."TSPITR_EXP_rxlF" successfully completed at 10:05:33
  269. Export completed


  270. contents of Memory Script:
  271. {
  272. # shutdown clone before import
  273. shutdown clone immediate
  274. # drop target tablespaces before importing them back
  275. sql 'drop tablespace  USERS including contents keep datafiles';
  276. }
  277. executing Memory Script

  278. database closed
  279. database dismounted
  280. Oracle instance shut down

  281. sql statement: drop tablespace  USERS including contents keep datafiles

  282. Performing import of metadata...
  283.    IMPDP> Master table "SYS"."TSPITR_IMP_rxlF" successfully loaded/unloaded
  284.    IMPDP> Starting "SYS"."TSPITR_IMP_rxlF":  
  285.    IMPDP> Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
  286.    IMPDP> Processing object type TRANSPORTABLE_EXPORT/TYPE/TYPE_SPEC
  287.    IMPDP> ORA-31684: Object type TYPE:"OE"."SHIPPING_INSTRUCTIONS_T" already existsORA-31684: Object type TYPE:"OE"."REJECTION_T" already existsORA-31684: Object type TYPE:"OE"."ACTION_T" already existsORA-31684: Object type TYPE:"OE"."PART_T" already existsORA-31684: Object type TYPE:"OE"."PRODUCT_REF_LIST_TYP" already existsORA-31684: Object type TYPE:"OE"."CATEGORY_TYP" already existsORA-31684: Object type TYPE:"OE"."SUBCATEGORY_REF_LIST_TYP" already existsORA-31684: Object type TYPE:"OE"."ACTION_V" already existsORA-31684: Object type TYPE:"OE"."LINEITEM_T" already existsORA-31684: Object type TYPE:"OE"."LEAF_CATEGORY_TYP" already existsORA-31684: Object type TYPE:"OE"."COMPOSITE_CATEGORY_TYP" already existsORA-31684: Object type TYPE:"OE"."ACTIONS_T" already existsORA-31684: Object type TYPE:"OE"."LINEITEM_V" already existsORA-31684: Object type TYPE:"OE"."CATALOG_TYP" already existsORA-31684: Object type TYPE:"OE"."LINEITEMS_T" already existsORA-31684: Object type TYPE:"OE"."PURCHASEORDER_T" already exists
  288.    IMPDP> Processing object type TRANSPORTABLE_EXPORT/TYPE/TYPE_BODY
  289.    IMPDP> ORA-31684: Object type TYPE_BODY:"OE"."LEAF_CATEGORY_TYP" already existsORA-31684: Object type TYPE_BODY:"OE"."COMPOSITE_CATEGORY_TYP" already existsORA-31684: Object type TYPE_BODY:"OE"."CATALOG_TYP" already exists
  290.    IMPDP> Processing object type TRANSPORTABLE_EXPORT/XMLSCHEMA/XMLSCHEMA
  291.    IMPDP> ORA-39083: Object type XMLSCHEMA failed to create with error:
  292. ORA-31085: schema "http://localhost:8080/source/schemas/poSource/xsd/purchaseOrder.xsd" already registered
  293. Failing sql is:
  294. BEGIN dbms_xmlschema.registerSchema(:1, :2, (:3 = 1), FALSE,FALSE,FALSE,FALSE, :4, options=> :5, schemaoid => :6, import_options => :7); END;
  295.    IMPDP> Processing object type TRANSPORTABLE_EXPORT/TABLE
  296.    IMPDP> ORA-39083: Object type TABLE:"OE"."PURCHASEORDER" failed to create with error:
  297. ORA-31061: XDB error: DBMS_XDBZ.ENABLE_HIERARCHY
  298. ORA-06512: at "XDB.DBMS_XDBZ0", line 131
  299. ORA-06512: at "XDB.DBMS_XDBZ0", line 588
  300. ORA-01031: insufficient privileges
  301. Failing sql is:
  302. BEGIN DBMS_XDBZ.ENABLE_HIERARCHY('"OE"','"PURCHASEORDER"'); END;
  303.    IMPDP> Processing object type TRANSPORTABLE_EXPORT/INDEX/INDEX
  304.    IMPDP> Processing object type TRANSPORTABLE_EXPORT/CONSTRAINT/CONSTRAINT
  305.    IMPDP> Processing object type TRANSPORTABLE_EXPORT/INDEX_STATISTICS
  306.    IMPDP> ORA-39083: Object type INDEX_STATISTICS failed to create with error:
  307. ORA-20000: INDEX "OE"."LINEITEM_TABLE_MEMBERS" does not exist or insufficient privileges
  308. Failing sql is:
  309. DECLARE I_N VARCHAR2(60);   I_O VARCHAR2(60);   NV VARCHAR2(1);   c DBMS_METADATA.T_VAR_COLL;   df varchar2(21) := 'YYYY-MM-DD:HH24:MI:SS';  stmt varchar2(300) := ' INSERT INTO "SYS"."IMPDP_STATS" (type,version,flags,c1,c2,c3,c5,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,d1,cl1) VALUES (''I'',6,:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,NULORA-39112: Dependent object type INDEX_STATISTICS skipped, base object type TABLE:"OE"."PURCHASEORDER" creation failedORA-39083: Object type INDEX_STATISTICS failed to create with error:
  310. ORA-20000: INDEX "OE"."ACTION_TABLE_MEMBERS" does not exist or insufficient privileges
  311. Failing sql is:
  312. DECLARE I_N VARCHAR2(60);   I_O VARCHAR2(60);   NV VARCHAR2(1);   c DBMS_METADATA.T_VAR_COLL;   df varchar2(21) := 'YYYY-MM-DD:HH24:MI:SS';  stmt varchar2(300) := ' INSERT INTO "SYS"."IMPDP_STATS" (type,version,flags,c1,c2,c3,c5,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,d1,cl1) VALUES (''I'',6,:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,NULL,
  313.    IMPDP> Processing object type TRANSPORTABLE_EXPORT/CONSTRAINT/REF_CONSTRAINT
  314.    IMPDP> Processing object type TRANSPORTABLE_EXPORT/TABLE_STATISTICS
  315.    IMPDP> ORA-39112: Dependent object type TABLE_STATISTICS skipped, base object type TABLE:"OE"."PURCHASEORDER" creation failed
  316.    IMPDP> Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
  317.    IMPDP> Job "SYS"."TSPITR_IMP_rxlF" completed with 25 error(s) at 10:06:02
  318. Import completed


  319. contents of Memory Script:
  320. {
  321. # make read write and offline the imported tablespaces
  322. sql 'alter tablespace  USERS read write';
  323. sql 'alter tablespace  USERS offline';
  324. # enable autobackups after TSPITR is finished
  325. sql 'begin dbms_backup_restore.AutoBackupFlag(TRUE); end;';
  326. }
  327. executing Memory Script

  328. sql statement: alter tablespace  USERS read write

  329. sql statement: alter tablespace  USERS offline

  330. sql statement: begin dbms_backup_restore.AutoBackupFlag(TRUE); end;

  331. Removing automatic instance
  332. Automatic instance removed
  333. auxiliary instance file /u01/app/oracle/oradata/ORCL/datafile/o1_mf_temp_f38zsqrd_.tmp deleted
  334. auxiliary instance file /u01/app/oracle/oradata/ORCL/onlinelog/o1_mf_3_f38zspm4_.log deleted
  335. auxiliary instance file /u01/app/oracle/oradata/ORCL/onlinelog/o1_mf_2_f38zsp6o_.log deleted
  336. auxiliary instance file /u01/app/oracle/oradata/ORCL/onlinelog/o1_mf_1_f38zsotf_.log deleted
  337. auxiliary instance file /u01/app/oracle/oradata/ORCL/datafile/o1_mf_sysaux_f38zozdd_.dbf deleted
  338. auxiliary instance file /u01/app/oracle/oradata/ORCL/datafile/o1_mf_undotbs1_f38zoy8c_.dbf deleted
  339. auxiliary instance file /u01/app/oracle/oradata/ORCL/datafile/o1_mf_system_f38zozco_.dbf deleted
  340. auxiliary instance file /u01/app/oracle/oradata/ORCL/controlfile/o1_mf_f38znrdf_.ctl deleted
  341. Finished recover at 2017-12-16:10:06:04

  342. RMAN>

复制代码
以下是12c插件数据库的TSPITR恢复过程(要有pdb2_2本化身的备份):
  1. Recovery Manager complete.
  2. [oracle@station26 ~]$ rman target /

  3. Recovery Manager: Release 12.1.0.2.0 - Production on Fri Jan 5 11:02:22 2018

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

  5. connected to target database: CDB2 (DBID=710472048)

  6. RMAN> recover  tablespace pdb2_2:dj_pdb2;

  7. Starting recover at 2018-01-05:11:02:40
  8. using target database control file instead of recovery catalog
  9. allocated channel: ORA_DISK_1
  10. channel ORA_DISK_1: SID=189 device type=DISK
  11. allocated channel: ORA_DISK_2
  12. channel ORA_DISK_2: SID=311 device type=DISK
  13. allocated channel: ORA_DISK_3
  14. channel ORA_DISK_3: SID=365 device type=DISK
  15. allocated channel: ORA_DISK_4
  16. channel ORA_DISK_4: SID=425 device type=DISK
  17. allocated channel: ORA_DISK_5
  18. channel ORA_DISK_5: SID=11 device type=DISK
  19. allocated channel: ORA_DISK_6
  20. channel ORA_DISK_6: SID=69 device type=DISK
  21. allocated channel: ORA_DISK_7
  22. channel ORA_DISK_7: SID=126 device type=DISK
  23. allocated channel: ORA_DISK_8
  24. channel ORA_DISK_8: SID=251 device type=DISK
  25. allocated channel: ORA_DISK_9
  26. channel ORA_DISK_9: SID=308 device type=DISK
  27. allocated channel: ORA_DISK_10
  28. channel ORA_DISK_10: SID=423 device type=DISK
  29. allocated channel: ORA_DISK_11
  30. channel ORA_DISK_11: SID=10 device type=DISK
  31. allocated channel: ORA_DISK_12
  32. channel ORA_DISK_12: SID=62 device type=DISK
  33. allocated channel: ORA_DISK_13
  34. channel ORA_DISK_13: SID=123 device type=DISK
  35. allocated channel: ORA_DISK_14
  36. channel ORA_DISK_14: SID=192 device type=DISK
  37. allocated channel: ORA_DISK_15
  38. channel ORA_DISK_15: SID=250 device type=DISK
  39. allocated channel: ORA_DISK_16
  40. channel ORA_DISK_16: SID=306 device type=DISK
  41. allocated channel: ORA_SBT_TAPE_1
  42. channel ORA_SBT_TAPE_1: SID=369 device type=SBT_TAPE
  43. channel ORA_SBT_TAPE_1: Oracle Secure Backup
  44. allocated channel: ORA_SBT_TAPE_2
  45. channel ORA_SBT_TAPE_2: SID=418 device type=SBT_TAPE
  46. channel ORA_SBT_TAPE_2: Oracle Secure Backup

  47. starting media recovery
  48. media recovery complete, elapsed time: 00:00:00

  49. Finished recover at 2018-01-05:11:02:53

  50. RMAN> exit


  51. Recovery Manager complete.
  52. [oracle@station26 ~]$ sqlplus /nolog

  53. SQL*Plus: Release 12.1.0.2.0 Production on Fri Jan 5 11:02:59 2018

  54. Copyright (c) 1982, 2014, Oracle.  All rights reserved.

  55. SQL> conn / as sysdba
  56. Connected.
  57. SQL> conn sys/oracle_4U@pdb2_2 as sysdba
  58. Connected.
  59. SQL> alter tablespace  dj_pdb2 onlinel
  60.   2  
  61. SQL> alter tablespace  dj_pdb2 online;

  62. Tablespace altered.

  63. SQL> conn / as sysdba
  64. Connected.
  65. SQL> select  flashback_on from v$database;

  66. FLASHBACK_ON
  67. ------------------
  68. NO

  69. SQL> alter database flashback    on ;

  70. Database altered.

  71. SQL> select  sysdate from dual;

  72. SYSDATE
  73. -------------------
  74. 2018-01-05:11:04:12

  75. SQL>
  76. SQL>
  77. SQL>
  78. SQL> drop user c##_user cascade;  

  79. User dropped.

  80. SQL> shutdown abort
  81. ORACLE instance shut down.
  82. SQL> startup   mount
  83. ORACLE instance started.

  84. Total System Global Area 3254779904 bytes
  85. Fixed Size                    3716080 bytes
  86. Variable Size                 1778387984 bytes
  87. Database Buffers         1459617792 bytes
  88. Redo Buffers                   13058048 bytes
  89. Database mounted.
  90. SQL> flashback database to timestamp to_timestamp('2018-01-05:11:04:12','YYYY-MM-DD:HH24:MI:SS') ;

  91. Flashback complete.

  92. SQL> alter database open resetlogs;  

  93. Database altered.

  94. SQL> conn c##_user/x  
  95. Connected.
  96. SQL> conn c##_user/x@pdb2
  97. Connected.
  98. SQL> conn c##_user/x@pdb2_2
  99. Connected.
  100. SQL> conn system/oracle_4U@pdb2  
  101. Connected.
  102. SQL> conn dj/oracle_4U@pdb2
  103. Connected.
  104. SQL> select * from tab;

  105. TNAME
  106. --------------------------------------------------------------------------------
  107. TABTYPE  CLUSTERID
  108. ------- ----------
  109. T1
  110. TABLE


  111. SQL> select  sysdate from dual ;

  112. SYSDATE
  113. -------------------
  114. 2018-01-05:11:11:03

  115. SQL> select count(*) from T1 ;

  116.   COUNT(*)
  117. ----------
  118.          0

  119. SQL> exit
  120. Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
  121. With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
  122. [oracle@station26 ~]$ rman target /

  123. Recovery Manager: Release 12.1.0.2.0 - Production on Fri Jan 5 11:11:27 2018

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

  125. connected to target database: CDB2 (DBID=710472048)

  126. RMAN> backup pluggable database pdb2;

  127. Starting backup at 2018-01-05:11:11:36
  128. using target database control file instead of recovery catalog
  129. allocated channel: ORA_SBT_TAPE_1
  130. channel ORA_SBT_TAPE_1: SID=185 device type=SBT_TAPE
  131. channel ORA_SBT_TAPE_1: Oracle Secure Backup
  132. allocated channel: ORA_SBT_TAPE_2
  133. channel ORA_SBT_TAPE_2: SID=242 device type=SBT_TAPE
  134. channel ORA_SBT_TAPE_2: Oracle Secure Backup
  135. channel ORA_SBT_TAPE_1: starting full datafile backup set
  136. channel ORA_SBT_TAPE_1: specifying datafile(s) in backup set
  137. input datafile file number=00011 name=/u01/app/oracle/oradata/cdb2/pdb2_1/sysaux01.dbf
  138. input datafile file number=00039 name=/u01/app/oracle/oradata/cdb2/pdb2_1/dj_pdb2.f
  139. channel ORA_SBT_TAPE_1: starting piece 1 at 2018-01-05:11:11:39
  140. channel ORA_SBT_TAPE_2: starting full datafile backup set
  141. channel ORA_SBT_TAPE_2: specifying datafile(s) in backup set
  142. input datafile file number=00010 name=/u01/app/oracle/oradata/cdb2/pdb2_1/system01.dbf
  143. input datafile file number=00038 name=/u01/app/oracle/oradata/cdb2/pdb2_1/ldata_01.dbf
  144. channel ORA_SBT_TAPE_2: starting piece 1 at 2018-01-05:11:11:40
  145. channel ORA_SBT_TAPE_2: finished piece 1 at 2018-01-05:11:12:15
  146. piece handle=1asnthrc_1_1 tag=TAG20180105T111139 comment=API Version 2.0,MMS Version 10.4.0.4
  147. channel ORA_SBT_TAPE_2: backup set complete, elapsed time: 00:00:35
  148. channel ORA_SBT_TAPE_1: finished piece 1 at 2018-01-05:11:12:25
  149. piece handle=19snthrb_1_1 tag=TAG20180105T111139 comment=API Version 2.0,MMS Version 10.4.0.4
  150. channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:46
  151. Finished backup at 2018-01-05:11:12:25

  152. Starting Control File and SPFILE Autobackup at 2018-01-05:11:12:25
  153. piece handle=c-710472048-20180105-07 comment=API Version 2.0,MMS Version 10.4.0.4
  154. Finished Control File and SPFILE Autobackup at 2018-01-05:11:12:50

  155. RMAN> recover tablespace pdb2:dj_pdb2
  156. 2> until time '2018-01-05:11:13:39'
  157. 3> auxiliary destination '/u01/app/oracle/oradata';

  158. Starting recover at 2018-01-05:11:14:59
  159. current log archived
  160. allocated channel: ORA_DISK_1
  161. channel ORA_DISK_1: SID=365 device type=DISK
  162. allocated channel: ORA_DISK_2
  163. channel ORA_DISK_2: SID=418 device type=DISK
  164. allocated channel: ORA_DISK_3
  165. channel ORA_DISK_3: SID=6 device type=DISK
  166. allocated channel: ORA_DISK_4
  167. channel ORA_DISK_4: SID=187 device type=DISK
  168. allocated channel: ORA_DISK_5
  169. channel ORA_DISK_5: SID=247 device type=DISK
  170. allocated channel: ORA_DISK_6
  171. channel ORA_DISK_6: SID=361 device type=DISK
  172. allocated channel: ORA_DISK_7
  173. channel ORA_DISK_7: SID=309 device type=DISK
  174. allocated channel: ORA_DISK_8
  175. channel ORA_DISK_8: SID=417 device type=DISK
  176. allocated channel: ORA_DISK_9
  177. channel ORA_DISK_9: SID=5 device type=DISK
  178. allocated channel: ORA_DISK_10
  179. channel ORA_DISK_10: SID=63 device type=DISK
  180. allocated channel: ORA_DISK_11
  181. channel ORA_DISK_11: SID=129 device type=DISK
  182. allocated channel: ORA_DISK_12
  183. channel ORA_DISK_12: SID=188 device type=DISK
  184. allocated channel: ORA_DISK_13
  185. channel ORA_DISK_13: SID=243 device type=DISK
  186. allocated channel: ORA_DISK_14
  187. channel ORA_DISK_14: SID=310 device type=DISK
  188. allocated channel: ORA_DISK_15
  189. channel ORA_DISK_15: SID=366 device type=DISK
  190. allocated channel: ORA_DISK_16
  191. channel ORA_DISK_16: SID=420 device type=DISK
  192. using channel ORA_SBT_TAPE_1
  193. using channel ORA_SBT_TAPE_2
  194. RMAN-05026: WARNING: presuming following set of tablespaces applies to specified Point-in-Time

  195. List of tablespaces expected to have UNDO segments
  196. Tablespace SYSTEM
  197. Tablespace UNDOTBS1

  198. Creating automatic instance, with SID='uAxa'

  199. initialization parameters used for automatic instance:
  200. db_name=CDB2
  201. db_unique_name=uAxa_pitr_pdb2_CDB2
  202. compatible=12.1.0.2.0
  203. db_block_size=8192
  204. db_files=200
  205. diagnostic_dest=/u01/app/oracle
  206. _system_trig_enabled=FALSE
  207. sga_target=2560M
  208. processes=200
  209. db_create_file_dest=/u01/app/oracle/oradata
  210. log_archive_dest_1='location=/u01/app/oracle/oradata'
  211. enable_pluggable_database=true
  212. _clone_one_pdb_recovery=true
  213. #No auxiliary parameter file used


  214. starting up automatic instance CDB2

  215. Oracle instance started

  216. Total System Global Area    2684354560 bytes

  217. Fixed Size                     3714440 bytes
  218. Variable Size                654312056 bytes
  219. Database Buffers            2013265920 bytes
  220. Redo Buffers                  13062144 bytes
  221. Automatic instance created
  222. Running TRANSPORT_SET_CHECK on recovery set tablespaces
  223. TRANSPORT_SET_CHECK completed successfully

  224. contents of Memory Script:
  225. {
  226. # set requested point in time
  227. set until  time "2018-01-05:11:13:39";
  228. # restore the controlfile
  229. restore clone controlfile;

  230. # mount the controlfile
  231. sql clone 'alter database mount clone database';

  232. # archive current online log
  233. sql 'alter system archive log current';
  234. # avoid unnecessary autobackups for structural changes during TSPITR
  235. sql 'begin dbms_backup_restore.AutoBackupFlag(FALSE); end;';
  236. }
  237. executing Memory Script

  238. executing command: SET until clause

  239. Starting restore at 2018-01-05:11:15:55
  240. allocated channel: ORA_AUX_DISK_1
  241. channel ORA_AUX_DISK_1: SID=289 device type=DISK
  242. allocated channel: ORA_AUX_DISK_2
  243. channel ORA_AUX_DISK_2: SID=44 device type=DISK
  244. allocated channel: ORA_AUX_DISK_3
  245. channel ORA_AUX_DISK_3: SID=86 device type=DISK
  246. allocated channel: ORA_AUX_DISK_4
  247. channel ORA_AUX_DISK_4: SID=127 device type=DISK
  248. allocated channel: ORA_AUX_DISK_5
  249. channel ORA_AUX_DISK_5: SID=168 device type=DISK
  250. allocated channel: ORA_AUX_DISK_6
  251. channel ORA_AUX_DISK_6: SID=210 device type=DISK
  252. allocated channel: ORA_AUX_DISK_7
  253. channel ORA_AUX_DISK_7: SID=250 device type=DISK
  254. allocated channel: ORA_AUX_DISK_8
  255. channel ORA_AUX_DISK_8: SID=291 device type=DISK
  256. allocated channel: ORA_AUX_DISK_9
  257. channel ORA_AUX_DISK_9: SID=4 device type=DISK
  258. allocated channel: ORA_AUX_DISK_10
  259. channel ORA_AUX_DISK_10: SID=45 device type=DISK
  260. allocated channel: ORA_AUX_DISK_11
  261. channel ORA_AUX_DISK_11: SID=87 device type=DISK
  262. allocated channel: ORA_AUX_DISK_12
  263. channel ORA_AUX_DISK_12: SID=128 device type=DISK
  264. allocated channel: ORA_AUX_DISK_13
  265. channel ORA_AUX_DISK_13: SID=169 device type=DISK
  266. allocated channel: ORA_AUX_DISK_14
  267. channel ORA_AUX_DISK_14: SID=211 device type=DISK
  268. allocated channel: ORA_AUX_DISK_15
  269. channel ORA_AUX_DISK_15: SID=251 device type=DISK
  270. allocated channel: ORA_AUX_DISK_16
  271. channel ORA_AUX_DISK_16: SID=292 device type=DISK
  272. allocated channel: ORA_AUX_SBT_TAPE_1
  273. channel ORA_AUX_SBT_TAPE_1: SID=5 device type=SBT_TAPE
  274. channel ORA_AUX_SBT_TAPE_1: Oracle Secure Backup
  275. allocated channel: ORA_AUX_SBT_TAPE_2
  276. channel ORA_AUX_SBT_TAPE_2: SID=46 device type=SBT_TAPE
  277. channel ORA_AUX_SBT_TAPE_2: Oracle Secure Backup

  278. channel ORA_AUX_SBT_TAPE_1: starting datafile backup set restore
  279. channel ORA_AUX_SBT_TAPE_1: restoring control file
  280. channel ORA_AUX_SBT_TAPE_1: reading from backup piece c-710472048-20180105-07
  281. channel ORA_AUX_SBT_TAPE_1: piece handle=c-710472048-20180105-07 tag=TAG20180105T111225
  282. channel ORA_AUX_SBT_TAPE_1: restored backup piece 1
  283. channel ORA_AUX_SBT_TAPE_1: restore complete, elapsed time: 00:00:25
  284. output file name=/u01/app/oracle/oradata/CDB2/controlfile/o1_mf_f4xvjb47_.ctl
  285. Finished restore at 2018-01-05:11:16:34

  286. sql statement: alter database mount clone database

  287. sql statement: alter system archive log current

  288. sql statement: begin dbms_backup_restore.AutoBackupFlag(FALSE); end;

  289. contents of Memory Script:
  290. {
  291. # set requested point in time
  292. set until  time "2018-01-05:11:13:39";
  293. plsql <<<--
  294. declare
  295.   sqlstatement       varchar2(512);
  296.   pdbname            varchar2(30);
  297.   offline_not_needed exception;
  298.   pragma exception_init(offline_not_needed, -01539);
  299. begin
  300.    pdbname := 'PDB2'; -- pdbname
  301.   sqlstatement := 'alter tablespace '||  'DJ_PDB2' ||' offline immediate';
  302.   krmicd.writeMsg(6162, sqlstatement);
  303.   krmicd.execSql(sqlstatement, 0, pdbname);
  304. exception
  305.   when offline_not_needed then
  306.     null;
  307. end; >>>;
  308. # set destinations for recovery set and auxiliary set datafiles
  309. set newname for clone datafile  1 to new;
  310. set newname for clone datafile  4 to new;
  311. set newname for clone datafile  3 to new;
  312. set newname for clone datafile  10 to new;
  313. set newname for clone datafile  11 to new;
  314. set newname for clone tempfile  1 to new;
  315. set newname for clone tempfile  3 to new;
  316. set newname for clone tempfile  8 to new;
  317. set newname for clone tempfile  9 to new;
  318. set newname for clone tempfile  10 to new;
  319. set newname for datafile  39 to
  320. "/u01/app/oracle/oradata/cdb2/pdb2_1/dj_pdb2.f";
  321. # switch all tempfiles
  322. switch clone tempfile all;
  323. # restore the tablespaces in the recovery set and the auxiliary set
  324. restore clone datafile  1, 4, 3, 10, 11, 39;

  325. switch clone datafile all;
  326. }
  327. executing Memory Script

  328. executing command: SET until clause

  329. sql statement: alter tablespace DJ_PDB2 offline immediate

  330. executing command: SET NEWNAME

  331. executing command: SET NEWNAME

  332. executing command: SET NEWNAME

  333. executing command: SET NEWNAME

  334. executing command: SET NEWNAME

  335. executing command: SET NEWNAME

  336. executing command: SET NEWNAME

  337. executing command: SET NEWNAME

  338. executing command: SET NEWNAME

  339. executing command: SET NEWNAME

  340. executing command: SET NEWNAME

  341. renamed tempfile 1 to /u01/app/oracle/oradata/CDB2/datafile/o1_mf_temp_%u_.tmp in control file
  342. renamed tempfile 3 to /u01/app/oracle/oradata/CDB2/datafile/o1_mf_temp_%u_.tmp in control file
  343. renamed tempfile 8 to /u01/app/oracle/oradata/CDB2/datafile/o1_mf_temp_roo_%u_.tmp in control file
  344. renamed tempfile 9 to /u01/app/oracle/oradata/CDB2/datafile/o1_mf_temp_pdb_%u_.tmp in control file
  345. renamed tempfile 10 to /u01/app/oracle/oradata/CDB2/datafile/o1_mf_my_temp_%u_.tmp in control file

  346. Starting restore at 2018-01-05:11:16:41
  347. using channel ORA_AUX_DISK_1
  348. using channel ORA_AUX_DISK_2
  349. using channel ORA_AUX_DISK_3
  350. using channel ORA_AUX_DISK_4
  351. using channel ORA_AUX_DISK_5
  352. using channel ORA_AUX_DISK_6
  353. using channel ORA_AUX_DISK_7
  354. using channel ORA_AUX_DISK_8
  355. using channel ORA_AUX_DISK_9
  356. using channel ORA_AUX_DISK_10
  357. using channel ORA_AUX_DISK_11
  358. using channel ORA_AUX_DISK_12
  359. using channel ORA_AUX_DISK_13
  360. using channel ORA_AUX_DISK_14
  361. using channel ORA_AUX_DISK_15
  362. using channel ORA_AUX_DISK_16
  363. using channel ORA_AUX_SBT_TAPE_1
  364. using channel ORA_AUX_SBT_TAPE_2

  365. channel ORA_AUX_SBT_TAPE_1: starting datafile backup set restore
  366. channel ORA_AUX_SBT_TAPE_1: specifying datafile(s) to restore from backup set
  367. channel ORA_AUX_SBT_TAPE_1: restoring datafile 00004 to /u01/app/oracle/oradata/CDB2/datafile/o1_mf_undotbs1_%u_.dbf
  368. channel ORA_AUX_SBT_TAPE_1: reading from backup piece 03snbm9f_1_1
  369. channel ORA_AUX_SBT_TAPE_2: starting datafile backup set restore
  370. channel ORA_AUX_SBT_TAPE_2: specifying datafile(s) to restore from backup set
  371. channel ORA_AUX_SBT_TAPE_2: restoring datafile 00001 to /u01/app/oracle/oradata/CDB2/datafile/o1_mf_system_%u_.dbf
  372. channel ORA_AUX_SBT_TAPE_2: restoring datafile 00003 to /u01/app/oracle/oradata/CDB2/datafile/o1_mf_sysaux_%u_.dbf
  373. channel ORA_AUX_SBT_TAPE_2: reading from backup piece 02snbm9f_1_1
  374. channel ORA_AUX_SBT_TAPE_1: piece handle=03snbm9f_1_1 tag=0T_WHOLE_INCR0
  375. channel ORA_AUX_SBT_TAPE_1: restored backup piece 1
  376. channel ORA_AUX_SBT_TAPE_1: restore complete, elapsed time: 00:00:56
  377. channel ORA_AUX_SBT_TAPE_1: starting datafile backup set restore
  378. channel ORA_AUX_SBT_TAPE_1: specifying datafile(s) to restore from backup set
  379. channel ORA_AUX_SBT_TAPE_1: restoring datafile 00010 to /u01/app/oracle/oradata/CDB2/datafile/o1_mf_system_%u_.dbf
  380. channel ORA_AUX_SBT_TAPE_1: reading from backup piece 1asnthrc_1_1
  381. channel ORA_AUX_SBT_TAPE_2: piece handle=02snbm9f_1_1 tag=0T_WHOLE_INCR0
  382. channel ORA_AUX_SBT_TAPE_2: restored backup piece 1
  383. channel ORA_AUX_SBT_TAPE_2: restore complete, elapsed time: 00:01:31
  384. channel ORA_AUX_SBT_TAPE_2: starting datafile backup set restore
  385. channel ORA_AUX_SBT_TAPE_2: specifying datafile(s) to restore from backup set
  386. channel ORA_AUX_SBT_TAPE_2: restoring datafile 00011 to /u01/app/oracle/oradata/CDB2/datafile/o1_mf_sysaux_%u_.dbf
  387. channel ORA_AUX_SBT_TAPE_2: restoring datafile 00039 to /u01/app/oracle/oradata/cdb2/pdb2_1/dj_pdb2.f
  388. channel ORA_AUX_SBT_TAPE_2: reading from backup piece 19snthrb_1_1
  389. channel ORA_AUX_SBT_TAPE_1: piece handle=1asnthrc_1_1 tag=TAG20180105T111139
  390. channel ORA_AUX_SBT_TAPE_1: restored backup piece 1
  391. channel ORA_AUX_SBT_TAPE_1: restore complete, elapsed time: 00:00:42
  392. channel ORA_AUX_SBT_TAPE_2: piece handle=19snthrb_1_1 tag=TAG20180105T111139
  393. channel ORA_AUX_SBT_TAPE_2: restored backup piece 1
  394. channel ORA_AUX_SBT_TAPE_2: restore complete, elapsed time: 00:00:45
  395. Finished restore at 2018-01-05:11:18:58

  396. datafile 1 switched to datafile copy
  397. input datafile copy RECID=8 STAMP=964610338 file name=/u01/app/oracle/oradata/CDB2/datafile/o1_mf_system_f4xvksb4_.dbf
  398. datafile 4 switched to datafile copy
  399. input datafile copy RECID=9 STAMP=964610338 file name=/u01/app/oracle/oradata/CDB2/datafile/o1_mf_undotbs1_f4xvks65_.dbf
  400. datafile 3 switched to datafile copy
  401. input datafile copy RECID=10 STAMP=964610338 file name=/u01/app/oracle/oradata/CDB2/datafile/o1_mf_sysaux_f4xvks96_.dbf
  402. datafile 10 switched to datafile copy
  403. input datafile copy RECID=11 STAMP=964610339 file name=/u01/app/oracle/oradata/CDB2/datafile/o1_mf_system_f4xvm9jg_.dbf
  404. datafile 11 switched to datafile copy
  405. input datafile copy RECID=12 STAMP=964610339 file name=/u01/app/oracle/oradata/CDB2/datafile/o1_mf_sysaux_f4xvn8fn_.dbf

  406. contents of Memory Script:
  407. {
  408. # set requested point in time
  409. set until  time "2018-01-05:11:13:39";
  410. # online the datafiles restored or switched
  411. sql clone "alter database datafile  1 online";
  412. sql clone "alter database datafile  4 online";
  413. sql clone "alter database datafile  3 online";
  414. sql clone 'PDB2' "alter database datafile
  415. 10 online";
  416. sql clone 'PDB2' "alter database datafile
  417. 11 online";
  418. sql clone 'PDB2' "alter database datafile
  419. 39 online";
  420. # recover and open resetlogs
  421. recover clone database tablespace  "PDB2":"DJ_PDB2", "SYSTEM", "UNDOTBS1", "SYSAUX", "PDB2":"SYSTEM", "PDB2":"SYSAUX" delete archivelog;
  422. alter clone database open resetlogs;
  423. }
  424. executing Memory Script

  425. executing command: SET until clause

  426. sql statement: alter database datafile  1 online

  427. sql statement: alter database datafile  4 online

  428. sql statement: alter database datafile  3 online

  429. sql statement: alter database datafile  10 online

  430. sql statement: alter database datafile  11 online

  431. sql statement: alter database datafile  39 online

  432. Starting recover at 2018-01-05:11:19:00
  433. using channel ORA_AUX_DISK_1
  434. using channel ORA_AUX_DISK_2
  435. using channel ORA_AUX_DISK_3
  436. using channel ORA_AUX_DISK_4
  437. using channel ORA_AUX_DISK_5
  438. using channel ORA_AUX_DISK_6
  439. using channel ORA_AUX_DISK_7
  440. using channel ORA_AUX_DISK_8
  441. using channel ORA_AUX_DISK_9
  442. using channel ORA_AUX_DISK_10
  443. using channel ORA_AUX_DISK_11
  444. using channel ORA_AUX_DISK_12
  445. using channel ORA_AUX_DISK_13
  446. using channel ORA_AUX_DISK_14
  447. using channel ORA_AUX_DISK_15
  448. using channel ORA_AUX_DISK_16
  449. using channel ORA_AUX_SBT_TAPE_1
  450. using channel ORA_AUX_SBT_TAPE_2

  451. starting media recovery

  452. archived log for thread 1 with sequence 151 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_12_29/o1_mf_1_151_f4d2kkxo_.arc
  453. archived log for thread 1 with sequence 152 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_12_29/o1_mf_1_152_f4d2kl5w_.arc
  454. archived log for thread 1 with sequence 1 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_12_29/o1_mf_1_1_f4d2wzr1_.arc
  455. archived log for thread 1 with sequence 2 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_12_29/o1_mf_1_2_f4d452oy_.arc
  456. archived log for thread 1 with sequence 3 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_12_29/o1_mf_1_3_f4dlsjnd_.arc
  457. archived log for thread 1 with sequence 4 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_12_29/o1_mf_1_4_f4dm2wtn_.arc
  458. archived log for thread 1 with sequence 5 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_12_30/o1_mf_1_5_f4fc7t2s_.arc
  459. archived log for thread 1 with sequence 6 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_12_30/o1_mf_1_6_f4for68l_.arc
  460. archived log for thread 1 with sequence 7 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_12_30/o1_mf_1_7_f4g0bh77_.arc
  461. archived log for thread 1 with sequence 8 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_12_30/o1_mf_1_8_f4gc2j2p_.arc
  462. archived log for thread 1 with sequence 9 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_12_30/o1_mf_1_9_f4gs4ls6_.arc
  463. archived log for thread 1 with sequence 10 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_12_30/o1_mf_1_10_f4gwfmv8_.arc
  464. archived log for thread 1 with sequence 11 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_12_30/o1_mf_1_11_f4h78qpj_.arc
  465. archived log for thread 1 with sequence 12 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_12_31/o1_mf_1_12_f4ho1x94_.arc
  466. archived log for thread 1 with sequence 13 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_12_31/o1_mf_1_13_f4j36m22_.arc
  467. archived log for thread 1 with sequence 14 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_12_31/o1_mf_1_14_f4jkjtl8_.arc
  468. archived log for thread 1 with sequence 15 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_12_31/o1_mf_1_15_f4jnprrk_.arc
  469. archived log for thread 1 with sequence 16 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_12_31/o1_mf_1_16_f4k09fc1_.arc
  470. archived log for thread 1 with sequence 17 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_12_31/o1_mf_1_17_f4kff9y5_.arc
  471. archived log for thread 1 with sequence 18 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_12_31/o1_mf_1_18_f4kvd9o1_.arc
  472. archived log for thread 1 with sequence 19 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_01/o1_mf_1_19_f4ldywq7_.arc
  473. archived log for thread 1 with sequence 20 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_01/o1_mf_1_20_f4lyn0co_.arc
  474. archived log for thread 1 with sequence 21 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_01/o1_mf_1_21_f4mdmqon_.arc
  475. archived log for thread 1 with sequence 22 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_01/o1_mf_1_22_f4nd6rvq_.arc
  476. archived log for thread 1 with sequence 23 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_01/o1_mf_1_23_f4nhwxlh_.arc
  477. archived log for thread 1 with sequence 24 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_02/o1_mf_1_24_f4npryqy_.arc
  478. archived log for thread 1 with sequence 25 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_02/o1_mf_1_25_f4om1f4h_.arc
  479. archived log for thread 1 with sequence 26 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_02/o1_mf_1_26_f4osyn30_.arc
  480. archived log for thread 1 with sequence 27 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_02/o1_mf_1_27_f4pnhxcv_.arc
  481. archived log for thread 1 with sequence 28 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_02/o1_mf_1_28_f4q46ml4_.arc
  482. archived log for thread 1 with sequence 29 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_02/o1_mf_1_29_f4q4fqq0_.arc
  483. archived log for thread 1 with sequence 30 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_03/o1_mf_1_30_f4qs6bym_.arc
  484. archived log for thread 1 with sequence 31 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_03/o1_mf_1_31_f4r7gvmc_.arc
  485. archived log for thread 1 with sequence 32 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_03/o1_mf_1_32_f4rwct90_.arc
  486. archived log for thread 1 with sequence 33 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_03/o1_mf_1_33_f4srj6l4_.arc
  487. archived log for thread 1 with sequence 34 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_03/o1_mf_1_34_f4srpdo5_.arc
  488. archived log for thread 1 with sequence 35 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_04/o1_mf_1_35_f4t32cwx_.arc
  489. archived log for thread 1 with sequence 36 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_04/o1_mf_1_36_f4tvw8tz_.arc
  490. archived log for thread 1 with sequence 37 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_04/o1_mf_1_37_f4v9pr6o_.arc
  491. archived log for thread 1 with sequence 38 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_04/o1_mf_1_38_f4vysdd1_.arc
  492. archived log for thread 1 with sequence 39 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_04/o1_mf_1_39_f4wdzflc_.arc
  493. archived log for thread 1 with sequence 40 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_04/o1_mf_1_40_f4wf87q1_.arc
  494. archived log for thread 1 with sequence 41 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_05/o1_mf_1_41_f4xdk9xz_.arc
  495. archived log for thread 1 with sequence 42 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_05/o1_mf_1_42_f4xj9wrh_.arc
  496. archived log for thread 1 with sequence 43 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_05/o1_mf_1_43_f4xq2o96_.arc
  497. archived log for thread 1 with sequence 44 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_05/o1_mf_1_44_f4xq5q9g_.arc
  498. archived log for thread 1 with sequence 45 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_05/o1_mf_1_45_f4xqsm93_.arc
  499. archived log for thread 1 with sequence 46 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_05/o1_mf_1_46_f4xr2yqf_.arc
  500. archived log for thread 1 with sequence 47 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_05/o1_mf_1_47_f4xr321g_.arc
  501. archived log for thread 1 with sequence 48 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_05/o1_mf_1_48_f4xr3598_.arc
  502. archived log for thread 1 with sequence 49 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_05/o1_mf_1_49_f4xr36br_.arc
  503. archived log for thread 1 with sequence 50 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_05/o1_mf_1_50_f4xr379f_.arc
  504. archived log for thread 1 with sequence 51 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_05/o1_mf_1_51_f4xr8rtk_.arc
  505. archived log for thread 1 with sequence 52 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_05/o1_mf_1_52_f4xs14j6_.arc
  506. archived log for thread 1 with sequence 53 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_05/o1_mf_1_53_f4xs478v_.arc
  507. archived log for thread 1 with sequence 54 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_05/o1_mf_1_54_f4xtw860_.arc
  508. archived log for thread 1 with sequence 55 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_05/o1_mf_1_55_f4xtw7jy_.arc
  509. archived log for thread 1 with sequence 56 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_05/o1_mf_1_56_f4xtw7r1_.arc
  510. archived log for thread 1 with sequence 1 is already on disk as file /u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_05/o1_mf_1_1_f4xvfmg1_.arc
  511. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_12_29/o1_mf_1_151_f4d2kkxo_.arc thread=1 sequence=151
  512. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_12_29/o1_mf_1_152_f4d2kl5w_.arc thread=1 sequence=152
  513. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_12_29/o1_mf_1_1_f4d2wzr1_.arc thread=1 sequence=1
  514. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_12_29/o1_mf_1_2_f4d452oy_.arc thread=1 sequence=2
  515. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_12_29/o1_mf_1_3_f4dlsjnd_.arc thread=1 sequence=3
  516. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_12_29/o1_mf_1_4_f4dm2wtn_.arc thread=1 sequence=4
  517. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_12_30/o1_mf_1_5_f4fc7t2s_.arc thread=1 sequence=5
  518. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_12_30/o1_mf_1_6_f4for68l_.arc thread=1 sequence=6
  519. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_12_30/o1_mf_1_7_f4g0bh77_.arc thread=1 sequence=7
  520. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_12_30/o1_mf_1_8_f4gc2j2p_.arc thread=1 sequence=8
  521. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_12_30/o1_mf_1_9_f4gs4ls6_.arc thread=1 sequence=9
  522. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_12_30/o1_mf_1_10_f4gwfmv8_.arc thread=1 sequence=10
  523. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_12_30/o1_mf_1_11_f4h78qpj_.arc thread=1 sequence=11
  524. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_12_31/o1_mf_1_12_f4ho1x94_.arc thread=1 sequence=12
  525. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_12_31/o1_mf_1_13_f4j36m22_.arc thread=1 sequence=13
  526. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_12_31/o1_mf_1_14_f4jkjtl8_.arc thread=1 sequence=14
  527. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_12_31/o1_mf_1_15_f4jnprrk_.arc thread=1 sequence=15
  528. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_12_31/o1_mf_1_16_f4k09fc1_.arc thread=1 sequence=16
  529. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_12_31/o1_mf_1_17_f4kff9y5_.arc thread=1 sequence=17
  530. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2017_12_31/o1_mf_1_18_f4kvd9o1_.arc thread=1 sequence=18
  531. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_01/o1_mf_1_19_f4ldywq7_.arc thread=1 sequence=19
  532. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_01/o1_mf_1_20_f4lyn0co_.arc thread=1 sequence=20
  533. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_01/o1_mf_1_21_f4mdmqon_.arc thread=1 sequence=21
  534. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_01/o1_mf_1_22_f4nd6rvq_.arc thread=1 sequence=22
  535. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_01/o1_mf_1_23_f4nhwxlh_.arc thread=1 sequence=23
  536. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_02/o1_mf_1_24_f4npryqy_.arc thread=1 sequence=24
  537. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_02/o1_mf_1_25_f4om1f4h_.arc thread=1 sequence=25
  538. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_02/o1_mf_1_26_f4osyn30_.arc thread=1 sequence=26
  539. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_02/o1_mf_1_27_f4pnhxcv_.arc thread=1 sequence=27
  540. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_02/o1_mf_1_28_f4q46ml4_.arc thread=1 sequence=28
  541. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_02/o1_mf_1_29_f4q4fqq0_.arc thread=1 sequence=29
  542. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_03/o1_mf_1_30_f4qs6bym_.arc thread=1 sequence=30
  543. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_03/o1_mf_1_31_f4r7gvmc_.arc thread=1 sequence=31
  544. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_03/o1_mf_1_32_f4rwct90_.arc thread=1 sequence=32
  545. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_03/o1_mf_1_33_f4srj6l4_.arc thread=1 sequence=33
  546. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_03/o1_mf_1_34_f4srpdo5_.arc thread=1 sequence=34
  547. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_04/o1_mf_1_35_f4t32cwx_.arc thread=1 sequence=35
  548. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_04/o1_mf_1_36_f4tvw8tz_.arc thread=1 sequence=36
  549. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_04/o1_mf_1_37_f4v9pr6o_.arc thread=1 sequence=37
  550. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_04/o1_mf_1_38_f4vysdd1_.arc thread=1 sequence=38
  551. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_04/o1_mf_1_39_f4wdzflc_.arc thread=1 sequence=39
  552. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_04/o1_mf_1_40_f4wf87q1_.arc thread=1 sequence=40
  553. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_05/o1_mf_1_41_f4xdk9xz_.arc thread=1 sequence=41
  554. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_05/o1_mf_1_42_f4xj9wrh_.arc thread=1 sequence=42
  555. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_05/o1_mf_1_43_f4xq2o96_.arc thread=1 sequence=43
  556. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_05/o1_mf_1_44_f4xq5q9g_.arc thread=1 sequence=44
  557. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_05/o1_mf_1_45_f4xqsm93_.arc thread=1 sequence=45
  558. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_05/o1_mf_1_46_f4xr2yqf_.arc thread=1 sequence=46
  559. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_05/o1_mf_1_47_f4xr321g_.arc thread=1 sequence=47
  560. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_05/o1_mf_1_48_f4xr3598_.arc thread=1 sequence=48
  561. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_05/o1_mf_1_49_f4xr36br_.arc thread=1 sequence=49
  562. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_05/o1_mf_1_50_f4xr379f_.arc thread=1 sequence=50
  563. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_05/o1_mf_1_51_f4xr8rtk_.arc thread=1 sequence=51
  564. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_05/o1_mf_1_52_f4xs14j6_.arc thread=1 sequence=52
  565. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_05/o1_mf_1_53_f4xs478v_.arc thread=1 sequence=53
  566. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_05/o1_mf_1_54_f4xtw860_.arc thread=1 sequence=54
  567. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_05/o1_mf_1_55_f4xtw7jy_.arc thread=1 sequence=55
  568. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_05/o1_mf_1_56_f4xtw7r1_.arc thread=1 sequence=56
  569. archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2018_01_05/o1_mf_1_1_f4xvfmg1_.arc thread=1 sequence=1
  570. media recovery complete, elapsed time: 00:06:37
  571. Finished recover at 2018-01-05:11:25:39

  572. database opened

  573. contents of Memory Script:
  574. {
  575. sql clone 'alter pluggable database  PDB2 open';
  576. }
  577. executing Memory Script

  578. sql statement: alter pluggable database  PDB2 open

  579. contents of Memory Script:
  580. {
  581. # make read only the tablespace that will be exported
  582. sql clone 'PDB2' 'alter tablespace
  583. DJ_PDB2 read only';
  584. # create directory for datapump import
  585. sql 'PDB2' "create or replace directory
  586. TSPITR_DIROBJ_DPDIR as ''
  587. /u01/app/oracle/oradata''";
  588. # create directory for datapump export
  589. sql clone 'PDB2' "create or replace directory
  590. TSPITR_DIROBJ_DPDIR as ''
  591. /u01/app/oracle/oradata''";
  592. }
  593. executing Memory Script

  594. sql statement: alter tablespace  DJ_PDB2 read only

  595. sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''/u01/app/oracle/oradata''

  596. sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''/u01/app/oracle/oradata''

  597. Performing export of metadata...
  598.    EXPDP> Starting "SYS"."TSPITR_EXP_uAxa_Cofi":  
  599.    EXPDP> Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
  600.    EXPDP> Processing object type TRANSPORTABLE_EXPORT/TABLE
  601.    EXPDP> Processing object type TRANSPORTABLE_EXPORT/TABLE_STATISTICS
  602.    EXPDP> Processing object type TRANSPORTABLE_EXPORT/STATISTICS/MARKER
  603.    EXPDP> Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
  604.    EXPDP> Master table "SYS"."TSPITR_EXP_uAxa_Cofi" successfully loaded/unloaded
  605.    EXPDP> ******************************************************************************
  606.    EXPDP> Dump file set for SYS.TSPITR_EXP_uAxa_Cofi is:
  607.    EXPDP>   /u01/app/oracle/oradata/tspitr_uAxa_52397.dmp
  608.    EXPDP> ******************************************************************************
  609.    EXPDP> Datafiles required for transportable tablespace DJ_PDB2:
  610.    EXPDP>   /u01/app/oracle/oradata/cdb2/pdb2_1/dj_pdb2.f
  611.    EXPDP> Job "SYS"."TSPITR_EXP_uAxa_Cofi" successfully completed at Fri Jan 5 11:27:03 2018 elapsed 0 00:00:57
  612. Export completed


  613. contents of Memory Script:
  614. {
  615. # shutdown clone before import
  616. shutdown clone abort
  617. # drop target tablespaces before importing them back
  618. sql 'PDB2' 'drop tablespace
  619. DJ_PDB2 including contents keep datafiles cascade constraints';
  620. }
  621. executing Memory Script

  622. Oracle instance shut down

  623. sql statement: drop tablespace  DJ_PDB2 including contents keep datafiles cascade constraints

  624. Performing import of metadata...
  625.    IMPDP> Master table "SYS"."TSPITR_IMP_uAxa_hjpk" successfully loaded/unloaded
  626.    IMPDP> Starting "SYS"."TSPITR_IMP_uAxa_hjpk":  
  627.    IMPDP> Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
  628.    IMPDP> Processing object type TRANSPORTABLE_EXPORT/TABLE
  629.    IMPDP> Processing object type TRANSPORTABLE_EXPORT/TABLE_STATISTICS
  630.    IMPDP> Processing object type TRANSPORTABLE_EXPORT/STATISTICS/MARKER
  631.    IMPDP> Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
  632.    IMPDP> Job "SYS"."TSPITR_IMP_uAxa_hjpk" successfully completed at Fri Jan 5 11:28:00 2018 elapsed 0 00:00:33
  633. Import completed


  634. contents of Memory Script:
  635. {
  636. # make read write and offline the imported tablespaces
  637. sql 'PDB2' 'alter tablespace
  638. DJ_PDB2 read write';
  639. sql 'PDB2' 'alter tablespace
  640. DJ_PDB2 offline';
  641. # enable autobackups after TSPITR is finished
  642. sql 'begin dbms_backup_restore.AutoBackupFlag(TRUE); end;';
  643. }
  644. executing Memory Script

  645. sql statement: alter tablespace  DJ_PDB2 read write

  646. sql statement: alter tablespace  DJ_PDB2 offline

  647. sql statement: begin dbms_backup_restore.AutoBackupFlag(TRUE); end;

  648. Removing automatic instance
  649. Automatic instance removed
  650. auxiliary instance file /u01/app/oracle/oradata/CDB2/datafile/o1_mf_my_temp_f4xw1xdx_.tmp deleted
  651. auxiliary instance file /u01/app/oracle/oradata/CDB2/datafile/o1_mf_temp_pdb_f4xw1xb4_.tmp deleted
  652. auxiliary instance file /u01/app/oracle/oradata/CDB2/datafile/o1_mf_temp_roo_f4xw1s5d_.tmp deleted
  653. auxiliary instance file /u01/app/oracle/oradata/CDB2/datafile/o1_mf_temp_f4xw1x77_.tmp deleted
  654. auxiliary instance file /u01/app/oracle/oradata/CDB2/datafile/o1_mf_temp_f4xw1s27_.tmp deleted
  655. auxiliary instance file /u01/app/oracle/oradata/CDB2/onlinelog/o1_mf_3_f4xw1pd2_.log deleted
  656. auxiliary instance file /u01/app/oracle/oradata/CDB2/onlinelog/o1_mf_2_f4xw1o7p_.log deleted
  657. auxiliary instance file /u01/app/oracle/oradata/CDB2/onlinelog/o1_mf_1_f4xw1n55_.log deleted
  658. auxiliary instance file /u01/app/oracle/oradata/CDB2/datafile/o1_mf_sysaux_f4xvn8fn_.dbf deleted
  659. auxiliary instance file /u01/app/oracle/oradata/CDB2/datafile/o1_mf_system_f4xvm9jg_.dbf deleted
  660. auxiliary instance file /u01/app/oracle/oradata/CDB2/datafile/o1_mf_sysaux_f4xvks96_.dbf deleted
  661. auxiliary instance file /u01/app/oracle/oradata/CDB2/datafile/o1_mf_undotbs1_f4xvks65_.dbf deleted
  662. auxiliary instance file /u01/app/oracle/oradata/CDB2/datafile/o1_mf_system_f4xvksb4_.dbf deleted
  663. auxiliary instance file /u01/app/oracle/oradata/CDB2/controlfile/o1_mf_f4xvjb47_.ctl deleted
  664. auxiliary instance file tspitr_uAxa_52397.dmp deleted
  665. Finished recover at 2018-01-05:11:28:06

  666. RMAN> exit


  667. Recovery Manager complete.
  668. [oracle@station26 ~]$ sqlplus /nolog

  669. SQL*Plus: Release 12.1.0.2.0 Production on Fri Jan 5 11:29:02 2018

  670. Copyright (c) 1982, 2014, Oracle.  All rights reserved.

  671. SQL> conn sys/oracle_4U@pdb2 as sysdba
  672. Connected.
  673. SQL> alter tablespace dj_pdb2 online ;

  674. Tablespace altered.

  675. SQL> select  * from dj.t1;

  676. C
  677. --------------------------------------------------------------------------------
  678. 1

  679. SQL> ouse.dbc  example.dmp   
复制代码

书P218页开CDB2闪回时关闭数据库是没有必要的,从11g开始闪回都可以在开库的时候打开。
书P224 r用man的备份集插入插件数据库,要选:
Screenshot.png

对应于dbca:
Screenshot-1.png
Screenshot-2.png
Screenshot-3.png Screenshot-4.png

P244 :
SYSTEM用户:
  1. SQL> create table t1 as select  * from dba_objects ;

  2. Table created.

  3. SQL> create or replace procedure burn_cpu
  4.   2  is
  5.   3   v_count number;
  6.   4  begin
  7.   5    select  count(*) into v_count from t1 a, t1 b;
  8.   6  end;
  9.   7  /

  10. Procedure created.

复制代码

Screenshot.png
回复

使用道具 举报

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

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-3-29 02:47 , Processed in 0.041511 second(s), 27 queries .

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