Bo's Oracle Station

查看: 1270|回复: 0

克隆数据库

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2019-12-28 11:17:40 | 显示全部楼层 |阅读模式
  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. allocate   channel a1 device type disk;
  11. allocate   channel a2 device type disk;
  12. allocate   channel a3 device type disk;
  13. allocate   channel a4 device type disk;
  14. allocate   channel a5 device type disk;
  15. allocate   channel a6 device type disk;
  16. allocate   channel a7 device type disk;
  17. allocate   channel a8 device type disk;

  18. duplicate target database to clone1
  19. from active database
  20. nofilenamecheck
  21. skip tablespace tbstrans2
  22. spfile
  23. set
  24. memory_target='700M'
  25. set
  26. control_files='+DATA','+FRA'
  27. set
  28. db_file_name_convert='+DATA/orcl','+DATA/clone1'
  29. set
  30. log_file_name_convert='+DATA/orcl','+DATA/clone1','+FRA/orcl','+FRA/clone1'
  31. set
  32. audit_file_dest='/u01/app/oracle/admin/clone1/adump';
  33. }
复制代码
  1. [oracle@station76 admin]$ pwd
  2. /u01/app/oracle/product/11.2.0/dbhome_1/network/admin
  3. [oracle@station76 admin]$ cd ..
  4. [oracle@station76 network]$ ls
  5. admin  doc  install  jlib  lib  log  mesg  tools  trace
  6. [oracle@station76 network]$ cd ..
  7. [oracle@station76 dbhome_1]$ ls
  8. apex         crs        demo         install        jlib     nls         oraInst.loc  racg          sqlplus                     usm
  9. assistants   csmig      diagnostics  instantclient  ldap     oc4j        ord          rdbms         srvm                        utl
  10. bin          css        dv           inventory      lib      odbc        oui          relnotes      station76.example.com_orcl  wwg
  11. ccr          ctx        emcli        j2ee           log      olap        owb          root.sh       suptools                    xdk
  12. cdata        cv         EMStage      javavm         md       OPatch      owm          scheduler     sysman
  13. cfgtoollogs  dbs        has          jdbc           mesg     OPatch.ori  perl         slax          timingframework
  14. clone        dc_ocm     hs           jdev           mgw      opmn        plsql        sqldeveloper  ucp
  15. config       deinstall  ide          jdk            network  oracore     precomp      sqlj          uix
  16. [oracle@station76 dbhome_1]$ cd dbs
  17. [oracle@station76 dbs]$ ls
  18. hc_apple.dat   hc_mydb2.dat  hc_rcat.dat  initorcl.ora  lkMYDB2  lkRCAT     orapworcl  snapcf_orcl.f  spfilercat.ora
  19. hc_dbtest.dat  hc_orcl.dat   init.ora     lkinstdbtest  lkORCL   lkWINORCL  orapwrcat  snapcf_rcat.f
  20. [oracle@station76 dbs]$ vim initclone1.ora
  21. db_name=clone1
  22. db_domain=example.com
  23. ~
  24. ~
  25. ~
  26. ~
  27. ~
  28. ~
  29. ~
  30. ~
  31. ~
  32. ~
  33. ~
  34. ~
  35. ~
  36. ~
  37. ~
  38. ~
  39. ~
  40. ~
  41. ~
  42. ~
  43. ~
  44. ~
  45. ~
  46. ~
  47. ~
  48. ~
  49. ~
  50. ~
  51. ~
  52. ~
  53. ~
  54. ~
  55. ~
  56. ~
  57. "initclone1.ora" [New] 2L, 37C written                                                                             
  58. [oracle@station76 dbs]$ vim initclone2.ora
  59. db_name=clone2
  60. db_domain=example.com
  61. ~
  62. ~
  63. ~
  64. ~
  65. ~
  66. ~
  67. ~
  68. ~
  69. ~
  70. ~
  71. ~
  72. ~
  73. ~
  74. ~
  75. ~
  76. ~
  77. ~
  78. ~
  79. ~
  80. ~
  81. ~
  82. ~
  83. ~
  84. ~
  85. ~
  86. ~
  87. ~
  88. ~
  89. ~
  90. ~
  91. ~
  92. ~
  93. ~
  94. ~
  95. "initclone2.ora" [New] 2L, 37C written                                                                             
  96. [oracle@station76 dbs]$ orapwd file=orapwclone1  password=oracle_4U  
  97. [oracle@station76 dbs]$ orapwd file=orapwclone2  password=oracle_4U  
  98. [oracle@station76 dbs]$ cd /u01/app/
  99. [oracle@station76 app]$ ls
  100. oracle  oraInventory
  101. [oracle@station76 app]$ cd oracle
  102. [oracle@station76 oracle]$ ls
  103. admin        cfgtoollogs  Clusterware  dirlin              flash_recovery_area  product    wallet
  104. botangdir01  checkpoints  diag         fast_recovery_area  oradata              station76
  105. [oracle@station76 oracle]$ cd admin/
  106. [oracle@station76 admin]$ ls
  107. +ASM  clone1  dbtest  mydb2  orcl  rcat
  108. [oracle@station76 admin]$ cd clone1/
  109. [oracle@station76 clone1]$ ls
  110. adump
  111. [oracle@station76 clone1]$ cd ..
  112. [oracle@station76 admin]$ ls
  113. +ASM  clone1  dbtest  mydb2  orcl  rcat
  114. [oracle@station76 admin]$ mkdir -p  clone2/adump
  115. [oracle@station76 admin]$ exit
  116. logout
  117. [root@station76 ~]# vim /etc/oratab
  118. #Backup file is  /u01/app/oracle/product/11.2.0/grid/srvm/admin/oratab.bak.station76 line added by Agent
  119. #



  120. # This file is used by ORACLE utilities.  It is created by root.sh
  121. # and updated by either Database Configuration Assistant while creating
  122. # a database or ASM Configuration Assistant while creating ASM instance.

  123. # A colon, ':', is used as the field terminator.  A new line terminates
  124. # the entry.  Lines beginning with a pound sign, '#', are comments.
  125. #
  126. # Entries are of the form:
  127. #   $ORACLE_SID:$ORACLE_HOME:<N|Y>:
  128. #
  129. # The first and second fields are the system identifier and home
  130. # directory of the database respectively.  The third filed indicates
  131. # to the dbstart utility that the database should , "Y", or should not,
  132. # "N", be brought up at system boot time.
  133. #
  134. # Multiple entries with the same $ORACLE_SID are not allowed.
  135. #
  136. #
  137. +ASM:/u01/app/oracle/product/11.2.0/grid:N
  138. rcat:/u01/app/oracle/product/11.2.0/dbhome_1:N          # line added by Agent
  139. orcl:/u01/app/oracle/product/11.2.0/dbhome_1:N          # line added by Agent
  140. clone1:/u01/app/oracle/product/11.2.0/dbhome_1:N                # line added by Agent
  141. clone2:/u01/app/oracle/product/11.2.0/dbhome_1:N                # line added by Agent
  142. ~
  143. ~
  144. ~
  145. ~
  146. ~
  147. ~
  148. ~
  149. ~
  150. "/etc/oratab" 28L, 1173C written                                                                                   
  151. [root@station76 ~]# su - oracle
  152. [oracle@station76 ~]$ . oraenv
  153. ORACLE_SID = [orcl] ? clone1
  154. The Oracle base remains unchanged with value /u01/app/oracle
  155. [oracle@station76 ~]$ sqlplus /nolog

  156. SQL*Plus: Release 11.2.0.4.0 Production on Thu Dec 26 04:15:30 2019

  157. Copyright (c) 1982, 2013, Oracle.  All rights reserved.

  158. SQL> conn / as sysdba
  159. Connected to an idle instance.
  160. SQL> startup
  161. ORACLE instance started.

  162. Total System Global Area  263090176 bytes
  163. Fixed Size                  2252256 bytes
  164. Variable Size             205521440 bytes
  165. Database Buffers           50331648 bytes
  166. Redo Buffers                4984832 bytes
  167. ORA-00205: error in identifying control file, check alert log for more info


  168. SQL> exit
  169. Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
  170. With the Partitioning, OLAP, Data Mining and Real Application Testing options
  171. [oracle@station76 ~]$ rman target sys/oracle_4U@orcl  auxiliary sys/oracle_4U@clone1

  172. Recovery Manager: Release 11.2.0.4.0 - Production on Thu Dec 26 04:16:20 2019

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

  174. connected to target database: ORCL (DBID=1554722616)
  175. connected to auxiliary database: CLONE1 (not mounted)

  176. RMAN>
复制代码

用备份冷克隆:
先备份:
  1. run {
  2. allocate channel  c1 device type disk format '/home/oracle/clone1/%U';
  3. allocate channel  c2 device type disk format '/home/oracle/clone1/%U';
  4. allocate channel  c3 device type disk format '/home/oracle/clone1/%U';
  5. allocate channel  c4 device type disk format '/home/oracle/clone1/%U';
  6. allocate channel  c5 device type disk format '/home/oracle/clone1/%U';
  7. allocate channel  c6 device type disk format '/home/oracle/clone1/%U';
  8. allocate channel  c7 device type disk format '/home/oracle/clone1/%U';
  9. allocate channel  c8 device type disk format '/home/oracle/clone1/%U';
  10. backup database plus archivelog force;
  11. backup spfile force;
  12. backup current controlfile force;
  13. }
复制代码
  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 database to clone2
  11. backup location '/home/oracle/clone1'
  12. nofilenamecheck
  13. skip tablespace tbstrans2
  14. db_file_name_convert '+DATA/orcl','+DATA/clone2'
  15. logfile
  16. group 1 ('+DATA','+FRA') size 50M,
  17. group 2 ('+DATA','+FRA') size 50M,
  18. group 3 ('+DATA','+FRA') size 50M
  19. spfile
  20. parameter_value_convert '+DATA/orcl','+DATA/clone2','+FRA/orcl','+FRA/clone2','/u01/app/oracle/admin/orcl/adump','/u01/app/oracle/admin/clone2/adump'
  21. set
  22. control_files='+DATA','+FRA'
  23. set
  24. memory_target='700M';
  25. }
复制代码
  1. [oracle@station76 ~]$ rman auxiliary sys/oracle_4U@clone2 cmdfile=/home/oracle/clone2.rcv

  2. Recovery Manager: Release 11.2.0.4.0 - Production on Thu Dec 26 10:10:27 2019

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

  4. connected to auxiliary database: CLONE2 (not mounted)

  5. RMAN> run {
  6. 2> allocate  auxiliary channel c1 device type disk;
  7. 3> allocate  auxiliary channel c2 device type disk;
  8. 4> allocate  auxiliary channel c3 device type disk;
  9. 5> allocate  auxiliary channel c4 device type disk;
  10. 6> allocate  auxiliary channel c5 device type disk;
  11. 7> allocate  auxiliary channel c6 device type disk;
  12. 8> allocate  auxiliary channel c7 device type disk;
  13. 9> allocate  auxiliary channel c8 device type disk;
  14. 10> duplicate database to clone2
  15. 11> backup location '/home/oracle/clone1'
  16. 12> nofilenamecheck  
  17. 13> skip tablespace tbstrans2
  18. 14> db_file_name_convert '+DATA/orcl','+DATA/clone2'
  19. 15> logfile
  20. 16> group 1 ('+DATA','+FRA') size 50M,
  21. 17> group 2 ('+DATA','+FRA') size 50M,
  22. 18> group 3 ('+DATA','+FRA') size 50M
  23. 19> spfile
  24. 20> parameter_value_convert '+DATA/orcl','+DATA/clone2','+FRA/orcl','+FRA/clone2','/u01/app/oracle/admin/orcl/adump','/u01/app/oracle/admin/clone2/adump'
  25. 21> set
  26. 22> control_files='+DATA','+FRA'
  27. 23> set  
  28. 24> memory_target='700M';
  29. 25> }
  30. 26>
  31. allocated channel: c1
  32. channel c1: SID=429 device type=DISK

  33. allocated channel: c2
  34. channel c2: SID=5 device type=DISK

  35. allocated channel: c3
  36. channel c3: SID=146 device type=DISK

  37. allocated channel: c4
  38. channel c4: SID=288 device type=DISK

  39. allocated channel: c5
  40. channel c5: SID=430 device type=DISK

  41. allocated channel: c6
  42. channel c6: SID=6 device type=DISK

  43. allocated channel: c7
  44. channel c7: SID=147 device type=DISK

  45. allocated channel: c8
  46. channel c8: SID=289 device type=DISK

  47. Starting Duplicate Db at 2019-12-26:10:10:50

  48. contents of Memory Script:
  49. {
  50.    restore clone spfile to  '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfileclone2.ora' from
  51. '/home/oracle/clone1/4iukc5nj_1_1';
  52.    sql clone "alter system set spfile= ''/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfileclone2.ora''";
  53. }
  54. executing Memory Script

  55. Starting restore at 2019-12-26:10:10:51

  56. channel c2: skipped, AUTOBACKUP already found
  57. channel c3: skipped, AUTOBACKUP already found
  58. channel c4: skipped, AUTOBACKUP already found
  59. channel c5: skipped, AUTOBACKUP already found
  60. channel c6: skipped, AUTOBACKUP already found
  61. channel c7: skipped, AUTOBACKUP already found
  62. channel c8: skipped, AUTOBACKUP already found
  63. channel c1: restoring spfile from AUTOBACKUP /home/oracle/clone1/4iukc5nj_1_1
  64. channel c1: SPFILE restore from AUTOBACKUP complete
  65. Finished restore at 2019-12-26:10:11:03

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

  67. contents of Memory Script:
  68. {
  69.    sql clone "alter system set  db_name =
  70. ''CLONE2'' comment=
  71. ''duplicate'' scope=spfile";
  72.    sql clone "alter system set  control_files =
  73. ''+DATA'', ''+FRA'' comment=
  74. '''' scope=spfile";
  75.    sql clone "alter system set  memory_target =
  76. 700M comment=
  77. '''' scope=spfile";
  78.    shutdown clone immediate;
  79.    startup clone nomount;
  80. }
  81. executing Memory Script

  82. sql statement: alter system set  db_name =  ''CLONE2'' comment= ''duplicate'' scope=spfile

  83. sql statement: alter system set  control_files =  ''+DATA'', ''+FRA'' comment= '''' scope=spfile

  84. sql statement: alter system set  memory_target =  700M comment= '''' scope=spfile

  85. Oracle instance shut down

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

  88. Total System Global Area     730714112 bytes

  89. Fixed Size                     2256832 bytes
  90. Variable Size                486539328 bytes
  91. Database Buffers             234881024 bytes
  92. Redo Buffers                   7036928 bytes
  93. allocated channel: c1
  94. channel c1: SID=68 device type=DISK
  95. allocated channel: c2
  96. channel c2: SID=131 device type=DISK
  97. allocated channel: c3
  98. channel c3: SID=192 device type=DISK
  99. allocated channel: c4
  100. channel c4: SID=8 device type=DISK
  101. allocated channel: c5
  102. channel c5: SID=69 device type=DISK
  103. allocated channel: c6
  104. channel c6: SID=132 device type=DISK
  105. allocated channel: c7
  106. channel c7: SID=193 device type=DISK
  107. allocated channel: c8
  108. channel c8: SID=9 device type=DISK

  109. contents of Memory Script:
  110. {
  111.    sql clone "alter system set  control_files =
  112.   ''+DATA/clone2/controlfile/current.276.1028023901'', ''+FRA/clone2/controlfile/current.479.1028023903'' comment=
  113. ''Set by RMAN'' scope=spfile";
  114.    sql clone "alter system set  db_name =
  115. ''ORCL'' comment=
  116. ''Modified by RMAN duplicate'' scope=spfile";
  117.    sql clone "alter system set  db_unique_name =
  118. ''CLONE2'' comment=
  119. ''Modified by RMAN duplicate'' scope=spfile";
  120.    shutdown clone immediate;
  121.    startup clone force nomount
  122.    restore clone primary controlfile from  '/home/oracle/clone1/4jukc5nk_1_1';
  123.    alter clone database mount;
  124. }
  125. executing Memory Script

  126. sql statement: alter system set  control_files =   ''+DATA/clone2/controlfile/current.276.1028023901'', ''+FRA/clone2/controlfile/current.479.1028023903'' comment= ''Set by RMAN'' scope=spfile

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

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

  129. Oracle instance shut down

  130. Oracle instance started

  131. Total System Global Area     730714112 bytes

  132. Fixed Size                     2256832 bytes
  133. Variable Size                486539328 bytes
  134. Database Buffers             234881024 bytes
  135. Redo Buffers                   7036928 bytes
  136. allocated channel: c1
  137. channel c1: SID=68 device type=DISK
  138. allocated channel: c2
  139. channel c2: SID=131 device type=DISK
  140. allocated channel: c3
  141. channel c3: SID=192 device type=DISK
  142. allocated channel: c4
  143. channel c4: SID=8 device type=DISK
  144. allocated channel: c5
  145. channel c5: SID=69 device type=DISK
  146. allocated channel: c6
  147. channel c6: SID=132 device type=DISK
  148. allocated channel: c7
  149. channel c7: SID=193 device type=DISK
  150. allocated channel: c8
  151. channel c8: SID=9 device type=DISK

  152. Starting restore at 2019-12-26:10:12:27

  153. channel c2: skipped, AUTOBACKUP already found
  154. channel c3: skipped, AUTOBACKUP already found
  155. channel c4: skipped, AUTOBACKUP already found
  156. channel c5: skipped, AUTOBACKUP already found
  157. channel c6: skipped, AUTOBACKUP already found
  158. channel c7: skipped, AUTOBACKUP already found
  159. channel c8: skipped, AUTOBACKUP already found
  160. channel c1: restoring control file
  161. channel c1: restore complete, elapsed time: 00:00:11
  162. output file name=+DATA/clone2/controlfile/current.276.1028023901
  163. output file name=+FRA/clone2/controlfile/current.479.1028023903
  164. Finished restore at 2019-12-26:10:12:45

  165. database mounted
  166. Not connected to TARGET or TARGET not open, cannot verify that subset of tablespaces is self-contained
  167. Not connected to TARGET, cannot verify that set of tablespaces being duplicated does not have SYS objects
  168. Datafile 6 skipped by request
  169. RMAN-05529: WARNING: DB_FILE_NAME_CONVERT resulted in invalid ASM names; names changed to disk group only.

  170. contents of Memory Script:
  171. {
  172.    set until scn  1623324;
  173.    set newname for datafile  1 to
  174. "+data";
  175.    set newname for datafile  2 to
  176. "+data";
  177.    set newname for datafile  3 to
  178. "+data";
  179.    set newname for datafile  4 to
  180. "+data";
  181.    set newname for datafile  5 to
  182. "+data";
  183.    restore
  184.    clone database
  185.    skip forever tablespace  "TBSTRANS2"   ;
  186. }
  187. executing Memory Script

  188. executing command: SET until clause

  189. executing command: SET NEWNAME

  190. executing command: SET NEWNAME

  191. executing command: SET NEWNAME

  192. executing command: SET NEWNAME

  193. executing command: SET NEWNAME

  194. Starting restore at 2019-12-26:10:12:57

  195. channel c1: starting datafile backup set restore
  196. channel c1: specifying datafile(s) to restore from backup set
  197. channel c1: restoring datafile 00005 to +data
  198. channel c1: reading from backup piece /home/oracle/clone1/4cukc5mt_1_1
  199. channel c2: starting datafile backup set restore
  200. channel c2: specifying datafile(s) to restore from backup set
  201. channel c2: restoring datafile 00001 to +data
  202. channel c2: reading from backup piece /home/oracle/clone1/49ukc5ms_1_1
  203. channel c3: starting datafile backup set restore
  204. channel c3: specifying datafile(s) to restore from backup set
  205. channel c3: restoring datafile 00002 to +data
  206. channel c3: reading from backup piece /home/oracle/clone1/4aukc5ms_1_1
  207. channel c4: starting datafile backup set restore
  208. channel c4: specifying datafile(s) to restore from backup set
  209. channel c4: restoring datafile 00003 to +data
  210. channel c4: reading from backup piece /home/oracle/clone1/4bukc5ms_1_1
  211. channel c5: starting datafile backup set restore
  212. channel c5: specifying datafile(s) to restore from backup set
  213. channel c5: restoring datafile 00004 to +data
  214. channel c5: reading from backup piece /home/oracle/clone1/4fukc5mu_1_1
  215. channel c1: piece handle=/home/oracle/clone1/4cukc5mt_1_1 tag=TAG20191226T043226
  216. channel c1: restored backup piece 1
  217. channel c1: restore complete, elapsed time: 00:00:02
  218. channel c5: piece handle=/home/oracle/clone1/4fukc5mu_1_1 tag=TAG20191226T043226
  219. channel c5: restored backup piece 1
  220. channel c5: restore complete, elapsed time: 00:00:01
  221. channel c4: piece handle=/home/oracle/clone1/4bukc5ms_1_1 tag=TAG20191226T043226
  222. channel c4: restored backup piece 1
  223. channel c4: restore complete, elapsed time: 00:00:04
  224. channel c2: piece handle=/home/oracle/clone1/49ukc5ms_1_1 tag=TAG20191226T043226
  225. channel c2: restored backup piece 1
  226. channel c2: restore complete, elapsed time: 00:00:17
  227. channel c3: piece handle=/home/oracle/clone1/4aukc5ms_1_1 tag=TAG20191226T043226
  228. channel c3: restored backup piece 1
  229. channel c3: restore complete, elapsed time: 00:00:17
  230. Finished restore at 2019-12-26:10:13:18

  231. contents of Memory Script:
  232. {
  233.    switch clone datafile all;
  234. }
  235. executing Memory Script

  236. datafile 1 switched to datafile copy
  237. input datafile copy RECID=6 STAMP=1028023998 file name=+DATA/clone2/datafile/system.278.1028023981
  238. datafile 2 switched to datafile copy
  239. input datafile copy RECID=7 STAMP=1028023998 file name=+DATA/clone2/datafile/sysaux.256.1028023983
  240. datafile 3 switched to datafile copy
  241. input datafile copy RECID=8 STAMP=1028023999 file name=+DATA/clone2/datafile/undotbs1.272.1028023983
  242. datafile 4 switched to datafile copy
  243. input datafile copy RECID=9 STAMP=1028023999 file name=+DATA/clone2/datafile/users.284.1028023983
  244. datafile 5 switched to datafile copy
  245. input datafile copy RECID=10 STAMP=1028023999 file name=+DATA/clone2/datafile/tbstrans1.275.1028023981

  246. contents of Memory Script:
  247. {
  248.    set until scn  1623324;
  249.    recover
  250.    clone database
  251.    skip forever tablespace  "TBSTRANS2"    delete archivelog
  252.    ;
  253. }
  254. executing Memory Script

  255. executing command: SET until clause

  256. Starting recover at 2019-12-26:10:13:21

  257. Executing: alter database datafile 6 offline drop
  258. starting media recovery

  259. channel c1: starting archived log restore to default destination
  260. channel c1: restoring archived log
  261. archived log thread=1 sequence=30
  262. channel c1: reading from backup piece /home/oracle/clone1/4hukc5nh_1_1
  263. channel c1: piece handle=/home/oracle/clone1/4hukc5nh_1_1 tag=TAG20191226T043248
  264. channel c1: restored backup piece 1
  265. channel c1: restore complete, elapsed time: 00:00:01
  266. archived log file name=+FRA/clone2/archivelog/2019_12_26/thread_1_seq_30.478.1028024009 thread=1 sequence=30
  267. channel clone_default: deleting archived log(s)
  268. archived log file name=+FRA/clone2/archivelog/2019_12_26/thread_1_seq_30.478.1028024009 RECID=1 STAMP=1028024009
  269. media recovery complete, elapsed time: 00:00:02
  270. Finished recover at 2019-12-26:10:13:32
  271. Oracle instance started

  272. Total System Global Area     730714112 bytes

  273. Fixed Size                     2256832 bytes
  274. Variable Size                486539328 bytes
  275. Database Buffers             234881024 bytes
  276. Redo Buffers                   7036928 bytes

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

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

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

  289. Oracle instance shut down

  290. connected to auxiliary database (not started)
  291. Oracle instance started

  292. Total System Global Area     730714112 bytes

  293. Fixed Size                     2256832 bytes
  294. Variable Size                486539328 bytes
  295. Database Buffers             234881024 bytes
  296. Redo Buffers                   7036928 bytes
  297. allocated channel: c1
  298. channel c1: SID=70 device type=DISK
  299. allocated channel: c2
  300. channel c2: SID=131 device type=DISK
  301. allocated channel: c3
  302. channel c3: SID=192 device type=DISK
  303. allocated channel: c4
  304. channel c4: SID=6 device type=DISK
  305. allocated channel: c5
  306. channel c5: SID=71 device type=DISK
  307. allocated channel: c6
  308. channel c6: SID=132 device type=DISK
  309. allocated channel: c7
  310. channel c7: SID=193 device type=DISK
  311. allocated channel: c8
  312. channel c8: SID=7 device type=DISK
  313. sql statement: CREATE CONTROLFILE REUSE SET DATABASE "CLONE2" RESETLOGS ARCHIVELOG
  314.   MAXLOGFILES     16
  315.   MAXLOGMEMBERS      3
  316.   MAXDATAFILES      100
  317.   MAXINSTANCES     8
  318.   MAXLOGHISTORY      292
  319. LOGFILE
  320.   GROUP   1 ( '+DATA', '+FRA' ) SIZE 50 M ,
  321.   GROUP   2 ( '+DATA', '+FRA' ) SIZE 50 M ,
  322.   GROUP   3 ( '+DATA', '+FRA' ) SIZE 50 M
  323. DATAFILE
  324.   '+DATA/clone2/datafile/system.278.1028023981'
  325. CHARACTER SET AL32UTF8


  326. contents of Memory Script:
  327. {
  328.    set newname for tempfile  1 to
  329. "+data";
  330.    switch clone tempfile all;
  331.    catalog clone datafilecopy  "+DATA/clone2/datafile/sysaux.256.1028023983",
  332. "+DATA/clone2/datafile/undotbs1.272.1028023983",
  333. "+DATA/clone2/datafile/users.284.1028023983",
  334. "+DATA/clone2/datafile/tbstrans1.275.1028023981";
  335.    switch clone datafile all;
  336. }
  337. executing Memory Script

  338. executing command: SET NEWNAME

  339. renamed tempfile 1 to +data in control file

  340. cataloged datafile copy
  341. datafile copy file name=+DATA/clone2/datafile/sysaux.256.1028023983 RECID=1 STAMP=1028024100
  342. cataloged datafile copy
  343. datafile copy file name=+DATA/clone2/datafile/undotbs1.272.1028023983 RECID=2 STAMP=1028024100
  344. cataloged datafile copy
  345. datafile copy file name=+DATA/clone2/datafile/users.284.1028023983 RECID=3 STAMP=1028024101
  346. cataloged datafile copy
  347. datafile copy file name=+DATA/clone2/datafile/tbstrans1.275.1028023981 RECID=4 STAMP=1028024101

  348. datafile 2 switched to datafile copy
  349. input datafile copy RECID=1 STAMP=1028024100 file name=+DATA/clone2/datafile/sysaux.256.1028023983
  350. datafile 3 switched to datafile copy
  351. input datafile copy RECID=2 STAMP=1028024100 file name=+DATA/clone2/datafile/undotbs1.272.1028023983
  352. datafile 4 switched to datafile copy
  353. input datafile copy RECID=3 STAMP=1028024101 file name=+DATA/clone2/datafile/users.284.1028023983
  354. datafile 5 switched to datafile copy
  355. input datafile copy RECID=4 STAMP=1028024101 file name=+DATA/clone2/datafile/tbstrans1.275.1028023981

  356. contents of Memory Script:
  357. {
  358.    Alter clone database open resetlogs;
  359. }
  360. executing Memory Script

  361. database opened
  362. Dropping offline and skipped tablespaces
  363. Executing: drop tablespace "TBSTRANS2" including contents cascade constraints
  364. Finished Duplicate Db at 2019-12-26:10:16:18
  365. released channel: c1
  366. released channel: c2
  367. released channel: c3
  368. released channel: c4
  369. released channel: c5
  370. released channel: c6
  371. released channel: c7
  372. released channel: c8

  373. Recovery Manager complete.
  374. [oracle@station76 ~]$
复制代码


回复

使用道具 举报

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

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-5-8 20:48 , Processed in 0.043787 second(s), 24 queries .

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