oracle 11g duplicate database基于备份复制数据库(二)
使用目标数据库的基于备份的复制,下面测试将原数据库使用备份复制到远程主机不同目录
1.对原数据库生成备份
RMAN> backup as compressed backupset database plus archivelog;Starting backup at 2015-06-05 16:44:19 current log archived allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=31 device type=DISK channel ORA_DISK_1: starting compressed archived log backup set channel ORA_DISK_1: specifying archived log(s) in backup set input archived log thread=1 sequence=5 RECID=1 STAMP=880996327 input archived log thread=1 sequence=6 RECID=2 STAMP=880996438 input archived log thread=1 sequence=7 RECID=3 STAMP=881014383 input archived log thread=1 sequence=8 RECID=4 STAMP=881014612 input archived log thread=1 sequence=9 RECID=5 STAMP=881015165 input archived log thread=1 sequence=10 RECID=13 STAMP=881233508 input archived log thread=1 sequence=11 RECID=14 STAMP=881233508 channel ORA_DISK_1: starting piece 1 at 2015-06-05 16:44:22 channel ORA_DISK_1: finished piece 1 at 2015-06-05 16:44:29 piece handle=/u02/backup/29q8o8v6_1_1 tag=TAG20150605T164421 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07 channel ORA_DISK_1: starting compressed archived log backup set channel ORA_DISK_1: specifying archived log(s) in backup set input archived log thread=1 sequence=1 RECID=12 STAMP=881233507 channel ORA_DISK_1: starting piece 1 at 2015-06-05 16:44:29 channel ORA_DISK_1: finished piece 1 at 2015-06-05 16:44:30 piece handle=/u02/backup/2aq8o8vd_1_1 tag=TAG20150605T164421 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 channel ORA_DISK_1: starting compressed archived log backup set channel ORA_DISK_1: specifying archived log(s) in backup set input archived log thread=1 sequence=12 RECID=15 STAMP=881233508 channel ORA_DISK_1: starting piece 1 at 2015-06-05 16:44:30 channel ORA_DISK_1: finished piece 1 at 2015-06-05 16:44:31 piece handle=/u02/backup/2bq8o8ve_1_1 tag=TAG20150605T164421 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 channel ORA_DISK_1: starting compressed archived log backup set channel ORA_DISK_1: specifying archived log(s) in backup set input archived log thread=1 sequence=2 RECID=21 STAMP=881233663 input archived log thread=1 sequence=3 RECID=22 STAMP=881233941 input archived log thread=1 sequence=4 RECID=23 STAMP=881234587 input archived log thread=1 sequence=5 RECID=24 STAMP=881235045 input archived log thread=1 sequence=6 RECID=25 STAMP=881235180 input archived log thread=1 sequence=7 RECID=26 STAMP=881272559 channel ORA_DISK_1: starting piece 1 at 2015-06-05 16:44:31 channel ORA_DISK_1: finished piece 1 at 2015-06-05 16:44:34 piece handle=/u02/backup/2cq8o8vf_1_1 tag=TAG20150605T164421 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03 channel ORA_DISK_1: starting compressed archived log backup set channel ORA_DISK_1: specifying archived log(s) in backup set input archived log thread=1 sequence=13 RECID=16 STAMP=881233508 input archived log thread=1 sequence=14 RECID=17 STAMP=881233508 input archived log thread=1 sequence=15 RECID=18 STAMP=881233508 input archived log thread=1 sequence=16 RECID=19 STAMP=881233508 input archived log thread=1 sequence=17 RECID=20 STAMP=881233508 input archived log thread=1 sequence=18 RECID=11 STAMP=881232587 input archived log thread=1 sequence=19 RECID=9 STAMP=881232587 input archived log thread=1 sequence=20 RECID=10 STAMP=881232587 channel ORA_DISK_1: starting piece 1 at 2015-06-05 16:44:34 channel ORA_DISK_1: finished piece 1 at 2015-06-05 16:44:35 piece handle=/u02/backup/2dq8o8vi_1_1 tag=TAG20150605T164421 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 channel ORA_DISK_1: starting compressed archived log backup set channel ORA_DISK_1: specifying archived log(s) in backup set input archived log thread=1 sequence=8 RECID=27 STAMP=881273112 input archived log thread=1 sequence=9 RECID=28 STAMP=881273363 input archived log thread=1 sequence=10 RECID=29 STAMP=881274168 input archived log thread=1 sequence=11 RECID=30 STAMP=881309835 input archived log thread=1 sequence=12 RECID=31 STAMP=881310058 input archived log thread=1 sequence=13 RECID=32 STAMP=881310212 input archived log thread=1 sequence=14 RECID=33 STAMP=881396520 input archived log thread=1 sequence=15 RECID=34 STAMP=881534563 input archived log thread=1 sequence=16 RECID=35 STAMP=881570186 input archived log thread=1 sequence=17 RECID=36 STAMP=881577860 input archived log thread=1 sequence=18 RECID=37 STAMP=881578662 input archived log thread=1 sequence=19 RECID=38 STAMP=881579588 input archived log thread=1 sequence=20 RECID=39 STAMP=881582326 input archived log thread=1 sequence=21 RECID=40 STAMP=881594537 input archived log thread=1 sequence=22 RECID=41 STAMP=881599459 channel ORA_DISK_1: starting piece 1 at 2015-06-05 16:44:36 channel ORA_DISK_1: finished piece 1 at 2015-06-05 16:44:51 piece handle=/u02/backup/2eq8o8vk_1_1 tag=TAG20150605T164421 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15 Finished backup at 2015-06-05 16:44:51Starting backup at 2015-06-05 16:44:51 using channel ORA_DISK_1 channel ORA_DISK_1: starting compressed full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00001 name=/u03/app/oracle/oradata/db/system01.dbf input datafile file number=00002 name=/u03/app/oracle/oradata/db/sysaux01.dbf input datafile file number=00003 name=/u03/app/oracle/oradata/db/undotbs01.dbf input datafile file number=00005 name=/u03/app/oracle/oradata/db/test01.dbf input datafile file number=00004 name=/u03/app/oracle/oradata/db/users01.dbf channel ORA_DISK_1: starting piece 1 at 2015-06-05 16:44:52 channel ORA_DISK_1: finished piece 1 at 2015-06-05 16:46:37 piece handle=/u02/backup/2fq8o904_1_1 tag=TAG20150605T164451 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:01:45 Finished backup at 2015-06-05 16:46:37Starting backup at 2015-06-05 16:46:37 current log archived using channel ORA_DISK_1 channel ORA_DISK_1: starting compressed archived log backup set channel ORA_DISK_1: specifying archived log(s) in backup set input archived log thread=1 sequence=23 RECID=42 STAMP=881599598 channel ORA_DISK_1: starting piece 1 at 2015-06-05 16:46:39 channel ORA_DISK_1: finished piece 1 at 2015-06-05 16:46:40 piece handle=/u02/backup/2gq8o93f_1_1 tag=TAG20150605T164639 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 2015-06-05 16:46:40Starting Control File and SPFILE Autobackup at 2015-06-05 16:46:40 piece handle=/u02/backup/c-1644809111-20150605-00 comment=NONE Finished Control File and SPFILE Autobackup at 2015-06-05 16:46:44RMAN> list backup;List of Backup Sets ===================BS Key Size Device Type Elapsed Time Completion Time ------- ---------- ----------- ------------ ------------------- 16127 946.50K DISK 00:00:00 2015-06-05 16:44:29BP Key: 16133 Status: AVAILABLE Compressed: YES Tag: TAG20150605T164421Piece Name: /u02/backup/2aq8o8vd_1_1List of Archived Logs in backup set 16127Thrd Seq Low SCN Low Time Next SCN Next Time---- ------- ---------- ------------------- ---------- ---------1 1 703711 2015-06-01 10:49:47 704659 2015-06-01 11:05:07BS Key Size Device Type Elapsed Time Completion Time ------- ---------- ----------- ------------ ------------------- 16129 5.37M DISK 00:00:01 2015-06-05 16:44:32BP Key: 16135 Status: AVAILABLE Compressed: YES Tag: TAG20150605T164421Piece Name: /u02/backup/2cq8o8vf_1_1List of Archived Logs in backup set 16129Thrd Seq Low SCN Low Time Next SCN Next Time---- ------- ---------- ------------------- ---------- ---------1 2 704659 2015-06-01 11:05:07 705159 2015-06-01 11:07:431 3 705159 2015-06-01 11:07:43 705443 2015-06-01 11:12:211 4 705443 2015-06-01 11:12:21 707134 2015-06-01 11:23:071 5 707134 2015-06-01 11:23:07 707879 2015-06-01 11:30:451 6 707879 2015-06-01 11:30:45 707956 2015-06-01 11:33:001 7 707956 2015-06-01 11:33:00 739261 2015-06-01 21:55:54BS Key Size Device Type Elapsed Time Completion Time ------- ---------- ----------- ------------ ------------------- 16131 25.64M DISK 00:00:08 2015-06-05 16:44:44BP Key: 16137 Status: AVAILABLE Compressed: YES Tag: TAG20150605T164421Piece Name: /u02/backup/2eq8o8vk_1_1List of Archived Logs in backup set 16131Thrd Seq Low SCN Low Time Next SCN Next Time---- ------- ---------- ------------------- ---------- ---------1 8 739261 2015-06-01 21:55:54 746801 2015-06-01 22:05:121 9 746801 2015-06-01 22:05:12 750015 2015-06-01 22:09:211 10 750015 2015-06-01 22:09:21 751675 2015-06-01 22:22:481 11 751675 2015-06-01 22:22:48 773357 2015-06-02 08:17:131 12 773357 2015-06-02 08:17:13 773904 2015-06-02 08:20:581 13 773904 2015-06-02 08:20:58 773991 2015-06-02 08:23:321 14 773991 2015-06-02 08:23:32 811036 2015-06-03 08:21:541 15 811036 2015-06-03 08:21:54 848751 2015-06-04 22:42:381 16 848751 2015-06-04 22:42:38 878559 2015-06-05 08:36:201 17 878559 2015-06-05 08:36:20 882947 2015-06-05 10:44:201 18 882947 2015-06-05 10:44:20 883808 2015-06-05 10:57:411 19 883808 2015-06-05 10:57:41 884702 2015-06-05 11:13:081 20 884702 2015-06-05 11:13:08 886070 2015-06-05 11:58:461 21 886070 2015-06-05 11:58:46 892378 2015-06-05 15:22:171 22 892378 2015-06-05 15:22:17 894752 2015-06-05 16:44:19BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ ------------------- 16184 Full 271.73M DISK 00:01:43 2015-06-05 16:46:35BP Key: 16200 Status: AVAILABLE Compressed: YES Tag: TAG20150605T164451Piece Name: /u02/backup/2fq8o904_1_1List of Datafiles in backup set 16184File LV Type Ckp SCN Ckp Time Name---- -- ---- ---------- ------------------- ----1 Full 894791 2015-06-05 16:44:52 /u03/app/oracle/oradata/db/system01.dbf2 Full 894791 2015-06-05 16:44:52 /u03/app/oracle/oradata/db/sysaux01.dbf3 Full 894791 2015-06-05 16:44:52 /u03/app/oracle/oradata/db/undotbs01.dbf4 Full 894791 2015-06-05 16:44:52 /u03/app/oracle/oradata/db/users01.dbf5 Full 894791 2015-06-05 16:44:52 /u03/app/oracle/oradata/db/test01.dbfBS Key Size Device Type Elapsed Time Completion Time ------- ---------- ----------- ------------ ------------------- 16213 7.50K DISK 00:00:00 2015-06-05 16:46:39BP Key: 16219 Status: AVAILABLE Compressed: YES Tag: TAG20150605T164639Piece Name: /u02/backup/2gq8o93f_1_1List of Archived Logs in backup set 16213Thrd Seq Low SCN Low Time Next SCN Next Time---- ------- ---------- ------------------- ---------- ---------1 23 894752 2015-06-05 16:44:19 894834 2015-06-05 16:46:37BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ ------------------- 16228 Full 9.48M DISK 00:00:02 2015-06-05 16:46:43BP Key: 16230 Status: AVAILABLE Compressed: NO Tag: TAG20150605T164641Piece Name: /u02/backup/c-1644809111-20150605-00SPFILE Included: Modification time: 2015-06-05 16:01:17SPFILE db_unique_name: DBControl File Included: Ckp SCN: 894861 Ckp time: 2015-06-05 16:46:41
2.将备份文件传输到目的主机上
[oracle11@jingyong1 backup]$ scp oracle11@192.168.56.2:/u02/backup/* /u02/backup/ oracle11@192.168.56.2's password: 29q8o8v6_1_1 100% 17MB 16.8MB/s 00:01 2aq8o8vd_1_1 100% 947KB 947.0KB/s 00:00 2bq8o8ve_1_1 100% 2916KB 2.9MB/s 00:00 2cq8o8vf_1_1 100% 5504KB 5.4MB/s 00:01 2dq8o8vi_1_1 100% 1992KB 1.9MB/s 00:00 2eq8o8vk_1_1 100% 26MB 12.8MB/s 00:02 2fq8o904_1_1 100% 272MB 8.5MB/s 00:32 2gq8o93f_1_1 100% 8192 8.0KB/s 00:00 c-1644809111-20150605-00 100% 9728KB 9.5MB/s 00:00 [oracle11@jingyong1 backup]$ ls -lrt total 343140 -rw-r----- 1 oracle11 oinstall 2985472 Jun 5 17:07 2bq8o8ve_1_1 -rw-r----- 1 oracle11 oinstall 969728 Jun 5 17:07 2aq8o8vd_1_1 -rw-r----- 1 oracle11 oinstall 17567232 Jun 5 17:07 29q8o8v6_1_1 -rw-r----- 1 oracle11 oinstall 2039296 Jun 5 17:07 2dq8o8vi_1_1 -rw-r----- 1 oracle11 oinstall 5636096 Jun 5 17:07 2cq8o8vf_1_1 -rw-r----- 1 oracle11 oinstall 26888192 Jun 5 17:07 2eq8o8vk_1_1 -rw-r----- 1 oracle11 oinstall 9961472 Jun 5 17:07 c-1644809111-20150605-00 -rw-r----- 1 oracle11 oinstall 8192 Jun 5 17:07 2gq8o93f_1_1 -rw-r----- 1 oracle11 oinstall 284934144 Jun 5 17:07 2fq8o904_1_1
3.创建辅助实例的密码文件(这里辅助实例名为dup) ,在目的主机上为辅助实例创建密码文件可以有以下选项:
.手动创建密码文件,对于duplicate ... from active database有额外的要求。必须使用SYS用户ID并且密码必须与原数据库的密码相匹配。当想要使用单独的密码来创建密码文件时因此可以启动辅助实例并使用它来连接原数据库。
.在执行duplicate ... from active database命令时指定password file选项,在这种情况下,RMAN将原数据库的密码文件复制到目的主机上并且覆盖辅助实例已经存在的密码文件。如果原数据库密码文件有多个密码且你想让它们在副本数据库中使用时这种技术是非常有用的。
[oracle11@jingyong1 dbs]$ orapwd file=/u03/app/oracle/11.2.0/db/dbs/orapwdup password=system entries=10;[oracle11@jingyong1 dbs]$ ls -lrt orapwdup -rw-r----- 1 oracle11 oinstall 2560 Jun 5 09:40 orapwdup
4.创建辅助实例网络连接,修改监听文件,使用静态监听来监听辅助实例
[oracle11@jingyong1 admin]$ vi listener.ora# listener.ora Network Configuration File: /u03/app/oracle/11.2.0/db/network/admin/listener.ora # Generated by Oracle configuration tools.LISTENER =(DESCRIPTION_LIST =(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = jingyong1)(PORT = 1521))(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))))SID_LIST_LISTENER =(SID_LIST =(SID_DESC =(SID_NAME = dup)(ORACLE_HOME =/u03/app/oracle/11.2.0/db)))[oracle11@jingyong1 admin]$ lsnrctl startLSNRCTL for Linux: Version 11.2.0.4.0 - Production on 05-JUN-2015 11:25:35Copyright (c) 1991, 2013, Oracle. All rights reserved.Starting /u03/app/oracle/11.2.0/db/bin/tnslsnr: please wait...TNSLSNR for Linux: Version 11.2.0.4.0 - Production System parameter file is /u03/app/oracle/11.2.0/db/network/admin/listener.ora Log messages written to /u03/app/oracle/diag/tnslsnr/jingyong1/listener/alert/log.xml Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=jingyong1)(PORT=1521))) Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=jingyong1)(PORT=1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production Start Date 05-JUN-2015 11:25:35 Uptime 0 days 0 hr. 0 min. 0 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /u03/app/oracle/11.2.0/db/network/admin/listener.ora Listener Log File /u03/app/oracle/diag/tnslsnr/jingyong1/listener/alert/log.xml Listening Endpoints Summary...(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=jingyong1)(PORT=1521)))(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) Services Summary... Service "cs" has 1 instance(s).Instance "cs", status UNKNOWN, has 1 handler(s) for this service... Service "dup" has 1 instance(s).Instance "dup", status UNKNOWN, has 1 handler(s) for this service... The command completed successfully
给辅助实例增加网络服务名
[oracle11@jingyong1 admin]$ vi tnsnames.ora # tnsnames.ora Network Configuration File: /u03/app/oracle/11.2.0/db/network/admin/tnsnames.ora # Generated by Oracle configuration tools.dup =(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.11)(PORT = 1521)))(CONNECT_DATA =(SERVICE_NAME = dup)(UR = A)))
5.创建辅助实例的参数文件,初始化参数文件的目录和内容依赖于给复制文件命名选择的策略。可以选择建议的技术来对原主机和目的主机使用相同的命名策略。因此对于Oracle RAC环境,对于原主机和目的主机可以使用相同的ORACLE_SID。在参数文件中将db_name设置为任意值,db_name是唯一必须设置的参数。创建参数文件有以下选项:
.为辅助实例来创建文本参数文件,初始化参数文件的存储目录是在主机上操作系统特定的缺省目录。例如,在Linux和UNIX中缺省参数文件名是ORACLE_HOME/dbs/initORACLE_SID.ora,在Windows平台上参数文件名是ORACLE_HOME\database\initORACLE_SID.ora
.在执行duplicate命令时指定spfile子句。duplicate ... spfile技术最简单,因为在执行复制时RMAN自动将原数据库的spfile文件复制到辅助实例或从备份中还原spfile文件。如果在辅助实例上存在spfile文件,那么RMAN就会覆盖它。
[oracle11@jingyong1 dbs]$ vi initdup.ora db_name=dup db_unique_name=dup control_files= /u03/app/oracle/oradata/dup/control01.ctl remote_login_passwordfile=exclusive compatible = 11.2.0.4.0 db_block_size=8192 sga_target=300M sga_max_size=300M pga_aggregate_target=32M db_file_name_convert=('/u03/app/oracle/oradata/db/','/u03/app/oracle/oradata/dup/') log_file_name_convert=('/u03/app/oracle/oradata/db/','/u03/app/oracle/oradata/dup/')
6.启动辅助实例,启动SQL*Plus并使用sysdba权限连接到辅助实例。将辅助实例启动到nomount状态(如果参数文件在缺省目录中startup命令不需要pfile参数)。注意:确保辅助实例使用文本参数文件来启动而不是SPFILE参数文件。不要创建控制文件或试图mount或open辅助实例。
[oracle11@jingyong1 dbs]$ export ORACLE_SID=dup [oracle11@jingyong1 dbs]$ sqlplus / as sysdbaSQL*Plus: Release 11.2.0.4.0 Production on Fri Jun 5 09:58:16 2015Copyright (c) 1982, 2013, Oracle. All rights reserved.Connected to an idle instance.SQL> startup nomount ORACLE instance started.Total System Global Area 313860096 bytes Fixed Size 1364340 bytes Variable Size 104861324 bytes Database Buffers 201326592 bytes Redo Buffers 6307840 bytes
7.在目标主机(运行被复制数据库的主机)配置辅助实例的网络服务名
[oracle11@oracle11g admin]$ vi tnsnames.ora dup =(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST =192.168.56.11)(PORT = 1521)))(CONNECT_DATA =(SERVICE_NAME =dup)(UR=A)))[oracle11@oracle11g admin]$ sqlplus /nologSQL*Plus: Release 11.2.0.4.0 Production on Fri Jun 5 10:05:14 2015Copyright (c) 1982, 2013, Oracle. All rights reserved.SQL> conn sys/system@dup as sysdba Connected.
8.加载或打开目标数据库,如果RMAN连接到原数据库作为目标数据库,那么原数据库为了执行复制必须设置为合适的状态。如果原数据库实例没有mount或open,那么将原数据库mount或open。如果执行active database复制,那么确保满足下面额外的条件:
-如果原数据库open,那么必须启用归档
-如果原数据库没有open,那么数据库不需要执行实例恢复
由于原数据库启用了归档所以可以将原数据库启动到open状态
[oracle11@oracle11g ~]$ sqlplus / as sysdbaSQL*Plus: Release 11.2.0.4.0 Production on Fri Jun 5 08:35:45 2015Copyright (c) 1982, 2013, Oracle. All rights reserved.Connected to an idle instance.SQL> startup ORACLE instance started.Total System Global Area 422670336 bytes Fixed Size 1365068 bytes Variable Size 310381492 bytes Database Buffers 104857600 bytes Redo Buffers 6066176 bytes Database mounted. Database opened.
9.执行duplicate命令,如果没有配置自动通道,那么至少手动分配一个辅助实例。给duplicate命令指定nofilenamecheck参数。如果是使用PFILE参数文件启动辅助实例需要指定pfile参数文件,且pfile参数文件必须存储在运行RMAN执行复制的主机上。这里辅助实例使用SPFILE参数文件来启动,并使用自动通道和指定nofilenamecheck选项:
[oracle11@oracle11g ~]$ rman target sys/system catalog rman/rman@cs auxiliary sys/system@dupRecovery Manager: Release 11.2.0.4.0 - Production on Fri Jun 5 18:56:30 2015Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.connected to target database: DB (DBID=1644809111) connected to recovery catalog database connected to auxiliary database: DUP (not mounted)RMAN> duplicate target database to dup until time '2015-06-05 16:46:37' nofilenamecheck;Starting Duplicate Db at 2015-06-05 18:57:59 allocated channel: ORA_AUX_DISK_1 channel ORA_AUX_DISK_1: SID=20 device type=DISKcontents of Memory Script: {sql clone "create spfile from memory"; } executing Memory Scriptsql statement: create spfile from memorycontents of Memory Script: {shutdown clone immediate;startup clone nomount; } executing Memory ScriptOracle instance shut downconnected to auxiliary database (not started) Oracle instance startedTotal System Global Area 313860096 bytesFixed Size 1364340 bytes Variable Size 109055628 bytes Database Buffers 197132288 bytes Redo Buffers 6307840 bytescontents of Memory Script: {set until scn 894834;sql clone "alter system set db_name =''DB'' comment=''Modified by RMAN duplicate'' scope=spfile";sql clone "alter system set db_unique_name =''DUP'' comment=''Modified by RMAN duplicate'' scope=spfile";shutdown clone immediate;startup clone force nomountrestore clone primary controlfile;alter clone database mount; } executing Memory Scriptexecuting command: SET until clausesql statement: alter system set db_name = ''DB'' comment= ''Modified by RMAN duplicate'' scope=spfilesql statement: alter system set db_unique_name = ''DUP'' comment= ''Modified by RMAN duplicate'' scope=spfileOracle instance shut downOracle instance startedTotal System Global Area 313860096 bytesFixed Size 1364340 bytes Variable Size 109055628 bytes Database Buffers 197132288 bytes Redo Buffers 6307840 bytesStarting restore at 2015-06-05 18:58:19 allocated channel: ORA_AUX_DISK_1 channel ORA_AUX_DISK_1: SID=18 device type=DISKchannel ORA_AUX_DISK_1: restoring control file channel ORA_AUX_DISK_1: copied control file copy input file name=/u03/app/oracle/11.2.0/db/dbs/snapcf_db.f output file name=/u03/app/oracle/oradata/dup/control01.ctl Finished restore at 2015-06-05 18:58:22database mountedcontents of Memory Script: {set until scn 894834;set newname for datafile 1 to"/u03/app/oracle/oradata/dup/system01.dbf";set newname for datafile 2 to"/u03/app/oracle/oradata/dup/sysaux01.dbf";set newname for datafile 3 to"/u03/app/oracle/oradata/dup/undotbs01.dbf";set newname for datafile 4 to"/u03/app/oracle/oradata/dup/users01.dbf";set newname for datafile 5 to"/u03/app/oracle/oradata/dup/test01.dbf";restoreclone database; } executing Memory Scriptexecuting command: SET until clauseexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEStarting restore at 2015-06-05 18:58:27 using channel ORA_AUX_DISK_1channel ORA_AUX_DISK_1: starting datafile backup set restore channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set channel ORA_AUX_DISK_1: restoring datafile 00001 to /u03/app/oracle/oradata/dup/system01.dbf channel ORA_AUX_DISK_1: restoring datafile 00002 to /u03/app/oracle/oradata/dup/sysaux01.dbf channel ORA_AUX_DISK_1: restoring datafile 00003 to /u03/app/oracle/oradata/dup/undotbs01.dbf channel ORA_AUX_DISK_1: restoring datafile 00004 to /u03/app/oracle/oradata/dup/users01.dbf channel ORA_AUX_DISK_1: restoring datafile 00005 to /u03/app/oracle/oradata/dup/test01.dbf channel ORA_AUX_DISK_1: reading from backup piece /u02/backup/2fq8o904_1_1 channel ORA_AUX_DISK_1: piece handle=/u02/backup/2fq8o904_1_1 tag=TAG20150605T164451 channel ORA_AUX_DISK_1: restored backup piece 1 channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:02:56 Finished restore at 2015-06-05 19:01:23contents of Memory Script: {switch clone datafile all; } executing Memory Scriptdatafile 1 switched to datafile copy input datafile copy RECID=12 STAMP=881607684 file name=/u03/app/oracle/oradata/dup/system01.dbf datafile 2 switched to datafile copy input datafile copy RECID=13 STAMP=881607685 file name=/u03/app/oracle/oradata/dup/sysaux01.dbf datafile 3 switched to datafile copy input datafile copy RECID=14 STAMP=881607685 file name=/u03/app/oracle/oradata/dup/undotbs01.dbf datafile 4 switched to datafile copy input datafile copy RECID=15 STAMP=881607685 file name=/u03/app/oracle/oradata/dup/users01.dbf datafile 5 switched to datafile copy input datafile copy RECID=16 STAMP=881607685 file name=/u03/app/oracle/oradata/dup/test01.dbfcontents of Memory Script: {set until time "to_date('JUN 05 2015 16:46:37', 'MON DD YYYY HH24:MI:SS')";recoverclone databasedelete archivelog; } executing Memory Scriptexecuting command: SET until clauseStarting recover at 2015-06-05 19:01:27 using channel ORA_AUX_DISK_1starting media recoverychannel ORA_AUX_DISK_1: starting archived log restore to default destination channel ORA_AUX_DISK_1: restoring archived log archived log thread=1 sequence=23 channel ORA_AUX_DISK_1: reading from backup piece /u02/backup/2gq8o93f_1_1 channel ORA_AUX_DISK_1: piece handle=/u02/backup/2gq8o93f_1_1 tag=TAG20150605T164639 channel ORA_AUX_DISK_1: restored backup piece 1 channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01 archived log file name=/u03/app/oracle/11.2.0/db/dbs/arch1_23_881232587.dbf thread=1 sequence=23 channel clone_default: deleting archived log(s) archived log file name=/u03/app/oracle/11.2.0/db/dbs/arch1_23_881232587.dbf RECID=43 STAMP=881607690 media recovery complete, elapsed time: 00:00:02 Finished recover at 2015-06-05 19:01:33 Oracle instance startedTotal System Global Area 313860096 bytesFixed Size 1364340 bytes Variable Size 109055628 bytes Database Buffers 197132288 bytes Redo Buffers 6307840 bytescontents of Memory Script: {sql clone "alter system set db_name =''DUP'' comment=''Reset to original value by RMAN'' scope=spfile";sql clone "alter system reset db_unique_name scope=spfile";shutdown clone immediate;startup clone nomount; } executing Memory Scriptsql statement: alter system set db_name = ''DUP'' comment= ''Reset to original value by RMAN'' scope=spfilesql statement: alter system reset db_unique_name scope=spfileOracle instance shut downconnected to auxiliary database (not started) Oracle instance startedTotal System Global Area 313860096 bytesFixed Size 1364340 bytes Variable Size 109055628 bytes Database Buffers 197132288 bytes Redo Buffers 6307840 bytes sql statement: CREATE CONTROLFILE REUSE SET DATABASE "DUP" RESETLOGS ARCHIVELOGMAXLOGFILES 16MAXLOGMEMBERS 3MAXDATAFILES 100MAXINSTANCES 8MAXLOGHISTORY 292LOGFILEGROUP 1 ( '/u03/app/oracle/oradata/dup/redo01.log' ) SIZE 50 M REUSE,GROUP 2 ( '/u03/app/oracle/oradata/dup/redo02.log' ) SIZE 50 M REUSE,GROUP 3 ( '/u03/app/oracle/oradata/dup/redo03.log' ) SIZE 50 M REUSEDATAFILE'/u03/app/oracle/oradata/dup/system01.dbf'CHARACTER SET ZHS16GBKcontents of Memory Script: {set newname for tempfile 1 to"/u03/app/oracle/oradata/dup/temp01.dbf";switch clone tempfile all;catalog clone datafilecopy "/u03/app/oracle/oradata/dup/sysaux01.dbf","/u03/app/oracle/oradata/dup/undotbs01.dbf","/u03/app/oracle/oradata/dup/users01.dbf","/u03/app/oracle/oradata/dup/test01.dbf";switch clone datafile all; } executing Memory Scriptexecuting command: SET NEWNAMErenamed tempfile 1 to /u03/app/oracle/oradata/dup/temp01.dbf in control filecataloged datafile copy datafile copy file name=/u03/app/oracle/oradata/dup/sysaux01.dbf RECID=1 STAMP=881607711 cataloged datafile copy datafile copy file name=/u03/app/oracle/oradata/dup/undotbs01.dbf RECID=2 STAMP=881607711 cataloged datafile copy datafile copy file name=/u03/app/oracle/oradata/dup/users01.dbf RECID=3 STAMP=881607711 cataloged datafile copy datafile copy file name=/u03/app/oracle/oradata/dup/test01.dbf RECID=4 STAMP=881607711datafile 2 switched to datafile copy input datafile copy RECID=1 STAMP=881607711 file name=/u03/app/oracle/oradata/dup/sysaux01.dbf datafile 3 switched to datafile copy input datafile copy RECID=2 STAMP=881607711 file name=/u03/app/oracle/oradata/dup/undotbs01.dbf datafile 4 switched to datafile copy input datafile copy RECID=3 STAMP=881607711 file name=/u03/app/oracle/oradata/dup/users01.dbf datafile 5 switched to datafile copy input datafile copy RECID=4 STAMP=881607711 file name=/u03/app/oracle/oradata/dup/test01.dbfcontents of Memory Script: {Alter clone database open resetlogs; } executing Memory Scriptdatabase opened Finished Duplicate Db at 2015-06-05 19:02:13
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26015009/viewspace-1688719/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/26015009/viewspace-1688719/
oracle 11g duplicate database基于备份复制数据库(二)相关推荐
- oracle 11g duplicate database基于备份复制数据库(四)
不使用目标数据库的基于备份的复制,下面测试将原数据库使用备份复制到远程主机不同目录 1.对原数据库生成备份 RMAN> backup as compressed backupset databa ...
- oracle 11g duplicate database基于备份复制数据库(三)
不使用目标数据库的基于备份的复制,下面测试将原数据库使用备份复制到远程主机相同目录 1.对原数据库生成备份 RMAN> backup as compressed backupset databa ...
- oracle 11g duplicate database基于备份复制数据库(一)
使用目标数据库的基于备份的复制,下面测试将原数据库使用备份复制到远程主机相同目录. 1.对原数据库生成备份 RMAN> backup as compressed backupset databa ...
- oracle 11g duplicate database基于备份复制数据库(五)
不使用目标数据库和恢复目录基于备份的复制,下面测试将原数据库使用备份复制到远程主机相同目录 1.对原数据库生成备份 RMAN> backup as compressed backupset da ...
- oracle 11g duplicate database基于备份复制数据库(六)
不使用目标数据库和恢复目录基于备份的复制,下面测试将原数据库使用备份复制到远程主机不同目录 1.对原数据库生成备份 RMAN> backup as compressed backupset da ...
- Oracle 11g RAC安装--基于openfiler存储+多路径+udev方式
Oracle 11g RAC安装--基于openfiler存储+多路径+udev方式 RAC安装部分视频(温馨提示:播放地址复制到浏览器可看超清版或下载原视频文件,云盘下载地址:https://sha ...
- plsql developer oracle home为空,Windows 64位下装安装Oracle 11g,PLSQL Developer的配置问题,数据库显示空白的完美解决方案(图文教程)...
安装pl sql 后,若下图的数据库处为空.则需要安装32位的客户端,说明pl sql不支持64位客户端连接. 解决办法: 1.下载32位Oracle客户端,并安装 2.设置PLSQL Develop ...
- oracle copy database,oracle 11g duplicate from active database 复制数据库(二)
下面介绍将数据库复制到远程主机相同目录结构的操作步骤 1.创建辅助实例的密码文件(这里辅助实例名为dup) ,在目的主机上为辅助实例创建密码文件可以有以下选项: .手动创建密码文件,对于duplica ...
- Oracle 11g安装使用、备份恢复并与SpringBoot集成
背景 最近接手了一个祖传项目,一个十几年前的 .Net 客户端项目,近期需要修改一个小功能,项目用到了 Oracle 数据库,以下是我在 Windows 7 旗舰版虚拟机上安装使用 Oracle 11 ...
最新文章
- 【Android开发教程】一、基础概念
- 高级交叉报表例子程序(C#)中明细列统计数据错误改正!
- javaScript面向对象表示
- 若依前后端分离版实现基于el-tree实现选中部门树节点同步选中多选框的操作
- 假设用于通信的电文由字符集{a,b,c,d,e,f,g}中的字母构成。 它们在电文中出现的频度分别为{0.31,0.16,0.10,0.08,0.11,0.20,0.04}。【MOOC答案】
- 别让数据坑了你!用置信学习找出错误标注(附开源实现)
- centos php 版本升级 至5.3 wordpress3.7
- 24 SD配置-主数据-维护客户主记录中的保留字段
- 统计学习(二):统计推断
- T-SQL笔记1:SELECT及SELECT高级应用
- siteweaver android动易客户端,动易SiteFactory实现SiteWeaver置顶功能
- Excel常用函数大全
- 滑动速度监听VelocityTracker
- windows server 2008 r2 设置显示文件后缀名
- 计算机专业买啥样笔记本,高考结束,想学计算机专业,买台啥样的笔记本比较好,暑假自学c和cpp...
- java实现逐级审批_【YOU学吧】NC审批流如何实现自下而上逐级审批
- [附源码]Nodejs计算机毕业设计面向老年群体的健康养生系统Express(程序+LW)
- multiple definition of `_start'
- laravel安装 nwidart/laravel-modules 出现的问题
- re-complie_re-中文_
热门文章
- 初学三分法之考研路茫茫——早起看书
- 小程序保存视频/图片到相册并且授权
- 各位师兄妹,来刷腾讯了,好多经验...
- Java多线程 生产者-消费者问题示例
- Ubuntu下Linux系统部署fisco时bash操作报错权限不足(permission denied) failed to run command ‘........‘
- oracle单行子查询返回多个行 order by,单行子查询返回多个行
- 万豪国际集团贵州首家万枫酒店在贵阳会展中心开业
- 孩子数学成绩不好怎么办_三年级发现孩子数学成绩非常不好,作为家长该怎么办?...
- 为什么ppt图形卡配置不正确_PPT常见问题解决方法,PPT检测到图形卡可能配置不正确怎么办?...
- 开源Odoo ERP13.2版本模块功能