怎么复制一个RAC CDB数据库
发表于:2025-01-20 作者:千家信息网编辑
千家信息网最后更新 2025年01月20日,本篇内容介绍了"怎么复制一个RAC CDB数据库"的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!具体的
千家信息网最后更新 2025年01月20日怎么复制一个RAC CDB数据库
本篇内容介绍了"怎么复制一个RAC CDB数据库"的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!
具体的复制操作如下
1.检查源RAC CDB(jy)的参数文件,数据文件,联机日志文件,控制文件,归档日志文件的存储目录
SQL> show parameter spfileNAME TYPE VALUE------------------------------------ ----------- --------------------------------------------spfile string +DATA/JY/PARAMETERFILE/spfile.303.961976713SQL> select name from v$datafile;NAME--------------------------------------------------------------------------------+DATA/JY/DATAFILE/system.317.962209603+DATA/JY/DATAFILE/sysaux.298.962209605+DATA/JY/DATAFILE/undotbs1.277.962209605+DATA/JY/5F9AA264B21F3ED9E053AB828A0A6088/DATAFILE/system.256.962209675+DATA/JY/5F9AA264B21F3ED9E053AB828A0A6088/DATAFILE/sysaux.270.962209675+DATA/JY/DATAFILE/users.301.962209605+DATA/JY/5F9AA264B21F3ED9E053AB828A0A6088/DATAFILE/undotbs1.296.962209675+DATA/JY/DATAFILE/undotbs2.312.962209605+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/system.271.962209649+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/sysaux.316.962209649+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/undotbs1.264.962209649+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/undo_2.268.962209649+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/users.278.962209649+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/test.275.962210609+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/system.260.962469409+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/sysaux.259.962469409+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/undotbs1.265.962469409+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/undo_2.266.962469409+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/users.267.962469409+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/test.269.962469409SQL> show parameter control_filesNAME TYPE VALUE------------------------------------ ----------- -------------------------------------------control_files string +DATA/JY/CONTROLFILE/current.272.961976315SQL> select member from v$logfile;MEMBER--------------------------------------------------------------------------------+DATA/JY/ONLINELOG/group_2.302.961976321+DATA/JY/ONLINELOG/group_1.261.961976319+DATA/JY/ONLINELOG/group_3.263.961976697+DATA/JY/ONLINELOG/group_4.262.961976705SQL> archive log listDatabase log mode Archive ModeAutomatic archival EnabledArchive destination +TEST/archOldest online log sequence 127Next log sequence to archive 128Current log sequence 128
2.在目标主机上创建存储目标数据库(dup)相关数据库文件的目录,目标主机上的+fra/dup目录用来存储数据库的数据文件,控制文件,联机重做日志文件),+fra/dup目录用来存储数据库的归档重做日志文件
ASMCMD [+fra] > mkdir dup
3.将源数据库的密码文件复制到目标主机的相应目录中并修改为目标数据库(dup)对应的文件名
[grid@jytest1 ~]$ srvctl config database -db jyDatabase unique name: jyDatabase name: jyOracle home: /u01/app/oracle/product/12.2.0/dbOracle user: oracleSpfile: +DATA/JY/PARAMETERFILE/spfile.303.961976713Password file: +DATA/JY/PASSWORD/pwdjy.274.961976109Domain: Start options: openStop options: immediateDatabase role: PRIMARYManagement policy: AUTOMATICServer pools: Disk Groups: DATAMount point paths: Services: Type: RACStart concurrency: Stop concurrency: OSDBA group: dbaOSOPER group: operDatabase instances: jy1,jy2Configured nodes: jytest1,jytest2CSS critical: noCPU count: 0Memory target: 0Maximum memory: 0Default network number for database services: Database is administrator managed[grid@jytest1 admin]$ asmcmd cp +DATA/JY/PASSWORD/pwdjy.274.961976109 /home/grid/orapwdup1copying +DATA/JY/PASSWORD/pwdjy.274.961976109 -> /home/grid/orapwdup1[root@jytest1 ~]# cp /home/grid/orapwdup /u01/app/oracle/product/12.2.0/db/dbs/orapwdup1[root@jytest1 ~]# chown -R oracle:oinstall /u01/app/oracle/product/12.2.0/db/dbs/orapwdup1[root@jytest1 ~]# chmod -R 777 /u01/app/oracle/product/12.2.0/db/dbs/orapwdup1
将密码文件orapwdup复制到2号实例主机上
[oracle@jytest2 dbs]$ scp oracle@10.138.130.171:/u01/app/oracle/product/12.2.0/db/dbs/orapwdup1 /u01/app/oracle/product/12.2.0/db/dbs/orapwdup1 100% 3584 3.5KB/s 00:00 [oracle@jytest2 dbs]$ mv orapwdup1 orapwdup2
4.使用源数据库的spfile文件来创建目标数据库要使用的spfile文件
在源数据库中执行下面的命令来创建pfile参数文件
SQL> create pfile from spfile;File created.[oracle@jytest1 dbs]$ vi initdup1.ora*.audit_file_dest='/u01/app/oracle/admin/dup/adump'*.cluster_database=false*.compatible='12.2.0'*.control_files='+fra/dup/CONTROLFILE/control01.ctl'*.db_block_size=8192*.db_name='dup'*.diagnostic_dest='/u01/app/oracle'*.dispatchers='(PROTOCOL=TCP) (SERVICE=jyXDB)'*.enable_pluggable_database=truedup2.instance_number=2dup1.instance_number=1*.local_listener='-oraagent-dummy-'*.log_archive_dest_1='location=+test/arch/dup'*.nls_language='AMERICAN'*.nls_territory='AMERICA'*.open_cursors=300*.pga_aggregate_target=1g*.processes=2000*.remote_login_passwordfile='exclusive'*.sga_max_size=2147483648*.sga_target=2147483648dup2.thread=2dup1.thread=1*.undo_retention=8640dup1.undo_tablespace='UNDOTBS1'dup2.undo_tablespace='UNDOTBS2'*.db_file_name_convert=('+DATA/JY/','+fra/dup')*.log_file_name_convert=('+DATA/JY/','+fra/dup')[oracle@jytest1 dbs]$ export ORACLE_SID=dup1[oracle@jytest1 dbs]$ sqlplus / as sysdbaSQL*Plus: Release 12.2.0.1.0 Production on Fri Jan 19 19:46:07 2018Copyright (c) 1982, 2016, Oracle. All rights reserved.Connected to an idle instance.SQL> startup nomount pfile='/u01/app/oracle/product/12.2.0/db/dbs/initdup1.ora'ORACLE instance started.Total System Global Area 2147483648 bytesFixed Size 8794848 bytesVariable Size 1459621152 bytesDatabase Buffers 671088640 bytesRedo Buffers 7979008 bytesSQL> create spfile='+fra/dup/spfiledup.ora' from pfile='/u01/app/oracle/product/12.2.0/db/dbs/initdup1.ora';File created.[oracle@jytest1 dbs]$ vi initdup1.oraspfile=+fra/dup/spfiledup.ora[oracle@jytest2 dbs]$ vi initdup1.oraspfile=+fra/dup/spfiledup.ora
5.使用spfile参数文件来启动目标数据库实例(辅助实例dup)
SQL> shutdown immediateORA-01507: database not mountedORACLE instance shut down.SQL> startup nomountORACLE instance started.Total System Global Area 2147483648 bytesFixed Size 8794848 bytesVariable Size 570428704 bytesDatabase Buffers 1560281088 bytesRedo Buffers 7979008 bytesSQL> show parameter spfileNAME TYPE VALUE------------------------------------ ---------------------- ----------------------------------------------------spfile string /u01/app/oracle/product/12.2.0/db/dbs/spfiledup1.ora
6.给目标数据库配置静态监听与tns名
[grid@jytest1 admin]$ vi listener.oraSID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = dup1) (ORACLE_HOME =/u01/app/oracle/product/12.2.0/db) (GLOBAL_DBNAME=dup) ) )[grid@jytest2 admin]$ vi listener.oraSID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = dup2) (ORACLE_HOME =/u01/app/oracle/product/12.2.0/db) (GLOBAL_DBNAME=dup) ) )[grid@jytest1 admin]$ srvctl stop listener -listener LISTENER[grid@jytest1 admin]$ srvctl start listener -listener LISTENER[grid@jytest1 admin]$ lsnrctl statusLSNRCTL for Linux: Version 12.2.0.1.0 - Production on 19-JAN-2018 22:36:22Copyright (c) 1991, 2016, Oracle. All rights reserved.Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))STATUS of the LISTENER------------------------Alias LISTENERVersion TNSLSNR for Linux: Version 12.2.0.1.0 - ProductionStart Date 19-JAN-2018 22:32:51Uptime 0 days 0 hr. 3 min. 31 secTrace Level offSecurity ON: Local OS AuthenticationSNMP OFFListener Parameter File /u01/app/product/12.2.0/crs/network/admin/listener.oraListener Log File /u01/app/grid/diag/tnslsnr/jytest1/listener/alert/log.xmlListening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.138.130.171)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.138.130.175)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=jytest1.jydba.net)(PORT=5500))(Security=(my_wallet_directory=/u01/app/oracle/product/12.2.0/db/admin/jy/xdb_wallet))(Presentation=HTTP)(Session=RAW))Services Summary...Service "+ASM" has 1 instance(s). Instance "+ASM1", status READY, has 1 handler(s) for this service...Service "+ASM_CRS" has 1 instance(s). Instance "+ASM1", status READY, has 1 handler(s) for this service...Service "+ASM_DATA" has 1 instance(s). Instance "+ASM1", status READY, has 1 handler(s) for this service...Service "+ASM_FRA" has 1 instance(s). Instance "+ASM1", status READY, has 1 handler(s) for this service...Service "+ASM_TEST" has 1 instance(s). Instance "+ASM1", status READY, has 1 handler(s) for this service...Service "5f9ac6865e87549fe053ab828a0ade94" has 1 instance(s). Instance "jy1", status READY, has 1 handler(s) for this service...Service "600d6f56deb669cce053ab828a0aab7e" has 1 instance(s). Instance "jy1", status READY, has 1 handler(s) for this service...Service "dup" has 1 instance(s). Instance "dup1", status UNKNOWN, has 1 handler(s) for this service...Service "jy" has 1 instance(s). Instance "jy1", status READY, has 1 handler(s) for this service...Service "jyXDB" has 1 instance(s). Instance "jy1", status READY, has 1 handler(s) for this service...Service "jypdb" has 1 instance(s). Instance "jy1", status READY, has 1 handler(s) for this service...Service "testpdb" has 1 instance(s). Instance "jy1", status READY, has 1 handler(s) for this service...The command completed successfully[grid@jytest2 admin]$ lsnrctl statusLSNRCTL for Linux: Version 12.2.0.1.0 - Production on 19-JAN-2018 22:41:01Copyright (c) 1991, 2016, Oracle. All rights reserved.Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))STATUS of the LISTENER------------------------Alias LISTENERVersion TNSLSNR for Linux: Version 12.2.0.1.0 - ProductionStart Date 19-JAN-2018 22:37:29Uptime 0 days 0 hr. 3 min. 31 secTrace Level offSecurity ON: Local OS AuthenticationSNMP OFFListener Parameter File /u01/app/product/12.2.0/crs/network/admin/listener.oraListener Log File /u01/app/grid/diag/tnslsnr/jytest2/listener/alert/log.xmlListening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.138.130.172)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.138.130.176)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=jytest2.jydba.net)(PORT=5500))(Security=(my_wallet_directory=/u01/app/oracle/product/12.2.0/db/admin/jy/xdb_wallet))(Presentation=HTTP)(Session=RAW))Services Summary...Service "+ASM" has 1 instance(s). Instance "+ASM2", status READY, has 1 handler(s) for this service...Service "+ASM_CRS" has 1 instance(s). Instance "+ASM2", status READY, has 1 handler(s) for this service...Service "+ASM_DATA" has 1 instance(s). Instance "+ASM2", status READY, has 1 handler(s) for this service...Service "+ASM_FRA" has 1 instance(s). Instance "+ASM2", status READY, has 1 handler(s) for this service...Service "+ASM_TEST" has 1 instance(s). Instance "+ASM2", status READY, has 1 handler(s) for this service...Service "5f9ac6865e87549fe053ab828a0ade94" has 1 instance(s). Instance "jy2", status READY, has 1 handler(s) for this service...Service "600d6f56deb669cce053ab828a0aab7e" has 1 instance(s). Instance "jy2", status READY, has 1 handler(s) for this service...Service "dup" has 1 instance(s). Instance "dup2", status UNKNOWN, has 1 handler(s) for this service...Service "jy" has 1 instance(s). Instance "jy2", status READY, has 1 handler(s) for this service...Service "jyXDB" has 1 instance(s). Instance "jy2", status READY, has 1 handler(s) for this service...Service "jypdb" has 1 instance(s). Instance "jy2", status READY, has 1 handler(s) for this service...Service "testpdb" has 1 instance(s). Instance "jy2", status READY, has 1 handler(s) for this service...The command completed successfully
7.在目标主机上配置tns,用来通过网络服务名来连接源数据库与目标数据库
[oracle@jytest1 admin]$ vi tnsnames.ora DUP = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.138.130.171)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = dup) (UR = A) ) )[oracle@jytest2 admin]$ vi tnsnames.ora DUP = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.138.130.172)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = dup) (UR = A) ) )
8.在目标主机上测试是否可以通过使用网络服务名来连接源数据库与目标数据库
[oracle@jytest1 admin]$ sqlplus /nologSQL*Plus: Release 12.2.0.1.0 Production on Fri Jan 19 22:58:34 2018Copyright (c) 1982, 2016, Oracle. All rights reserved.SQL> conn sys/abcd@dup as sysdbaConnected.SQL> conn sys/abcd@jy as sysdbaConnected.
9.执行数据库复制
[oracle@jytest1 admin]$ rman target sys/abcd@jy catalog rco/abcd@jypdb_173 auxiliary sys/abcd@dupRecovery Manager: Release 12.2.0.1.0 - Production on Fri Jan 19 23:16:15 2018Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved.connected to target database: JY (DBID=979425723)connected to recovery catalog databaseconnected to auxiliary database: DUP (not mounted)RMAN> duplicate target database to dup from active database nofilenamecheck using compressed backupset;Starting Duplicate Db at 19-JAN-18allocated channel: ORA_AUX_DISK_1channel ORA_AUX_DISK_1: SID=2275 device type=DISKcurrent log archivedcontents of Memory Script:{ sql clone "alter system set db_name = ''JY'' 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 nomount restore clone from service 'jy' using compressed backupset primary controlfile; alter clone database mount;}executing Memory Scriptsql statement: alter system set db_name = ''JY'' 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 2147483648 bytesFixed Size 8794848 bytesVariable Size 1459621152 bytesDatabase Buffers 671088640 bytesRedo Buffers 7979008 bytesStarting restore at 19-JAN-18allocated channel: ORA_AUX_DISK_1channel ORA_AUX_DISK_1: SID=1519 device type=DISKchannel ORA_AUX_DISK_1: starting datafile backup set restorechannel ORA_AUX_DISK_1: using compressed network backup set from service jychannel ORA_AUX_DISK_1: restoring control filechannel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:06output file name=+FRA/dup/CONTROLFILE/control01.ctlFinished restore at 19-JAN-18database mountedRMAN-05529: warning: DB_FILE_NAME_CONVERT resulted in invalid ASM names; names changed to disk group only.contents of Memory Script:{ sql clone 'alter database flashback off'; set newname for datafile 1 to "+FRA"; set newname for datafile 3 to "+FRA"; set newname for datafile 4 to "+FRA"; set newname for datafile 5 to "+FRA"; set newname for datafile 6 to "+FRA"; set newname for datafile 7 to "+FRA"; set newname for datafile 8 to "+FRA"; set newname for datafile 9 to "+FRA"; set newname for datafile 10 to "+FRA"; set newname for datafile 11 to "+FRA"; set newname for datafile 12 to "+FRA"; set newname for datafile 13 to "+FRA"; set newname for datafile 14 to "+FRA"; set newname for datafile 15 to "+FRA"; set newname for datafile 16 to "+FRA"; set newname for datafile 17 to "+FRA"; set newname for datafile 18 to "+FRA"; set newname for datafile 19 to "+FRA"; set newname for datafile 20 to "+FRA"; set newname for datafile 21 to "+FRA"; restore from nonsparse from service 'jy' using compressed backupset clone database ; sql 'alter system archive log current';}executing Memory Scriptsql statement: alter database flashback offexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEStarting restore at 19-JAN-18using channel ORA_AUX_DISK_1channel ORA_AUX_DISK_1: starting datafile backup set restorechannel ORA_AUX_DISK_1: using compressed network backup set from service jychannel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup setchannel ORA_AUX_DISK_1: restoring datafile 00001 to +FRAchannel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:55channel ORA_AUX_DISK_1: starting datafile backup set restorechannel ORA_AUX_DISK_1: using compressed network backup set from service jychannel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup setchannel ORA_AUX_DISK_1: restoring datafile 00003 to +FRAchannel ORA_AUX_DISK_1: restore complete, elapsed time: 00:01:46channel ORA_AUX_DISK_1: starting datafile backup set restorechannel ORA_AUX_DISK_1: using compressed network backup set from service jychannel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup setchannel ORA_AUX_DISK_1: restoring datafile 00004 to +FRAchannel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:16channel ORA_AUX_DISK_1: starting datafile backup set restorechannel ORA_AUX_DISK_1: using compressed network backup set from service jychannel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup setchannel ORA_AUX_DISK_1: restoring datafile 00005 to +FRAchannel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:15channel ORA_AUX_DISK_1: starting datafile backup set restorechannel ORA_AUX_DISK_1: using compressed network backup set from service jychannel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup setchannel ORA_AUX_DISK_1: restoring datafile 00006 to +FRAchannel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:36channel ORA_AUX_DISK_1: starting datafile backup set restorechannel ORA_AUX_DISK_1: using compressed network backup set from service jychannel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup setchannel ORA_AUX_DISK_1: restoring datafile 00007 to +FRAchannel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01channel ORA_AUX_DISK_1: starting datafile backup set restorechannel ORA_AUX_DISK_1: using compressed network backup set from service jychannel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup setchannel ORA_AUX_DISK_1: restoring datafile 00008 to +FRAchannel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07channel ORA_AUX_DISK_1: starting datafile backup set restorechannel ORA_AUX_DISK_1: using compressed network backup set from service jychannel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup setchannel ORA_AUX_DISK_1: restoring datafile 00009 to +FRAchannel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:04channel ORA_AUX_DISK_1: starting datafile backup set restorechannel ORA_AUX_DISK_1: using compressed network backup set from service jychannel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup setchannel ORA_AUX_DISK_1: restoring datafile 00010 to +FRAchannel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:15channel ORA_AUX_DISK_1: starting datafile backup set restorechannel ORA_AUX_DISK_1: using compressed network backup set from service jychannel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup setchannel ORA_AUX_DISK_1: restoring datafile 00011 to +FRAchannel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:36channel ORA_AUX_DISK_1: starting datafile backup set restorechannel ORA_AUX_DISK_1: using compressed network backup set from service jychannel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup setchannel ORA_AUX_DISK_1: restoring datafile 00012 to +FRAchannel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:04channel ORA_AUX_DISK_1: starting datafile backup set restorechannel ORA_AUX_DISK_1: using compressed network backup set from service jychannel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup setchannel ORA_AUX_DISK_1: restoring datafile 00013 to +FRAchannel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03channel ORA_AUX_DISK_1: starting datafile backup set restorechannel ORA_AUX_DISK_1: using compressed network backup set from service jychannel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup setchannel ORA_AUX_DISK_1: restoring datafile 00014 to +FRAchannel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:36channel ORA_AUX_DISK_1: starting datafile backup set restorechannel ORA_AUX_DISK_1: using compressed network backup set from service jychannel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup setchannel ORA_AUX_DISK_1: restoring datafile 00015 to +FRAchannel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03channel ORA_AUX_DISK_1: starting datafile backup set restorechannel ORA_AUX_DISK_1: using compressed network backup set from service jychannel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup setchannel ORA_AUX_DISK_1: restoring datafile 00016 to +FRAchannel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:16channel ORA_AUX_DISK_1: starting datafile backup set restorechannel ORA_AUX_DISK_1: using compressed network backup set from service jychannel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup setchannel ORA_AUX_DISK_1: restoring datafile 00017 to +FRAchannel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:35channel ORA_AUX_DISK_1: starting datafile backup set restorechannel ORA_AUX_DISK_1: using compressed network backup set from service jychannel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup setchannel ORA_AUX_DISK_1: restoring datafile 00018 to +FRAchannel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03channel ORA_AUX_DISK_1: starting datafile backup set restorechannel ORA_AUX_DISK_1: using compressed network backup set from service jychannel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup setchannel ORA_AUX_DISK_1: restoring datafile 00019 to +FRAchannel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:04channel ORA_AUX_DISK_1: starting datafile backup set restorechannel ORA_AUX_DISK_1: using compressed network backup set from service jychannel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup setchannel ORA_AUX_DISK_1: restoring datafile 00020 to +FRAchannel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01channel ORA_AUX_DISK_1: starting datafile backup set restorechannel ORA_AUX_DISK_1: using compressed network backup set from service jychannel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup setchannel ORA_AUX_DISK_1: restoring datafile 00021 to +FRAchannel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:04Finished restore at 19-JAN-18sql statement: alter system archive log currentcurrent log archivedcontents of Memory Script:{ restore clone force from service 'jy' using compressed backupset archivelog from scn 13147698; switch clone datafile all;}executing Memory ScriptStarting restore at 19-JAN-18using channel ORA_AUX_DISK_1channel ORA_AUX_DISK_1: starting archived log restore to default destinationchannel ORA_AUX_DISK_1: using compressed network backup set from service jychannel ORA_AUX_DISK_1: restoring archived logarchived log thread=1 sequence=137channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:08channel ORA_AUX_DISK_1: starting archived log restore to default destinationchannel ORA_AUX_DISK_1: using compressed network backup set from service jychannel ORA_AUX_DISK_1: restoring archived logarchived log thread=1 sequence=138channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01channel ORA_AUX_DISK_1: starting archived log restore to default destinationchannel ORA_AUX_DISK_1: using compressed network backup set from service jychannel ORA_AUX_DISK_1: restoring archived logarchived log thread=1 sequence=139channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:02channel ORA_AUX_DISK_1: starting archived log restore to default destinationchannel ORA_AUX_DISK_1: using compressed network backup set from service jychannel ORA_AUX_DISK_1: restoring archived logarchived log thread=2 sequence=114channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01channel ORA_AUX_DISK_1: starting archived log restore to default destinationchannel ORA_AUX_DISK_1: using compressed network backup set from service jychannel ORA_AUX_DISK_1: restoring archived logarchived log thread=2 sequence=115channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:04Finished restore at 19-JAN-18datafile 1 switched to datafile copyinput datafile copy RECID=24 STAMP=965863480 file name=+FRA/DUP/DATAFILE/system.376.965863053datafile 3 switched to datafile copyinput datafile copy RECID=25 STAMP=965863482 file name=+FRA/DUP/DATAFILE/sysaux.379.965863109datafile 4 switched to datafile copyinput datafile copy RECID=26 STAMP=965863482 file name=+FRA/DUP/DATAFILE/undotbs1.380.965863215datafile 5 switched to datafile copyinput datafile copy RECID=27 STAMP=965863482 file name=+FRA/DUP/5F9AA264B21F3ED9E053AB828A0A6088/DATAFILE/system.381.965863229datafile 6 switched to datafile copyinput datafile copy RECID=28 STAMP=965863482 file name=+FRA/DUP/5F9AA264B21F3ED9E053AB828A0A6088/DATAFILE/sysaux.382.965863245datafile 7 switched to datafile copyinput datafile copy RECID=29 STAMP=965863483 file name=+FRA/DUP/DATAFILE/users.364.965863281datafile 8 switched to datafile copyinput datafile copy RECID=30 STAMP=965863483 file name=+FRA/DUP/5F9AA264B21F3ED9E053AB828A0A6088/DATAFILE/undotbs1.365.965863281datafile 9 switched to datafile copyinput datafile copy RECID=31 STAMP=965863483 file name=+FRA/DUP/DATAFILE/undotbs2.366.965863289datafile 10 switched to datafile copyinput datafile copy RECID=32 STAMP=965863483 file name=+FRA/DUP/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/system.367.965863293datafile 11 switched to datafile copyinput datafile copy RECID=33 STAMP=965863483 file name=+FRA/DUP/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/sysaux.326.965863309datafile 12 switched to datafile copyinput datafile copy RECID=34 STAMP=965863484 file name=+FRA/DUP/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/undotbs1.285.965863345datafile 13 switched to datafile copyinput datafile copy RECID=35 STAMP=965863484 file name=+FRA/DUP/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/undo_2.325.965863349datafile 14 switched to datafile copyinput datafile copy RECID=36 STAMP=965863484 file name=+FRA/DUP/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/users.369.965863351datafile 15 switched to datafile copyinput datafile copy RECID=37 STAMP=965863484 file name=+FRA/DUP/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/test.370.965863387datafile 16 switched to datafile copyinput datafile copy RECID=38 STAMP=965863484 file name=+FRA/DUP/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/system.371.965863391datafile 17 switched to datafile copyinput datafile copy RECID=39 STAMP=965863485 file name=+FRA/DUP/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/sysaux.372.965863407datafile 18 switched to datafile copyinput datafile copy RECID=40 STAMP=965863485 file name=+FRA/DUP/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/undotbs1.373.965863443datafile 19 switched to datafile copyinput datafile copy RECID=41 STAMP=965863485 file name=+FRA/DUP/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/undo_2.375.965863445datafile 20 switched to datafile copyinput datafile copy RECID=42 STAMP=965863485 file name=+FRA/DUP/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/users.377.965863449datafile 21 switched to datafile copyinput datafile copy RECID=43 STAMP=965863485 file name=+FRA/DUP/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/test.378.965863451contents of Memory Script:{ set until scn 13148610; recover clone database delete archivelog ;}executing Memory Scriptexecuting command: SET until clauseStarting recover at 19-JAN-18using channel ORA_AUX_DISK_1starting media recoveryarchived log for thread 1 with sequence 137 is already on disk as file +TEST/arch/dup/1_137_961976319.dbfarchived log for thread 1 with sequence 138 is already on disk as file +TEST/arch/dup/1_138_961976319.dbfarchived log for thread 1 with sequence 139 is already on disk as file +TEST/arch/dup/1_139_961976319.dbfarchived log for thread 2 with sequence 114 is already on disk as file +TEST/arch/dup/2_114_961976319.dbfarchived log for thread 2 with sequence 115 is already on disk as file +TEST/arch/dup/2_115_961976319.dbfarchived log file name=+TEST/arch/dup/2_114_961976319.dbf thread=2 sequence=114archived log file name=+TEST/arch/dup/1_137_961976319.dbf thread=1 sequence=137archived log file name=+TEST/arch/dup/1_138_961976319.dbf thread=1 sequence=138archived log file name=+TEST/arch/dup/2_115_961976319.dbf thread=2 sequence=115archived log file name=+TEST/arch/dup/1_139_961976319.dbf thread=1 sequence=139media recovery complete, elapsed time: 00:00:04Finished recover at 19-JAN-18Oracle instance startedTotal System Global Area 2147483648 bytesFixed Size 8794848 bytesVariable Size 1459621152 bytesDatabase Buffers 671088640 bytesRedo Buffers 7979008 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";}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 startedTotal System Global Area 2147483648 bytesFixed Size 8794848 bytesVariable Size 1459621152 bytesDatabase Buffers 671088640 bytesRedo Buffers 7979008 bytessql statement: CREATE CONTROLFILE REUSE SET DATABASE "DUP" RESETLOGS ARCHIVELOG MAXLOGFILES 192 MAXLOGMEMBERS 3 MAXDATAFILES 1024 MAXINSTANCES 32 MAXLOGHISTORY 292 LOGFILE GROUP 1 ( '+FRA' ) SIZE 200 M REUSE, GROUP 2 ( '+FRA' ) SIZE 200 M REUSE DATAFILE '+FRA/DUP/DATAFILE/system.376.965863053', '+FRA/DUP/5F9AA264B21F3ED9E053AB828A0A6088/DATAFILE/system.381.965863229', '+FRA/DUP/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/system.367.965863293', '+FRA/DUP/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/system.371.965863391' CHARACTER SET ZHS16GBKsql statement: ALTER DATABASE ADD LOGFILE INSTANCE 'i2' GROUP 3 ( '+FRA' ) SIZE 200 M REUSE, GROUP 4 ( '+FRA' ) SIZE 200 M REUSEcontents of Memory Script:{ set newname for tempfile 1 to "+FRA"; set newname for tempfile 2 to "+FRA"; set newname for tempfile 3 to "+FRA"; set newname for tempfile 4 to "+FRA"; switch clone tempfile all; catalog clone datafilecopy "+FRA/DUP/DATAFILE/sysaux.379.965863109", "+FRA/DUP/DATAFILE/undotbs1.380.965863215", "+FRA/DUP/5F9AA264B21F3ED9E053AB828A0A6088/DATAFILE/sysaux.382.965863245", "+FRA/DUP/DATAFILE/users.364.965863281", "+FRA/DUP/5F9AA264B21F3ED9E053AB828A0A6088/DATAFILE/undotbs1.365.965863281", "+FRA/DUP/DATAFILE/undotbs2.366.965863289", "+FRA/DUP/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/sysaux.326.965863309", "+FRA/DUP/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/undotbs1.285.965863345", "+FRA/DUP/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/undo_2.325.965863349", "+FRA/DUP/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/users.369.965863351", "+FRA/DUP/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/test.370.965863387", "+FRA/DUP/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/sysaux.372.965863407", "+FRA/DUP/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/undotbs1.373.965863443", "+FRA/DUP/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/undo_2.375.965863445", "+FRA/DUP/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/users.377.965863449", "+FRA/DUP/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/test.378.965863451"; switch clone datafile all;}executing Memory Scriptexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMErenamed tempfile 1 to +FRA in control filerenamed tempfile 2 to +FRA in control filerenamed tempfile 3 to +FRA in control filerenamed tempfile 4 to +FRA in control filecataloged datafile copydatafile copy file name=+FRA/DUP/DATAFILE/sysaux.379.965863109 RECID=1 STAMP=965863550cataloged datafile copydatafile copy file name=+FRA/DUP/DATAFILE/undotbs1.380.965863215 RECID=2 STAMP=965863550cataloged datafile copydatafile copy file name=+FRA/DUP/5F9AA264B21F3ED9E053AB828A0A6088/DATAFILE/sysaux.382.965863245 RECID=3 STAMP=965863550cataloged datafile copydatafile copy file name=+FRA/DUP/DATAFILE/users.364.965863281 RECID=4 STAMP=965863550cataloged datafile copydatafile copy file name=+FRA/DUP/5F9AA264B21F3ED9E053AB828A0A6088/DATAFILE/undotbs1.365.965863281 RECID=5 STAMP=965863550cataloged datafile copydatafile copy file name=+FRA/DUP/DATAFILE/undotbs2.366.965863289 RECID=6 STAMP=965863550cataloged datafile copydatafile copy file name=+FRA/DUP/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/sysaux.326.965863309 RECID=7 STAMP=965863550cataloged datafile copydatafile copy file name=+FRA/DUP/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/undotbs1.285.965863345 RECID=8 STAMP=965863550cataloged datafile copydatafile copy file name=+FRA/DUP/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/undo_2.325.965863349 RECID=9 STAMP=965863550cataloged datafile copydatafile copy file name=+FRA/DUP/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/users.369.965863351 RECID=10 STAMP=965863551cataloged datafile copydatafile copy file name=+FRA/DUP/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/test.370.965863387 RECID=11 STAMP=965863551cataloged datafile copydatafile copy file name=+FRA/DUP/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/sysaux.372.965863407 RECID=12 STAMP=965863551cataloged datafile copydatafile copy file name=+FRA/DUP/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/undotbs1.373.965863443 RECID=13 STAMP=965863551cataloged datafile copydatafile copy file name=+FRA/DUP/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/undo_2.375.965863445 RECID=14 STAMP=965863551cataloged datafile copydatafile copy file name=+FRA/DUP/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/users.377.965863449 RECID=15 STAMP=965863551cataloged datafile copydatafile copy file name=+FRA/DUP/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/test.378.965863451 RECID=16 STAMP=965863551datafile 3 switched to datafile copyinput datafile copy RECID=1 STAMP=965863550 file name=+FRA/DUP/DATAFILE/sysaux.379.965863109datafile 4 switched to datafile copyinput datafile copy RECID=2 STAMP=965863550 file name=+FRA/DUP/DATAFILE/undotbs1.380.965863215datafile 6 switched to datafile copyinput datafile copy RECID=3 STAMP=965863550 file name=+FRA/DUP/5F9AA264B21F3ED9E053AB828A0A6088/DATAFILE/sysaux.382.965863245datafile 7 switched to datafile copyinput datafile copy RECID=4 STAMP=965863550 file name=+FRA/DUP/DATAFILE/users.364.965863281datafile 8 switched to datafile copyinput datafile copy RECID=5 STAMP=965863550 file name=+FRA/DUP/5F9AA264B21F3ED9E053AB828A0A6088/DATAFILE/undotbs1.365.965863281datafile 9 switched to datafile copyinput datafile copy RECID=6 STAMP=965863550 file name=+FRA/DUP/DATAFILE/undotbs2.366.965863289datafile 11 switched to datafile copyinput datafile copy RECID=7 STAMP=965863550 file name=+FRA/DUP/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/sysaux.326.965863309datafile 12 switched to datafile copyinput datafile copy RECID=8 STAMP=965863550 file name=+FRA/DUP/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/undotbs1.285.965863345datafile 13 switched to datafile copyinput datafile copy RECID=9 STAMP=965863550 file name=+FRA/DUP/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/undo_2.325.965863349datafile 14 switched to datafile copyinput datafile copy RECID=10 STAMP=965863551 file name=+FRA/DUP/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/users.369.965863351datafile 15 switched to datafile copyinput datafile copy RECID=11 STAMP=965863551 file name=+FRA/DUP/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/test.370.965863387datafile 17 switched to datafile copyinput datafile copy RECID=12 STAMP=965863551 file name=+FRA/DUP/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/sysaux.372.965863407datafile 18 switched to datafile copyinput datafile copy RECID=13 STAMP=965863551 file name=+FRA/DUP/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/undotbs1.373.965863443datafile 19 switched to datafile copyinput datafile copy RECID=14 STAMP=965863551 file name=+FRA/DUP/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/undo_2.375.965863445datafile 20 switched to datafile copyinput datafile copy RECID=15 STAMP=965863551 file name=+FRA/DUP/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/users.377.965863449datafile 21 switched to datafile copyinput datafile copy RECID=16 STAMP=965863551 file name=+FRA/DUP/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/test.378.965863451contents of Memory Script:{ Alter clone database open resetlogs;}executing Memory Scriptdatabase openedcontents of Memory Script:{ sql clone "alter pluggable database all open";}executing Memory Scriptsql statement: alter pluggable database all openFinished Duplicate Db at 19-JAN-18
10.检查数据是否一致
在源数据库查询表记录
SQL> conn sys/abcd@jy as sysdbaConnected.SQL> show parameter db_nameNAME TYPE VALUE------------------------------------ ----------- ------------------------------db_name string jySQL> alter session set container=jypdb;Session altered.SQL> select count(*) from JY.SALES_Q3_1998; COUNT(*)---------- 50515
在目标数据库查询表记录
SQL> conn sys/abcd@dup as sysdbaConnected.SQL> show parameter db_nameNAME TYPE VALUE------------------------------------ ----------- ------------------------------db_name string DUPSQL> alter session set container=jypdb;Session altered.SQL> select count(*) from JY.SALES_Q3_1998; COUNT(*)---------- 50515
"怎么复制一个RAC CDB数据库"的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注网站,小编将为大家输出更多高质量的实用文章!
数据
数据库
文件
目标
主机
目录
日志
存储
参数
实例
内容
密码
更多
查询表
知识
网络
网络服务
控制
服务
查询
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
数据库技术及应用超星答案
sql创建服务器登录名
网络安全手抄报带边框
东城十二时辰网络安全
网络安全技术支持岗位职责
网络安全攻防大赛方案豆丁
网络安全能解决哪些问题
软件开发工程师如何转互联网
dell服务器管理端口
数据库范例
网络安全检查考察制度
360智库网络安全
专利在哪个数据库
中国公安部网络安全保卫局
中国移动网络安全方案安全上网
杭州爵创网络技术
衡阳深圳网络安全培训收费标准
网络安全违规行为规定
文件管理是不是服务器功能
浙江无卡支付软件开发
服务器2021年报告
微软服务器管理工具
手机软件开发前端
pptv如何删除多屏互动服务器
tcmid数据库
媒资数据库服务器r720
网络安全大赛是打游戏吗
艾尔登法环服务器登不进去
网络安全概论题目及答案
软件开发成本核算系统