Bo's Oracle Station

查看: 1779|回复: 0

第23次活动:2017-10-11(星期三晚上7:00-9:30)

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2017-10-11 19:42:03 | 显示全部楼层 |阅读模式
ASM-FILE SYSTEM+SKIP TBS1
  1. select  name from v$datafile;

  2. select  member from v$logfile;

  3. begin
  4.    dbms_tts.transport_set_check('USERS');
  5. end;

  6. select  * from  transport_set_violations;

  7. select  tablespace_name from dba_Tablespaces;

  8. create tablespace tbs1 datafile size 10M ;

  9. create table hr.emp2 tablespace tbs1 as select  * from hr.employees;
复制代码
  1.     run{
  2. allocate channel c1 device type disk;
  3. allocate channel c2 device type disk;
  4. allocate channel c3 device type disk;
  5. allocate channel c4 device type disk;
  6. allocate channel c5 device type disk;
  7. allocate channel c6 device type disk;
  8. allocate channel c7 device type disk;
  9. allocate channel c8 device type disk;
  10. allocate auxiliary channel c9 device type disk;
  11. allocate auxiliary channel c10 device type disk;
  12. allocate auxiliary channel c11 device type disk;
  13. allocate auxiliary channel c12 device type disk;
  14. allocate auxiliary channel c13 device type disk;
  15. allocate auxiliary channel c14 device type disk;
  16. allocate auxiliary channel c15 device type disk;
  17. allocate auxiliary channel c16 device type disk;
  18.     duplicate target database to mydb
  19.     from active database
  20.     nofilenamecheck
  21.     skip tablespace tbs1
  22.     spfile
  23.     set
  24.     control_files='/u01/app/oracle/oradata/mydb/control01.ctl','/u01/app/oracle/oradata/mydb/control02.ctl','/u01/app/oracle/oradata/mydb/control03.ctl'
  25.     set
  26.     db_file_name_convert='+DATA/orcl/datafile/users.259.816169553','/u01/app/oracle/oradata/mydb/users01.dbf','+DATA/orcl/datafile/undotbs1.258.816169553','/u01/app/oracle/oradata/mydb/undotbs01.dbf','+DATA/orcl/datafile/sysaux.257.816169553','/u01/app/oracle/oradata/mydb/sysaux01.dbf','+DATA/orcl/datafile/system.256.816169553','/u01/app/oracle/oradata/mydb/system01.dbf','+DATA/orcl/datafile/example.265.816169651','/u01/app/oracle/oradata/mydb/example01.dbf'
  27.     set
  28.     log_file_name_convert='+DATA/orcl/onlinelog/group_1.261.816169635','/u01/app/oracle/oradata/mydb/redo01a.log','+FRA/orcl/onlinelog/group_1.257.816169637','/u01/app/oracle/oradata/mydb/redo01b.log','+DATA/orcl/onlinelog/group_3.263.816169641','/u01/app/oracle/oradata/mydb/redo03a.log','+FRA/orcl/onlinelog/group_3.259.816169641','/u01/app/oracle/oradata/mydb/redo03b.log','+DATA/orcl/onlinelog/group_2.262.816169639','/u01/app/oracle/oradata/mydb/redo02a.log','+FRA/orcl/onlinelog/group_2.258.816169639','/u01/app/oracle/oradata/mydb/redo02b.log'
  29.     set
  30.     audit_file_dest='/u01/app/oracle/admin/mydb/adump'
  31.     set
  32.     db_create_file_dest=''
  33.     set
  34.     db_recovery_file_dest='/u01/app/oracle/flash_recovery_area';
  35.     }
复制代码
BACKUP LOCATION备份端语法:
  1. --源头把备份优化关掉,或用force语法

  2. run {
  3. allocate channel  c1 device type disk format '/home/oracle/backup/%U';
  4. allocate channel  c2 device type disk format '/home/oracle/backup/%U';
  5. allocate channel  c3 device type disk format '/home/oracle/backup/%U';
  6. allocate channel  c4 device type disk format '/home/oracle/backup/%U';
  7. allocate channel  c5 device type disk format '/home/oracle/backup/%U';
  8. allocate channel  c6 device type disk format '/home/oracle/backup/%U';
  9. allocate channel  c7 device type disk format '/home/oracle/backup/%U';
  10. allocate channel  c8 device type disk format '/home/oracle/backup/%U';
  11. backup database plus archivelog force;
  12. backup spfile;
  13. backup current controlfile;
  14. }
复制代码
  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.     duplicate target database to new11g
  11.     backup location '/home/oracle/backup'
  12.     nofilenamecheck
  13.     skip tablespace tbs1
  14.     spfile
  15.     set
  16.     control_files='/u01/app/oracle/oradata/new11g/control01.ctl','/u01/app/oracle/oradata/new11g/control02.ctl','/u01/app/oracle/oradata/new11g/control03.ctl'
  17.     set
  18.     db_file_name_convert='+DATA/orcl/datafile/','/u01/app/oracle/oradata/new11g/'
  19.     set
  20.     log_file_name_convert='+DATA/orcl/onlinelog/','/u01/app/oracle/oradata/new11g/','+FRA/orcl/onlinelog/','/u01/app/oracle/oradata/new11g/'
  21.     set
  22.     audit_file_dest='/u01/app/oracle/admin/new11g/adump'
  23.     set
  24.     db_create_file_dest=''
  25.     set
  26.     db_recovery_file_dest='/u01/app/oracle/flash_recovery_area';
  27.     }
复制代码
用到“%b”语法:

  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.     }
复制代码
部分输出:
  1. 13>     nofilenamecheck
  2. 14>     skip tablespace example
  3. 15>     LOGFILE
  4. 16>     GROUP 1 ('/u01/app/oracle/oradata/yourdb/redo01a.log',
  5. 17>     '/u01/app/oracle/oradata/yourdb/redo01b.log') SIZE 50M REUSE,
  6. 18>     GROUP 2 ('/u01/app/oracle/oradata/yourdb/redo02a.log',
  7. 19>     '/u01/app/oracle/oradata/yourdb/redo02b.log') SIZE 50M REUSE,
  8. 20>     GROUP 3 ('/u01/app/oracle/oradata/yourdb/redo03a.log',
  9. 21>     '/u01/app/oracle/oradata/yourdb/redo03b.log') SIZE 50M REUSE
  10. 22>     spfile
  11. 23>     set
  12. 24>     control_files='/u01/app/oracle/oradata/yourdb/control01.ctl','/u01/app/oracle/oradata/yourdb/control02.ctl','/u01/app/oracle/oradata/yourdb/control03.ctl'
  13. 25>     set
  14. 26>     audit_file_dest='/u01/app/oracle/admin/yourdb/adump'
  15. 27>     set
  16. 28>     db_create_file_dest=''
  17. 29>     set
  18. 30>     db_recovery_file_dest='/u01/app/oracle/flash_recovery_area';
  19. 31>
  20. 32>     }
  21. 33>
  22. allocated channel: c1
  23. channel c1: SID=429 device type=DISK

  24. allocated channel: c2
  25. channel c2: SID=5 device type=DISK

  26. allocated channel: c3
  27. channel c3: SID=146 device type=DISK

  28. allocated channel: c4
  29. channel c4: SID=288 device type=DISK

  30. allocated channel: c5
  31. channel c5: SID=430 device type=DISK

  32. allocated channel: c6
  33. channel c6: SID=6 device type=DISK

  34. allocated channel: c7
  35. channel c7: SID=147 device type=DISK

  36. allocated channel: c8
  37. channel c8: SID=289 device type=DISK

  38. executing command: SET NEWNAME

  39. Starting Duplicate Db at 11-OCT-17

  40. contents of Memory Script:
  41. {
  42.    restore clone spfile to  '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfileyourdb.ora' from
  43. '/home/oracle/backup/2ksgp467_1_1';
  44.    sql clone "alter system set spfile= ''/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfileyourdb.ora''";
  45. }
  46. executing Memory Script

  47. Starting restore at 11-OCT-17

  48. channel c2: skipped, AUTOBACKUP already found
  49. channel c3: skipped, AUTOBACKUP already found
  50. channel c4: skipped, AUTOBACKUP already found
  51. channel c5: skipped, AUTOBACKUP already found
  52. channel c6: skipped, AUTOBACKUP already found
  53. channel c7: skipped, AUTOBACKUP already found
  54. channel c8: skipped, AUTOBACKUP already found
  55. channel c1: restoring spfile from AUTOBACKUP /home/oracle/backup/2ksgp467_1_1
  56. channel c1: SPFILE restore from AUTOBACKUP complete
  57. Finished restore at 11-OCT-17

  58. sql statement: alter system set spfile= ''/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfileyourdb.ora''

  59. contents of Memory Script:
  60. {
  61.    sql clone "alter system set  db_name =
  62. ''YOURDB'' comment=
  63. ''duplicate'' scope=spfile";
  64.    sql clone "alter system set  control_files =
  65. ''/u01/app/oracle/oradata/yourdb/control01.ctl'', ''/u01/app/oracle/oradata/yourdb/control02.ctl'', ''/u01/app/oracle/oradata/yourdb/control03.ctl'' comment=
  66. '''' scope=spfile";
  67.    sql clone "alter system set  audit_file_dest =
  68. ''/u01/app/oracle/admin/yourdb/adump'' comment=
  69. '''' scope=spfile";
  70.    sql clone "alter system set  db_create_file_dest =
  71. '''' comment=
  72. '''' scope=spfile";
  73.    sql clone "alter system set  db_recovery_file_dest =
  74. ''/u01/app/oracle/flash_recovery_area'' comment=
  75. '''' scope=spfile";
  76.    shutdown clone immediate;
  77.    startup clone nomount;
  78. }
  79. executing Memory Script

  80. sql statement: alter system set  db_name =  ''YOURDB'' comment= ''duplicate'' scope=spfile

  81. sql statement: alter system set  control_files =  ''/u01/app/oracle/oradata/yourdb/control01.ctl'', ''/u01/app/oracle/oradata/yourdb/control02.ctl'', ''/u01/app/oracle/oradata/yourdb/control03.ctl'' comment= '''' scope=spfile

  82. sql statement: alter system set  audit_file_dest =  ''/u01/app/oracle/admin/yourdb/adump'' comment= '''' scope=spfile

  83. sql statement: alter system set  db_create_file_dest =  '''' comment= '''' scope=spfile

  84. sql statement: alter system set  db_recovery_file_dest =  ''/u01/app/oracle/flash_recovery_area'' comment= '''' scope=spfile

  85. Oracle instance shut down

  86. connected to auxiliary database (not started)
  87. Oracle instance started

  88. Total System Global Area    1068937216 bytes

  89. Fixed Size                     2235208 bytes
  90. Variable Size                616563896 bytes
  91. Database Buffers             444596224 bytes
  92. Redo Buffers                   5541888 bytes
  93. allocated channel: c1
  94. channel c1: SID=63 device type=DISK
  95. allocated channel: c2
  96. channel c2: SID=129 device type=DISK
  97. allocated channel: c3
  98. channel c3: SID=192 device type=DISK
  99. allocated channel: c4
  100. channel c4: SID=6 device type=DISK
  101. allocated channel: c5
  102. channel c5: SID=67 device type=DISK
  103. allocated channel: c6
  104. channel c6: SID=130 device type=DISK
  105. allocated channel: c7
  106. channel c7: SID=193 device type=DISK
  107. allocated channel: c8
  108. channel c8: SID=7 device type=DISK

  109. contents of Memory Script:
  110. {
  111.    sql clone "alter system set  db_name =
  112. ''ORCL'' comment=
  113. ''Modified by RMAN duplicate'' scope=spfile";
  114.    sql clone "alter system set  db_unique_name =
  115. ''YOURDB'' comment=
  116. ''Modified by RMAN duplicate'' scope=spfile";
  117.    shutdown clone immediate;
  118.    startup clone force nomount
  119.    restore clone primary controlfile from  '/home/oracle/backup/2lsgp468_1_1';
  120.    alter clone database mount;
  121. }
  122. executing Memory Script

  123. sql statement: alter system set  db_name =  ''ORCL'' comment= ''Modified by RMAN duplicate'' scope=spfile

  124. sql statement: alter system set  db_unique_name =  ''YOURDB'' comment= ''Modified by RMAN duplicate'' scope=spfile

  125. Oracle instance shut down

  126. Oracle instance started

  127. Total System Global Area    1068937216 bytes

  128. Fixed Size                     2235208 bytes
  129. Variable Size                616563896 bytes
  130. Database Buffers             444596224 bytes
  131. Redo Buffers                   5541888 bytes
  132. allocated channel: c1
  133. channel c1: SID=63 device type=DISK
  134. allocated channel: c2
  135. channel c2: SID=129 device type=DISK
  136. allocated channel: c3
  137. channel c3: SID=192 device type=DISK
  138. allocated channel: c4
  139. channel c4: SID=6 device type=DISK
  140. allocated channel: c5
  141. channel c5: SID=67 device type=DISK
  142. allocated channel: c6
  143. channel c6: SID=130 device type=DISK
  144. allocated channel: c7
  145. channel c7: SID=193 device type=DISK
  146. allocated channel: c8
  147. channel c8: SID=7 device type=DISK

  148. Starting restore at 11-OCT-17

  149. channel c2: skipped, AUTOBACKUP already found
  150. channel c3: skipped, AUTOBACKUP already found
  151. channel c4: skipped, AUTOBACKUP already found
  152. channel c5: skipped, AUTOBACKUP already found
  153. channel c6: skipped, AUTOBACKUP already found
  154. channel c7: skipped, AUTOBACKUP already found
  155. channel c8: skipped, AUTOBACKUP already found
  156. channel c1: restoring control file
  157. channel c1: restore complete, elapsed time: 00:00:08
  158. output file name=/u01/app/oracle/oradata/yourdb/control01.ctl
  159. output file name=/u01/app/oracle/oradata/yourdb/control02.ctl
  160. output file name=/u01/app/oracle/oradata/yourdb/control03.ctl
  161. Finished restore at 11-OCT-17

  162. database mounted
  163. Not connected to TARGET or TARGET not open, cannot verify that subset of tablespaces is self-contained
  164. Not connected to TARGET, cannot verify that set of tablespaces being duplicated does not have SYS objects
  165. Datafile 5 skipped by request

  166. contents of Memory Script:
  167. {
  168.    set until scn  2145082;
  169.    set newname for datafile  1 to
  170. "/u01/app/oracle/oradata/yourdb/system.256.816169553";
  171.    set newname for datafile  2 to
  172. "/u01/app/oracle/oradata/yourdb/sysaux.257.816169553";
  173.    set newname for datafile  3 to
  174. "/u01/app/oracle/oradata/yourdb/undotbs1.258.816169553";
  175.    set newname for datafile  4 to
  176. "/u01/app/oracle/oradata/yourdb/users.259.816169553";
  177.    set newname for datafile  6 to
  178. "/u01/app/oracle/oradata/yourdb/tbs1.267.957123085";
  179.    restore
  180.    clone database
  181.    skip forever tablespace  "EXAMPLE"   ;
  182. }
  183. executing Memory Script

  184. executing command: SET until clause

  185. executing command: SET NEWNAME

  186. executing command: SET NEWNAME

  187. executing command: SET NEWNAME

  188. executing command: SET NEWNAME

  189. executing command: SET NEWNAME

  190. Starting restore at 11-OCT-17

  191. channel c1: starting datafile backup set restore
  192. channel c1: specifying datafile(s) to restore from backup set
  193. channel c1: restoring datafile 00002 to /u01/app/oracle/oradata/yourdb/sysaux.257.816169553
  194. channel c1: reading from backup piece /home/oracle/backup/2fsgp45t_1_1
  195. channel c2: starting datafile backup set restore
  196. channel c2: specifying datafile(s) to restore from backup set
  197. channel c2: restoring datafile 00003 to /u01/app/oracle/oradata/yourdb/undotbs1.258.816169553
  198. channel c2: reading from backup piece /home/oracle/backup/2esgp45t_1_1
  199. channel c3: starting datafile backup set restore
  200. channel c3: specifying datafile(s) to restore from backup set
  201. channel c3: restoring datafile 00004 to /u01/app/oracle/oradata/yourdb/users.259.816169553
  202. channel c3: reading from backup piece /home/oracle/backup/2isgp45v_1_1
  203. channel c4: starting datafile backup set restore
  204. channel c4: specifying datafile(s) to restore from backup set
  205. channel c4: restoring datafile 00006 to /u01/app/oracle/oradata/yourdb/tbs1.267.957123085
  206. channel c4: reading from backup piece /home/oracle/backup/2hsgp45u_1_1
  207. channel c5: starting datafile backup set restore
  208. channel c5: specifying datafile(s) to restore from backup set
  209. channel c5: restoring datafile 00001 to /u01/app/oracle/oradata/yourdb/system.256.816169553
  210. channel c5: reading from backup piece /home/oracle/backup/2dsgp45t_1_1
  211. channel c3: piece handle=/home/oracle/backup/2isgp45v_1_1 tag=TAG20171011T195957
  212. channel c3: restored backup piece 1
  213. channel c3: restore complete, elapsed time: 00:00:01
  214. channel c4: piece handle=/home/oracle/backup/2hsgp45u_1_1 tag=TAG20171011T195957
  215. channel c4: restored backup piece 1
  216. channel c4: restore complete, elapsed time: 00:00:01
  217. channel c1: piece handle=/home/oracle/backup/2fsgp45t_1_1 tag=TAG20171011T195957
  218. channel c1: restored backup piece 1
  219. channel c1: restore complete, elapsed time: 00:00:07
  220. channel c2: piece handle=/home/oracle/backup/2esgp45t_1_1 tag=TAG20171011T195957
  221. channel c2: restored backup piece 1
  222. channel c2: restore complete, elapsed time: 00:00:15
  223. channel c5: piece handle=/home/oracle/backup/2dsgp45t_1_1 tag=TAG20171011T195957
  224. channel c5: restored backup piece 1
  225. channel c5: restore complete, elapsed time: 00:00:15
  226. Finished restore at 11-OCT-17

  227. contents of Memory Script:
  228. {
  229.    switch clone datafile all;
  230. }
  231. executing Memory Script

  232. datafile 1 switched to datafile copy
  233. input datafile copy RECID=6 STAMP=957127094 file name=/u01/app/oracle/oradata/yourdb/system.256.816169553
  234. datafile 2 switched to datafile copy
  235. input datafile copy RECID=7 STAMP=957127095 file name=/u01/app/oracle/oradata/yourdb/sysaux.257.816169553
  236. datafile 3 switched to datafile copy
  237. input datafile copy RECID=8 STAMP=957127095 file name=/u01/app/oracle/oradata/yourdb/undotbs1.258.816169553
  238. datafile 4 switched to datafile copy
  239. input datafile copy RECID=9 STAMP=957127095 file name=/u01/app/oracle/oradata/yourdb/users.259.816169553
  240. datafile 6 switched to datafile copy
  241. input datafile copy RECID=10 STAMP=957127096 file name=/u01/app/oracle/oradata/yourdb/tbs1.267.957123085

  242. contents of Memory Script:
  243. {
  244.    set until scn  2145082;
  245.    recover
  246.    clone database
  247.    skip forever tablespace  "EXAMPLE"    delete archivelog
  248.    ;
  249. }
  250. executing Memory Script

  251. executing command: SET until clause

  252. Starting recover at 11-OCT-17

  253. Executing: alter database datafile 5 offline drop
  254. starting media recovery

  255. channel c1: starting archived log restore to default destination
  256. channel c1: restoring archived log
  257. archived log thread=1 sequence=117
  258. channel c1: reading from backup piece /home/oracle/backup/2jsgp465_1_1
  259. channel c1: piece handle=/home/oracle/backup/2jsgp465_1_1 tag=TAG20171011T200005
  260. channel c1: restored backup piece 1
  261. channel c1: restore complete, elapsed time: 00:00:01
  262. archived log file name=/u01/app/oracle/flash_recovery_area/YOURDB/archivelog/2017_10_11/o1_mf_1_117_dxw45t7b_.arc thread=1 sequence=117
  263. channel clone_default: deleting archived log(s)
  264. archived log file name=/u01/app/oracle/flash_recovery_area/YOURDB/archivelog/2017_10_11/o1_mf_1_117_dxw45t7b_.arc RECID=1 STAMP=957127098
  265. media recovery complete, elapsed time: 00:00:00
  266. Finished recover at 11-OCT-17
  267. Oracle instance started

  268. Total System Global Area    1068937216 bytes

  269. Fixed Size                     2235208 bytes
  270. Variable Size                620758200 bytes
  271. Database Buffers             440401920 bytes
  272. Redo Buffers                   5541888 bytes

  273. contents of Memory Script:
  274. {
  275.    sql clone "alter system set  db_name =
  276. ''YOURDB'' comment=
  277. ''Reset to original value by RMAN'' scope=spfile";
  278.    sql clone "alter system reset  db_unique_name scope=spfile";
  279.    shutdown clone immediate;
  280.    startup clone nomount;
  281. }
  282. executing Memory Script

  283. sql statement: alter system set  db_name =  ''YOURDB'' comment= ''Reset to original value by RMAN'' scope=spfile

  284. sql statement: alter system reset  db_unique_name scope=spfile

  285. Oracle instance shut down

  286. connected to auxiliary database (not started)
  287. Oracle instance started

  288. Total System Global Area    1068937216 bytes

  289. Fixed Size                     2235208 bytes
  290. Variable Size                620758200 bytes
  291. Database Buffers             440401920 bytes
  292. Redo Buffers                   5541888 bytes
  293. allocated channel: c1
  294. channel c1: SID=63 device type=DISK
  295. allocated channel: c2
  296. channel c2: SID=129 device type=DISK
  297. allocated channel: c3
  298. channel c3: SID=192 device type=DISK
  299. allocated channel: c4
  300. channel c4: SID=6 device type=DISK
  301. allocated channel: c5
  302. channel c5: SID=67 device type=DISK
  303. allocated channel: c6
  304. channel c6: SID=130 device type=DISK
  305. allocated channel: c7
  306. channel c7: SID=193 device type=DISK
  307. allocated channel: c8
  308. channel c8: SID=7 device type=DISK
  309. sql statement: CREATE CONTROLFILE REUSE SET DATABASE "YOURDB" RESETLOGS ARCHIVELOG
  310.   MAXLOGFILES     16
  311.   MAXLOGMEMBERS      3
  312.   MAXDATAFILES      100
  313.   MAXINSTANCES     8
  314.   MAXLOGHISTORY      292
  315. LOGFILE
  316.   GROUP   1 ( '/u01/app/oracle/oradata/yourdb/redo01a.log', '/u01/app/oracle/oradata/yourdb/redo01b.log' ) SIZE 50 M  REUSE,
  317.   GROUP   2 ( '/u01/app/oracle/oradata/yourdb/redo02a.log', '/u01/app/oracle/oradata/yourdb/redo02b.log' ) SIZE 50 M  REUSE,
  318.   GROUP   3 ( '/u01/app/oracle/oradata/yourdb/redo03a.log', '/u01/app/oracle/oradata/yourdb/redo03b.log' ) SIZE 50 M  REUSE
  319. DATAFILE
  320.   '/u01/app/oracle/oradata/yourdb/system.256.816169553'
  321. CHARACTER SET AL32UTF8


  322. contents of Memory Script:
  323. {
  324.    set newname for tempfile  1 to
  325. "/u01/app/oracle/oradata/yourdb/temp.264.816169645";
  326.    switch clone tempfile all;
  327.    catalog clone datafilecopy  "/u01/app/oracle/oradata/yourdb/sysaux.257.816169553",
  328. "/u01/app/oracle/oradata/yourdb/undotbs1.258.816169553",
  329. "/u01/app/oracle/oradata/yourdb/users.259.816169553",
  330. "/u01/app/oracle/oradata/yourdb/tbs1.267.957123085";
  331.    switch clone datafile all;
  332. }
  333. executing Memory Script

  334. executing command: SET NEWNAME

  335. renamed tempfile 1 to /u01/app/oracle/oradata/yourdb/temp.264.816169645 in control file

  336. cataloged datafile copy
  337. datafile copy file name=/u01/app/oracle/oradata/yourdb/sysaux.257.816169553 RECID=1 STAMP=957127125
  338. cataloged datafile copy
  339. datafile copy file name=/u01/app/oracle/oradata/yourdb/undotbs1.258.816169553 RECID=2 STAMP=957127125
  340. cataloged datafile copy
  341. datafile copy file name=/u01/app/oracle/oradata/yourdb/users.259.816169553 RECID=3 STAMP=957127126
  342. cataloged datafile copy
  343. datafile copy file name=/u01/app/oracle/oradata/yourdb/tbs1.267.957123085 RECID=4 STAMP=957127126

  344. datafile 2 switched to datafile copy
  345. input datafile copy RECID=1 STAMP=957127125 file name=/u01/app/oracle/oradata/yourdb/sysaux.257.816169553
  346. datafile 3 switched to datafile copy
  347. input datafile copy RECID=2 STAMP=957127125 file name=/u01/app/oracle/oradata/yourdb/undotbs1.258.816169553
  348. datafile 4 switched to datafile copy
  349. input datafile copy RECID=3 STAMP=957127126 file name=/u01/app/oracle/oradata/yourdb/users.259.816169553
  350. datafile 6 switched to datafile copy
  351. input datafile copy RECID=4 STAMP=957127126 file name=/u01/app/oracle/oradata/yourdb/tbs1.267.957123085
  352. Reenabling controlfile options for auxiliary database
  353. Executing: alter database enable block change tracking using file '+FRA/orcl/changetracking/ctf.260.829329115'
  354. ORACLE error from auxiliary database: ORA-19751: could not create the change tracking file
  355. ORA-19750: change tracking file: '+FRA/orcl/changetracking/ctf.260.829329115'
  356. ORA-17502: ksfdcre:4 Failed to create file +FRA/orcl/changetracking/ctf.260.829329115
  357. ORA-15046: ASM file name '+FRA/orcl/changetracking/ctf.260.829329115' is not in single-file creation form

  358. Ignoring error, reattempt command after duplicate finishes

  359. contents of Memory Script:
  360. {
  361.    Alter clone database open resetlogs;
  362. }
  363. executing Memory Script

  364. database opened
  365. Dropping offline and skipped tablespaces
  366. Executing: drop tablespace "EXAMPLE" including contents cascade constraints
  367. released channel: c1
  368. released channel: c2
  369. released channel: c3
  370. released channel: c4
  371. released channel: c5
  372. released channel: c6
  373. released channel: c7
  374. released channel: c8
  375. RMAN-00571: ===========================================================
  376. RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
  377. RMAN-00571: ===========================================================
  378. RMAN-03002: failure of Duplicate Db command at 10/11/2017 20:38:56
  379. RMAN-05501: aborting duplication of target database
  380. RMAN-06136: ORACLE error from auxiliary database: ORA-29857: domain indexes and/or secondary objects exist in the tablespace

  381. Recovery Manager complete.
  382. [oracle@station30 ~]$ sqlplus /nolog

  383. SQL*Plus: Release 11.2.0.3.0 Production on Wed Oct 11 20:39:15 2017

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

  385. SQL> conn / as sysdba
  386. Connected.
  387. SQL> select  open_mode from v$database;

  388. OPEN_MODE
  389. --------------------
  390. READ WRITE

  391. SQL> select  tablespace_name from dba_tablespaces;

  392. TABLESPACE_NAME
  393. ------------------------------
  394. SYSTEM
  395. SYSAUX
  396. UNDOTBS1
  397. TEMP
  398. USERS
  399. EXAMPLE
  400. TBS1

  401. 7 rows selected.

  402. SQL>
复制代码
RMAN调优:
  1. SELECT s.sid, p.spid, s.client_info
  2.   FROM v$process p, v$session s
  3.    WHERE p.addr = s.paddr
  4.    AND CLIENT_INFO LIKE '%id=botang%';


  5. ----
  6. SELECT s.sid, p.spid, s.client_info
  7.   FROM v$process p, v$session s
  8.    WHERE p.addr = s.paddr
  9.     and program like '%rman%';
  10.    
  11. ---

  12. select * from v$backup_sync_io;

  13. select  * from v$backup_async_io ;

  14. -----

  15. SELECT OPNAME, CONTEXT, SOFAR, TOTALWORK,
  16.     ROUND(SOFAR/TOTALWORK*100,2) "%_COMPLETE"
  17.    FROM V$SESSION_LONGOPS
  18.    WHERE OPNAME LIKE 'RMAN%'
  19.    AND TOTALWORK != 0
  20.   AND SOFAR <> TOTALWORK;


  21.    
复制代码
  1. RMAN> run {
  2. 2> set command id to 'botang';
  3. 3> allocate channel c1 device type sbt;
  4. 4> allocate channel c2 device type sbt;
  5. 5> backup   tag 'MY4'  duration  00:06 minimize load     (datafile 1 channel c1 ) ( datafile 2,3,4,5,6 channel c2 )   ;
  6. 6> }

  7. executing command: SET COMMAND ID

  8. allocated channel: c1
  9. channel c1: SID=200 device type=SBT_TAPE
  10. channel c1: Oracle Secure Backup

  11. allocated channel: c2
  12. channel c2: SID=16 device type=SBT_TAPE
  13. channel c2: Oracle Secure Backup

  14. Starting backup at 11-OCT-17
  15. channel c1: starting full datafile backup set
  16. channel c1: specifying datafile(s) in backup set
  17. input datafile file number=00001 name=+DATA/orcl/datafile/system.256.816169553
  18. channel c1: starting piece 1 at 11-OCT-17
  19. channel c2: starting full datafile backup set
  20. channel c2: specifying datafile(s) in backup set
  21. input datafile file number=00003 name=+DATA/orcl/datafile/undotbs1.258.816169553
  22. input datafile file number=00002 name=+DATA/orcl/datafile/sysaux.257.816169553
  23. input datafile file number=00005 name=+DATA/orcl/datafile/example.265.816169651
  24. input datafile file number=00006 name=+DATA/orcl/datafile/tbs1.267.957123085
  25. input datafile file number=00004 name=+DATA/orcl/datafile/users.259.816169553
  26. channel c2: starting piece 1 at 11-OCT-17

复制代码

Screenshot.png


回复

使用道具 举报

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

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-4-19 15:37 , Processed in 0.046777 second(s), 27 queries .

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