Bo's Oracle Station

查看: 2844|回复: 0

课程第57/58次(2017-09-24星期天上下午)

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2017-9-24 09:41:35 | 显示全部楼层 |阅读模式
第三阶段New Feature/OCM Exam Preparation31-58
新特性第19章:

  1. select  * from dba_objects
  2. where object_name like 'DBMS_LOG%';\
  3. ---

  4. select  * from dba_directories;

  5. create directory dir1 as '/home/oracle/dir1';

  6.   
  7. create directory dir2 as '/home/oracle/dir2';

  8. grant all on directory dir1 to hr;

  9. grant all on directory dir2 to hr;
复制代码

  1. expdp hr/oracle_4U directory=dir1 dumpfile=dir1:a1_%U.dmp,dir2:a2_%U.dmp   tables=t_big filesize=10M
复制代码
在Linux上作,要考虑转意:
  1. expdp hr/oracle_4U directory=dir1 dumpfile=a3.dmp  schemas=hr job_name=a3_job  exclude=table:"in \(\'T_BANK_INVOICE\'\)", procedure:" in \(\'SECURE_DML\'\)"  "query='employees:where department_id=90'"
复制代码

parfile:
  1. directory=dir1
  2. dumpfile=a4.dmp  
  3. schemas=hr
  4. job_name=a4
  5. exclude=table:"in ('T_BANK_INVOICE')", procedure:"in ('SECURE_DML')"  , constraint
  6. query='employees:where department_id=90'
复制代码
带建用户命令导出:
  1. directory=dir1
  2. dumpfile=a5.dmp
  3. schemas=hr
  4. job_name=a5
  5. exclude=table:"in ('T_BANK_INVOICE')", procedure:"in ('SECURE_DML')" , constraint
  6. query='hr.employees:where department_id=90'
复制代码
  1. expdp system/oracle_4U parfile='/home/oracle/a5.par'
复制代码
  1. impdp system/oracle_4U  directory=dir1 dumpfile=a5.dmp  remap_schema=hr:user3
复制代码

---
  1. run{
  2. duplicate target database to db11g
  3. from active database
  4. nofilenamecheck
  5. spfile
  6. set
  7. control_files='/u01/app/oracle/oradata/db11g/control01.ctl','/u01/app/oracle/oradata/db11g/control02.ctl','/u01/app/oracle/oradata/db11g/control03.ctl'
  8. set
  9. db_file_name_convert='+DATA/orcl/datafile/example.265.832197353','/u01/app/oracle/oradata/db11g/example01.dbf','+DATA/orcl/datafile/users.259.832197065','/u01/app/oracle/oradata/db11g/users01.dbf','+DATA/orcl/datafile/undotbs1.258.832197065','/u01/app/oracle/oradata/db11g/undotbs01.dbf','+DATA/orcl/datafile/sysaux.257.832197065','/u01/app/oracle/oradata/db11g/sysaux01.dbf','+DATA/orcl/datafile/system.256.832197063','/u01/app/oracle/oradata/db11g/system01.dbf'
  10. set
  11. log_file_name_convert='+DATA/orcl/onlinelog/group_1.261.832197287','/u01/app/oracle/oradata/db11g/redo01a.log','+FRA/orcl/onlinelog/group_1.257.832197291','/u01/app/oracle/oradata/db11g/redo01b.log','+DATA/orcl/onlinelog/group_3.263.832197301','/u01/app/oracle/oradata/db11g/redo03a.log','+FRA/orcl/onlinelog/group_3.259.832197305','/u01/app/oracle/oradata/db11g/redo03b.log','+DATA/orcl/onlinelog/group_2.262.832197293','/u01/app/oracle/oradata/db11g/redo02a.log','+FRA/orcl/onlinelog/group_2.258.832197299','/u01/app/oracle/oradata/db11g/redo02b.log';
  12. set
  13. audit_file_dest='/u01/app/oracle/admin/db11g/adump'
  14. set
  15. db_create_file_dest=''
  16. set
  17. db_recovery_file_dest='/u01/app/oracle/flash_recovery_area';
  18. }
复制代码

新的set newname 克隆语法:
ASM到ASM:

Screenshot.png
  1. RUN
  2. {
  3. allocate channel c1 device type disk;
  4. allocate channel c2 device type disk;
  5. allocate channel c3 device type disk;
  6. allocate channel c4 device type disk;
  7. allocate channel c5 device type disk;
  8. allocate channel c6 device type disk;
  9. allocate channel c7 device type disk;
  10. allocate channel c8 device type disk;
  11. allocate auxiliary channel c9 device type disk;
  12. allocate auxiliary channel c10 device type disk;
  13. allocate auxiliary channel c11 device type disk;
  14. allocate auxiliary channel c12 device type disk;
  15. allocate auxiliary channel c13 device type disk;
  16. allocate auxiliary channel c14 device type disk;
  17. allocate auxiliary channel c15 device type disk;
  18. allocate auxiliary channel c16 device type disk;
  19. DUPLICATE TARGET DATABASE TO db11g
  20. from active database
  21. nofilenamecheck
  22. spfile
  23. set
  24. control_files='+DATA','+FRA'
  25. set
  26. audit_file_dest='/u01/app/oracle/admin/db11g/adump';
  27. }
复制代码
新的set newname 克隆语法:
ASM到FILE SYSTEM:

  1.     RUN
  2.     {
  3.     allocate channel c1 device type disk;
  4.     allocate channel c2 device type disk;
  5.     allocate channel c3 device type disk;
  6.     allocate channel c4 device type disk;
  7.     allocate channel c5 device type disk;
  8.     allocate channel c6 device type disk;
  9.     allocate channel c7 device type disk;
  10.     allocate channel c8 device type disk;
  11.     allocate auxiliary channel c9 device type disk;
  12.     allocate auxiliary channel c10 device type disk;
  13.     allocate auxiliary channel c11 device type disk;
  14.     allocate auxiliary channel c12 device type disk;
  15.     allocate auxiliary channel c13 device type disk;
  16.     allocate auxiliary channel c14 device type disk;
  17.     allocate auxiliary channel c15 device type disk;
  18.     allocate auxiliary channel c16 device type disk;
  19.     SET NEWNAME FOR DATABASE TO '/u01/app/oracle/oradata/new11g/%b';
  20.     DUPLICATE TARGET DATABASE TO new11g
  21.     from active database
  22.     nofilenamecheck
  23.     LOGFILE
  24.     GROUP 1 ('/u01/app/oracle/oradata/new11g/redo01a.log',
  25.     '/u01/app/oracle/oradata/new11g/redo01b.log') SIZE 50M REUSE,
  26.     GROUP 2 ('/u01/app/oracle/oradata/new11g/redo02a.log',
  27.     '/u01/app/oracle/oradata/new11g/redo02b.log') SIZE 50M REUSE,
  28.     GROUP 3 ('/u01/app/oracle/oradata/new11g/redo03a.log',
  29.     '/u01/app/oracle/oradata/new11g/redo03b.log') SIZE 50M REUSE
  30.     spfile
  31.     set
  32.     memory_max_target='2G'
  33.     set
  34.     memory_target='2G'
  35.     set
  36.     control_files='/u01/app/oracle/oradata/new11g/control01.ctl','/u01/app/oracle/oradata/new11g/control02.ctl','/u01/app/oracle/oradata/new11g/control03.ctl'
  37.     set
  38.     audit_file_dest='/u01/app/oracle/admin/new11g/adump'
  39.     set
  40.     db_create_file_dest=''
  41.     set
  42.     db_recovery_file_dest='/u01/app/oracle/flash_recovery_area';
  43.     }



复制代码

TARGETLESS 克隆:
源头库作备份:
  1.     run {
  2.     allocate channel  c1 device type disk format '/home/oracle/backup/%U';
  3.     allocate channel  c2 device type disk format '/home/oracle/backup/%U';
  4.     allocate channel  c3 device type disk format '/home/oracle/backup/%U';
  5.     allocate channel  c4 device type disk format '/home/oracle/backup/%U';
  6.     allocate channel  c5 device type disk format '/home/oracle/backup/%U';
  7.     allocate channel  c6 device type disk format '/home/oracle/backup/%U';
  8.     allocate channel  c7 device type disk format '/home/oracle/backup/%U';
  9.     allocate channel  c8 device type disk format '/home/oracle/backup/%U';
  10.     backup database plus archivelog force;
  11.     backup spfile;
  12.     backup current controlfile;
  13.     }
复制代码
rman auxiliary sys/oracle_4U@yourdb
  1.     run{
  2.     allocate  auxiliary channel c1 device type disk;
  3.     allocate  auxiliary channel c2 device type disk;
  4.     allocate  auxiliary channel c3 device type disk;
  5.     allocate  auxiliary channel c4 device type disk;
  6.     allocate  auxiliary channel c5 device type disk;
  7.     allocate  auxiliary channel c6 device type disk;
  8.     allocate  auxiliary channel c7 device type disk;
  9.     allocate  auxiliary channel c8 device type disk;
  10.     SET NEWNAME FOR DATABASE TO '/u01/app/oracle/oradata/yourdb/%b';
  11.     duplicate target database to yourdb
  12.     backup location '/home/oracle/backup'
  13.     nofilenamecheck
  14.     skip tablespace example
  15.     LOGFILE
  16.     GROUP 1 ('/u01/app/oracle/oradata/yourdb/redo01a.log',
  17.     '/u01/app/oracle/oradata/yourdb/redo01b.log') SIZE 50M REUSE,
  18.     GROUP 2 ('/u01/app/oracle/oradata/yourdb/redo02a.log',
  19.     '/u01/app/oracle/oradata/yourdb/redo02b.log') SIZE 50M REUSE,
  20.     GROUP 3 ('/u01/app/oracle/oradata/yourdb/redo03a.log',
  21.     '/u01/app/oracle/oradata/yourdb/redo03b.log') SIZE 50M REUSE
  22.     spfile
  23.     set
  24.     control_files='/u01/app/oracle/oradata/yourdb/control01.ctl','/u01/app/oracle/oradata/yourdb/control02.ctl','/u01/app/oracle/oradata/yourdb/control03.ctl'
  25.     set
  26.     audit_file_dest='/u01/app/oracle/admin/yourdb/adump'
  27.     set
  28.     db_create_file_dest=''
  29.     set
  30.     db_recovery_file_dest='/u01/app/oracle/flash_recovery_area';

  31.     }
复制代码
TSPITR:
  1. SQL> drop table TTESTBOTANG_5;

  2. Table dropped.

  3. SQL> alter database default tablespace example;

  4. Database altered.
复制代码
  1. RMAN> run {
  2. 2> sql "alter session set nls_date_format=''YYYY-MM-DD:HH24:MI:SS''";
  3. 3> recover tablespace users  until  time '2017-09-25:11:01:04'
  4. 4> auxiliary destination '/u01/app/oracle/oradata';
  5. 5> }

  6. sql statement: alter session set nls_date_format=''YYYY-MM-DD:HH24:MI:SS''

  7. Starting recover at 2017-09-25:11:23:34
  8. using channel ORA_DISK_1
  9. using channel ORA_DISK_2
  10. using channel ORA_DISK_3
  11. using channel ORA_DISK_4
  12. using channel ORA_DISK_5
  13. using channel ORA_DISK_6
  14. using channel ORA_DISK_7
  15. using channel ORA_DISK_8
  16. using channel ORA_SBT_TAPE_1
  17. using channel ORA_SBT_TAPE_2

  18. Creating automatic instance, with SID='eEeq'

  19. initialization parameters used for automatic instance:
  20. db_name=ORCL
  21. db_unique_name=eEeq_tspitr_ORCL
  22. compatible=11.2.0.0.0
  23. db_block_size=8192
  24. db_files=200
  25. sga_target=280M
  26. processes=50
  27. db_create_file_dest=/u01/app/oracle/oradata
  28. log_archive_dest_1='location=/u01/app/oracle/oradata'
  29. #No auxiliary parameter file used


  30. starting up automatic instance ORCL

  31. Oracle instance started

  32. Total System Global Area     292278272 bytes

  33. Fixed Size                     2212736 bytes
  34. Variable Size                100666496 bytes
  35. Database Buffers             184549376 bytes
  36. Redo Buffers                   4849664 bytes
  37. Automatic instance created
  38. Running TRANSPORT_SET_CHECK on recovery set tablespaces
  39. TRANSPORT_SET_CHECK completed successfully

  40. contents of Memory Script:
  41. {
  42. # set requested point in time
  43. set until  time "2017-09-25:11:01:04";
  44. # restore the controlfile
  45. restore clone controlfile;
  46. # mount the controlfile
  47. sql clone 'alter database mount clone database';
  48. # archive current online log
  49. sql 'alter system archive log current';
  50. # avoid unnecessary autobackups for structural changes during TSPITR
  51. sql 'begin dbms_backup_restore.AutoBackupFlag(FALSE); end;';
  52. # resync catalog
  53. resync catalog;
  54. }
  55. executing Memory Script

  56. executing command: SET until clause

  57. Starting restore at 2017-09-25:11:24:41
  58. allocated channel: ORA_AUX_DISK_1
  59. channel ORA_AUX_DISK_1: SID=81 device type=DISK
  60. allocated channel: ORA_AUX_DISK_2
  61. channel ORA_AUX_DISK_2: SID=5 device type=DISK
  62. allocated channel: ORA_AUX_DISK_3
  63. channel ORA_AUX_DISK_3: SID=30 device type=DISK
  64. allocated channel: ORA_AUX_DISK_4
  65. channel ORA_AUX_DISK_4: SID=56 device type=DISK
  66. allocated channel: ORA_AUX_DISK_5
  67. channel ORA_AUX_DISK_5: SID=82 device type=DISK
  68. allocated channel: ORA_AUX_DISK_6
  69. channel ORA_AUX_DISK_6: SID=6 device type=DISK
  70. allocated channel: ORA_AUX_DISK_7
  71. channel ORA_AUX_DISK_7: SID=31 device type=DISK
  72. allocated channel: ORA_AUX_DISK_8
  73. channel ORA_AUX_DISK_8: SID=57 device type=DISK
  74. allocated channel: ORA_AUX_SBT_TAPE_1
  75. channel ORA_AUX_SBT_TAPE_1: SID=83 device type=SBT_TAPE
  76. channel ORA_AUX_SBT_TAPE_1: Oracle Secure Backup
  77. allocated channel: ORA_AUX_SBT_TAPE_2
  78. channel ORA_AUX_SBT_TAPE_2: SID=7 device type=SBT_TAPE
  79. channel ORA_AUX_SBT_TAPE_2: Oracle Secure Backup

  80. channel ORA_AUX_SBT_TAPE_1: starting datafile backup set restore
  81. channel ORA_AUX_SBT_TAPE_1: restoring control file
  82. channel ORA_AUX_SBT_TAPE_1: reading from backup piece c-1343950367-20170518-00
  83. channel ORA_AUX_SBT_TAPE_1: piece handle=c-1343950367-20170518-00 tag=TAG20170518T164400
  84. channel ORA_AUX_SBT_TAPE_1: restored backup piece 1
  85. channel ORA_AUX_SBT_TAPE_1: restore complete, elapsed time: 00:00:25
  86. output file name=/u01/app/oracle/oradata/ORCL/controlfile/o1_mf_dwjxrcnh_.ctl
  87. Finished restore at 2017-09-25:11:25:09

  88. sql statement: alter database mount clone database

  89. sql statement: alter system archive log current

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

  91. starting full resync of recovery catalog
  92. full resync complete

  93. contents of Memory Script:
  94. {
  95. # set requested point in time
  96. set until  time "2017-09-25:11:01:04";
  97. # set destinations for recovery set and auxiliary set datafiles
  98. set newname for clone datafile  1 to new;
  99. set newname for clone datafile  3 to new;
  100. set newname for clone datafile  2 to new;
  101. set newname for clone tempfile  1 to new;
  102. set newname for datafile  4 to
  103. "+DATA/orcl/datafile/users.259.816169553";
  104. # switch all tempfiles
  105. switch clone tempfile all;
  106. # restore the tablespaces in the recovery set and the auxiliary set
  107. restore clone datafile  1, 3, 2, 4;
  108. switch clone datafile all;
  109. }
  110. executing Memory Script

  111. executing command: SET until clause

  112. executing command: SET NEWNAME

  113. executing command: SET NEWNAME

  114. executing command: SET NEWNAME

  115. executing command: SET NEWNAME

  116. executing command: SET NEWNAME

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

  118. Starting restore at 2017-09-25:11:25:16
  119. using channel ORA_AUX_DISK_1
  120. using channel ORA_AUX_DISK_2
  121. using channel ORA_AUX_DISK_3
  122. using channel ORA_AUX_DISK_4
  123. using channel ORA_AUX_DISK_5
  124. using channel ORA_AUX_DISK_6
  125. using channel ORA_AUX_DISK_7
  126. using channel ORA_AUX_DISK_8
  127. using channel ORA_AUX_SBT_TAPE_1
  128. using channel ORA_AUX_SBT_TAPE_2

  129. channel ORA_AUX_SBT_TAPE_1: starting datafile backup set restore
  130. channel ORA_AUX_SBT_TAPE_1: specifying datafile(s) to restore from backup set
  131. channel ORA_AUX_SBT_TAPE_1: restoring datafile 00003 to /u01/app/oracle/oradata/ORCL/datafile/o1_mf_undotbs1_%u_.dbf
  132. channel ORA_AUX_SBT_TAPE_1: restoring datafile 00002 to /u01/app/oracle/oradata/ORCL/datafile/o1_mf_sysaux_%u_.dbf
  133. channel ORA_AUX_SBT_TAPE_1: restoring datafile 00004 to +DATA/orcl/datafile/users.259.816169553
  134. channel ORA_AUX_SBT_TAPE_1: reading from backup piece 13s4ih4j_1_1
  135. channel ORA_AUX_SBT_TAPE_2: starting datafile backup set restore
  136. channel ORA_AUX_SBT_TAPE_2: specifying datafile(s) to restore from backup set
  137. channel ORA_AUX_SBT_TAPE_2: restoring datafile 00001 to /u01/app/oracle/oradata/ORCL/datafile/o1_mf_system_%u_.dbf
  138. channel ORA_AUX_SBT_TAPE_2: reading from backup piece 12s4ih4j_1_1
  139. channel ORA_AUX_SBT_TAPE_2: piece handle=12s4ih4j_1_1 tag=0T_INCR0_WHOLE
  140. channel ORA_AUX_SBT_TAPE_2: restored backup piece 1
  141. channel ORA_AUX_SBT_TAPE_2: restore complete, elapsed time: 00:00:25
  142. channel ORA_AUX_SBT_TAPE_1: piece handle=13s4ih4j_1_1 tag=0T_INCR0_WHOLE
  143. channel ORA_AUX_SBT_TAPE_1: restored backup piece 1
  144. channel ORA_AUX_SBT_TAPE_1: restore complete, elapsed time: 00:00:35
  145. Finished restore at 2017-09-25:11:25:55

  146. datafile 1 switched to datafile copy
  147. input datafile copy RECID=5 STAMP=955625155 file name=/u01/app/oracle/oradata/ORCL/datafile/o1_mf_system_dwjxsjvk_.dbf
  148. datafile 3 switched to datafile copy
  149. input datafile copy RECID=6 STAMP=955625155 file name=/u01/app/oracle/oradata/ORCL/datafile/o1_mf_undotbs1_dwjxslyk_.dbf
  150. datafile 2 switched to datafile copy
  151. input datafile copy RECID=7 STAMP=955625155 file name=/u01/app/oracle/oradata/ORCL/datafile/o1_mf_sysaux_dwjxslp9_.dbf

  152. contents of Memory Script:
  153. {
  154. # set requested point in time
  155. set until  time "2017-09-25:11:01:04";
  156. # online the datafiles restored or switched
  157. sql clone "alter database datafile  1 online";
  158. sql clone "alter database datafile  3 online";
  159. sql clone "alter database datafile  2 online";
  160. sql clone "alter database datafile  4 online";
  161. # recover and open resetlogs
  162. recover clone database tablespace  "USERS", "SYSTEM", "UNDOTBS1", "SYSAUX" delete archivelog;
  163. alter clone database open resetlogs;
  164. }
  165. executing Memory Script

  166. executing command: SET until clause

  167. sql statement: alter database datafile  1 online

  168. sql statement: alter database datafile  3 online

  169. sql statement: alter database datafile  2 online

  170. sql statement: alter database datafile  4 online

  171. Starting recover at 2017-09-25:11:25:55
  172. using channel ORA_AUX_DISK_1
  173. using channel ORA_AUX_DISK_2
  174. using channel ORA_AUX_DISK_3
  175. using channel ORA_AUX_DISK_4
  176. using channel ORA_AUX_DISK_5
  177. using channel ORA_AUX_DISK_6
  178. using channel ORA_AUX_DISK_7
  179. using channel ORA_AUX_DISK_8
  180. using channel ORA_AUX_SBT_TAPE_1
  181. using channel ORA_AUX_SBT_TAPE_2

  182. starting media recovery

  183. archived log for thread 1 with sequence 20 is already on disk as file +FRA/orcl/archivelog/2017_09_25/thread_1_seq_20.262.955623659
  184. archived log for thread 1 with sequence 21 is already on disk as file +FRA/orcl/archivelog/2017_09_25/thread_1_seq_21.261.955623659
  185. archived log for thread 1 with sequence 22 is already on disk as file +FRA/orcl/archivelog/2017_09_25/thread_1_seq_22.263.955623671
  186. channel ORA_AUX_SBT_TAPE_1: starting archived log restore to default destination
  187. channel ORA_AUX_SBT_TAPE_1: restoring archived log
  188. archived log thread=1 sequence=19
  189. channel ORA_AUX_SBT_TAPE_1: reading from backup piece 14s4ih5n_1_1
  190. channel ORA_AUX_SBT_TAPE_1: piece handle=14s4ih5n_1_1 tag=0T_INCR0_WHOLE
  191. channel ORA_AUX_SBT_TAPE_1: restored backup piece 1
  192. channel ORA_AUX_SBT_TAPE_1: restore complete, elapsed time: 00:00:25
  193. archived log file name=/u01/app/oracle/oradata/1_19_816169635.dbf thread=1 sequence=19
  194. channel clone_default: deleting archived log(s)
  195. archived log file name=/u01/app/oracle/oradata/1_19_816169635.dbf RECID=12 STAMP=955625173
  196. archived log file name=+FRA/orcl/archivelog/2017_09_25/thread_1_seq_20.262.955623659 thread=1 sequence=20
  197. archived log file name=+FRA/orcl/archivelog/2017_09_25/thread_1_seq_21.261.955623659 thread=1 sequence=21
  198. archived log file name=+FRA/orcl/archivelog/2017_09_25/thread_1_seq_22.263.955623671 thread=1 sequence=22
  199. media recovery complete, elapsed time: 00:00:05
  200. Finished recover at 2017-09-25:11:26:28

  201. database opened

  202. contents of Memory Script:
  203. {
  204. # make read only the tablespace that will be exported
  205. sql clone 'alter tablespace  USERS read only';
  206. # create directory for datapump import
  207. sql "create or replace directory TSPITR_DIROBJ_DPDIR as ''
  208. /u01/app/oracle/oradata''";
  209. # create directory for datapump export
  210. sql clone "create or replace directory TSPITR_DIROBJ_DPDIR as ''
  211. /u01/app/oracle/oradata''";
  212. }
  213. executing Memory Script

  214. sql statement: alter tablespace  USERS read only

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

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

  217. Performing export of metadata...
  218.    EXPDP> Starting "SYS"."TSPITR_EXP_eEeq":  
  219.    EXPDP> Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
  220.    EXPDP> Processing object type TRANSPORTABLE_EXPORT/TYPE/TYPE_SPEC
  221.    EXPDP> Processing object type TRANSPORTABLE_EXPORT/TYPE/TYPE_BODY
  222.    EXPDP> Processing object type TRANSPORTABLE_EXPORT/XMLSCHEMA/XMLSCHEMA
  223.    EXPDP> Processing object type TRANSPORTABLE_EXPORT/TABLE
  224.    EXPDP> Processing object type TRANSPORTABLE_EXPORT/INDEX
  225.    EXPDP> Processing object type TRANSPORTABLE_EXPORT/CONSTRAINT/CONSTRAINT
  226.    EXPDP> Processing object type TRANSPORTABLE_EXPORT/INDEX_STATISTICS
  227.    EXPDP> Processing object type TRANSPORTABLE_EXPORT/CONSTRAINT/REF_CONSTRAINT
  228.    EXPDP> Processing object type TRANSPORTABLE_EXPORT/TRIGGER
  229.    EXPDP> Processing object type TRANSPORTABLE_EXPORT/RLS_POLICY
  230.    EXPDP> Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
  231.    EXPDP> Master table "SYS"."TSPITR_EXP_eEeq" successfully loaded/unloaded
  232.    EXPDP> ******************************************************************************
  233.    EXPDP> Dump file set for SYS.TSPITR_EXP_eEeq is:
  234.    EXPDP>   /u01/app/oracle/oradata/tspitr_eEeq_35248.dmp
  235.    EXPDP> ******************************************************************************
  236.    EXPDP> Datafiles required for transportable tablespace USERS:
  237.    EXPDP>   +DATA/orcl/datafile/users.259.816169553
  238.    EXPDP> Job "SYS"."TSPITR_EXP_eEeq" successfully completed at 11:27:22
  239. Export completed


  240. contents of Memory Script:
  241. {
  242. # shutdown clone before import
  243. shutdown clone immediate
  244. # drop target tablespaces before importing them back
  245. sql 'drop tablespace  USERS including contents keep datafiles';
  246. }
  247. executing Memory Script

  248. database closed
  249. database dismounted
  250. Oracle instance shut down

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

  252. Performing import of metadata...
  253.    IMPDP> Master table "SYS"."TSPITR_IMP_eEeq" successfully loaded/unloaded
  254.    IMPDP> Starting "SYS"."TSPITR_IMP_eEeq":  
  255.    IMPDP> Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
  256.    IMPDP> Processing object type TRANSPORTABLE_EXPORT/TYPE/TYPE_SPEC

  257. Removing automatic instance
  258. Automatic instance removed
  259. auxiliary instance file /u01/app/oracle/oradata/ORCL/datafile/o1_mf_temp_dwjxv6jw_.tmp deleted
  260. auxiliary instance file /u01/app/oracle/oradata/ORCL/onlinelog/o1_mf_3_dwjxv5dz_.log deleted
  261. auxiliary instance file /u01/app/oracle/oradata/ORCL/onlinelog/o1_mf_2_dwjxv57n_.log deleted
  262. auxiliary instance file /u01/app/oracle/oradata/ORCL/onlinelog/o1_mf_1_dwjxv528_.log deleted
  263. auxiliary instance file /u01/app/oracle/oradata/ORCL/datafile/o1_mf_sysaux_dwjxslp9_.dbf deleted
  264. auxiliary instance file /u01/app/oracle/oradata/ORCL/datafile/o1_mf_undotbs1_dwjxslyk_.dbf deleted
  265. auxiliary instance file /u01/app/oracle/oradata/ORCL/datafile/o1_mf_system_dwjxsjvk_.dbf deleted
  266. auxiliary instance file /u01/app/oracle/oradata/ORCL/controlfile/o1_mf_dwjxrcnh_.ctl deleted
  267. RMAN-00571: ===========================================================
  268. RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
  269. RMAN-00571: ===========================================================
  270. RMAN-03002: failure of recover command at 09/25/2017 11:27:41
  271. RMAN-06963: Error received during import of metadata
  272. RMAN-06961:    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 exists

  273. RMAN>
复制代码


  1. ---------------------------------------------- LAB 5 ----------------------------------------------
  2.              5_基于时间的不完全恢复
  3. ---------------------------------------------- LAB 5 ----------------------------------------------


  4. ******************
  5. 你的主机信息如下:
  6. ******************


  7. station90.example.com

  8. Linux station90.example.com 2.6.32-696.el6.x86_64 #1 SMP Tue Feb 21 00:53:17 EST 2017 x86_64 x86_64 x86_64 GNU/Linux


  9. Name           Type           Target    State     Host        
  10. ------------------------------------------------------------
  11. ora.DATA.dg    ora....up.type ONLINE    ONLINE    station90   
  12. ora.FRA.dg     ora....up.type ONLINE    ONLINE    station90   
  13. ora....ER.lsnr ora....er.type ONLINE    ONLINE    station90   
  14. ora.asm        ora.asm.type   ONLINE    ONLINE    station90   
  15. ora.cssd       ora.cssd.type  ONLINE    ONLINE    station90   
  16. ora.diskmon    ora....on.type ONLINE    ONLINE    station90   
  17. ora.orcl.db    ora....se.type ONLINE    ONLINE    station90   

  18. SQL*Plus: Release 11.2.0.1.0 Production on Mon Sep 25 11:29:46 2017

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

  20. SQL> Connected.
  21. SQL> SQL> SQL>
  22. A
  23. --------------------
  24. Botang
  25. ****************************
  26. The database open mode here:
  27. ****************************

  28. D
  29. -
  30. X

  31. OPEN_MODE
  32. --------------------
  33. READ WRITE
  34. **********************************
  35. The database archivelog mode here:
  36. **********************************
  37. Database log mode               Archive Mode
  38. Automatic archival               Enabled
  39. Archive destination               USE_DB_RECOVERY_FILE_DEST
  40. Oldest online log sequence     29
  41. Next log sequence to archive   31
  42. Current log sequence               31
  43. ***************************
  44. The database datafile here:
  45. ***************************

  46. TABLESPACE_NAME                STATUS
  47. ------------------------------ ---------------
  48. SYSTEM                               ONLINE
  49. SYSAUX                               ONLINE
  50. UNDOTBS1                       ONLINE
  51. TEMP                               ONLINE
  52. USERS                               READ ONLY
  53. EXAMPLE                        ONLINE

  54. NAME                                                                  STATUS
  55. ----------------------------------------------------------------- ---------------
  56. +DATA/orcl/datafile/system.256.816169553                          SYSTEM
  57. +DATA/orcl/datafile/sysaux.257.816169553                          ONLINE
  58. +DATA/orcl/datafile/undotbs1.258.816169553                          ONLINE
  59. +DATA/orcl/datafile/users.259.816169553                           ONLINE
  60. +DATA/orcl/datafile/example.265.816169651                          ONLINE
  61. ******************************
  62. The database controlfile here:
  63. ******************************

  64. NAME
  65. -----------------------------------------------------------------
  66. +DATA/orcl/controlfile/current.260.816169631
  67. +FRA/orcl/controlfile/current.256.816169633
  68. **************************
  69. The database logfile here:
  70. **************************

  71. MEMBER
  72. --------------------------------------------------------------------------------
  73. +DATA/orcl/onlinelog/group_3.263.816169641
  74. +FRA/orcl/onlinelog/group_3.259.816169641
  75. +DATA/orcl/onlinelog/group_2.262.816169639
  76. +FRA/orcl/onlinelog/group_2.258.816169639
  77. +DATA/orcl/onlinelog/group_1.261.816169635
  78. +FRA/orcl/onlinelog/group_1.257.816169637
  79. **************************
  80. The database tempfile here:
  81. **************************

  82. NAME
  83. --------------------------------------------------------------------------------
  84. +DATA/orcl/tempfile/temp.264.816169645
  85. *****************
  86. The values found:
  87. *****************

  88.          A
  89. ----------
  90.          1
  91. SQL> Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
  92. With the Partitioning, Automatic Storage Management, OLAP, Data Mining
  93. and Real Application Testing options

  94. THE END
复制代码

回复

使用道具 举报

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

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-3-29 18:45 , Processed in 0.042457 second(s), 27 queries .

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