如何使用RMAN对CDB中的PDB进行复制
发表于:2025-01-20 作者:千家信息网编辑
千家信息网最后更新 2025年01月20日,本篇内容主要讲解"如何使用RMAN对CDB中的PDB进行复制",感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习"如何使用RMAN对CDB中的PDB进行复制"吧!
千家信息网最后更新 2025年01月20日如何使用RMAN对CDB中的PDB进行复制
本篇内容主要讲解"如何使用RMAN对CDB中的PDB进行复制",感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习"如何使用RMAN对CDB中的PDB进行复制"吧!
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.在目标主机上创建存储目标数据库(dupjy)相关数据库文件的目录,目标主机上的/u01/app/oracle/oradata/dupjy目录用来存储数据库的数据文件,控制文件,联机重做日志文件),/u01/app/oracle/arch/dupjy目录用来存储数据库的归档重做日志文件。
3.将源数据库的密码文件复制到目标主机的相应目录中并修改为目标数据库(dupjy)对应的文件名
[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 ~]$ asmcmd cp +DATA/JY/PASSWORD/pwdjy.274.961976109 /home/grid/pwddupjycopying +DATA/JY/PASSWORD/pwdjy.274.961976109 -> /home/grid/pwddupjy[oracle@shard1 dbs]# scp grid@10.138.130.171:/home/grid/pwddupjy /u01/app/oracle/product/12.2.0/db/dbs/The authenticity of host '10.138.130.171 (10.138.130.171)' can't be established.ECDSA key fingerprint is 7a:62:58:8b:77:98:52:94:d6:d5:0c:c4:6c:87:a6:7f.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added '10.138.130.171' (ECDSA) to the list of known hosts.grid@10.138.130.171's password:pwddupjy[oracle@shard1 dbs]$ mv pwddupjy orapwdupjy
4.使用源数据库的spfile文件来创建目标数据库要使用的spfile文件
在源数据库中执行下面的命令来创建pfile参数文件
SQL> create pfile from spfile;File created.[root@shard1 ~]# scp oracle@10.138.130.171:/u01/app/oracle/product/12.2.0/db/dbs/initjy1.ora /u01/app/oracle/product/12.2.0/db/dbs/grid@10.138.130.171's password:initjy1.ora 100% 1731 1.7KB/s 00:00[root@shard1 ~]#[oracle@shard1 dbs]$ cat initdupjy.ora*.audit_file_dest='/u01/app/oracle/admin/dupjy/adump'*.cluster_database=false*.compatible='12.2.0'*.control_files='/u01/app/oracle/oradata/dupjy/control01.ctl'*.db_block_size=8192*.db_name='dupjy'*.diagnostic_dest='/u01/app/oracle'*.enable_pluggable_database=true*.open_cursors=300*.pga_aggregate_target=1g*.processes=2000*.remote_login_passwordfile='exclusive'*.sga_max_size=2147483648*.sga_target=2147483648db_file_name_convert= ('+DATA/JY/DATAFILE/','/u01/app/oracle/oradata/dupjy/','+DATA/JY/5F9AA264B21F3ED9E053AB828A0A6088/DATAFILE/','/u01/app/oracle/oradata/dupjy/','+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATA FILE/','/u01/app/oracle/oradata/dupjy/','+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/','/u01/app/oracle/oradata/dupjy/')log_file_name_convert=('+DATA/JY/ONLINELOG/','/u01/app/oracle/oradata/dupjy/')[oracle@shard1 dbs]$ export ORACLE_SID=dupjy[oracle@shard1 dbs]$ sqlplus / as sysdbaSQL*Plus: Release 12.2.0.1.0 Production on Thu Jan 18 19:06:00 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/initdupjy.ora'ORACLE instance started.Total System Global Area 2147483648 bytesFixed Size 8794848 bytesVariable Size 570428704 bytesDatabase Buffers 1560281088 bytesRedo Buffers 7979008 bytesSQL> create spfile from pfile='/u01/app/oracle/product/12.2.0/db/dbs/initdupjy.ora';File created.
5.使用spfile参数文件来启动目标数据库实例(辅助实例dupjy)
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/spfiledupjy.ora
6.给目标数据库配置静态监听
[oracle@shard1 admin]$ vi listener.ora# listener.ora Network Configuration File: /u01/app/oracle/product/12.2.0/db/network/admin/listener.ora# Generated by Oracle configuration tools.LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = shard1)(PORT = 1521)) (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) )SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = dupjy) (ORACLE_HOME = /u01/app/oracle/product/12.2.0/db) (GLOBAL_DBNAME=dupjy) ) )[oracle@shard1 admin]$ lsnrctl startLSNRCTL for Linux: Version 12.2.0.1.0 - Production on 18-JAN-2018 20:30:34Copyright (c) 1991, 2016, Oracle. All rights reserved.Starting /u01/app/oracle/product/12.2.0/db/bin/tnslsnr: please wait...TNSLSNR for Linux: Version 12.2.0.1.0 - ProductionSystem parameter file is /u01/app/oracle/product/12.2.0/db/network/admin/listener.oraLog messages written to /u01/app/oracle/diag/tnslsnr/shard1/listener/alert/log.xmlListening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=shard1)(PORT=1521)))Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=shard1)(PORT=1521)))STATUS of the LISTENER------------------------Alias LISTENERVersion TNSLSNR for Linux: Version 12.2.0.1.0 - ProductionStart Date 18-JAN-2018 20:30:34Uptime 0 days 0 hr. 0 min. 0 secTrace Level offSecurity ON: Local OS AuthenticationSNMP OFFListener Parameter File /u01/app/oracle/product/12.2.0/db/network/admin/listener.oraListener Log File /u01/app/oracle/diag/tnslsnr/shard1/listener/alert/log.xmlListening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=shard1)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))Services Summary...Service "dupjy" has 1 instance(s). Instance "dupjy", status UNKNOWN, has 1 handler(s) for this service...The command completed successfully
7.在目标主机上配置tns,用来通过网络服务名来连接源数据库与目标数据库
[oracle@shard1 admin]$ vi tnsnames.ora# tnsnames.ora Network Configuration File: /u01/app/oracle/product/12.2.0/db/network/admin/tnsnames.ora# Generated by Oracle configuration tools.JY = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.138.130.171)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = jy) ) )DUPJY = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.138.130.180)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = dupjy) ) )
8.在目标主机上测试是否可以通过使用网络服务名来连接源数据库与目标数据库
[oracle@shard1 admin]$ sqlplus /nologSQL*Plus: Release 12.2.0.1.0 Production on Thu Jan 18 21:02:53 2018Copyright (c) 1982, 2016, Oracle. All rights reserved.SQL> conn / as sysdbaConnected.SQL> startup nomountORACLE instance started.Total System Global Area 2147483648 bytesFixed Size 8794848 bytesVariable Size 570428704 bytesDatabase Buffers 1560281088 bytesRedo Buffers 7979008 bytesSQL> exitDisconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production[oracle@shard1 admin]$ sqlplus /nologSQL*Plus: Release 12.2.0.1.0 Production on Thu Jan 18 21:04:51 2018Copyright (c) 1982, 2016, Oracle. All rights reserved.SQL> conn sys/abcd@dupjy as sysdbaConnected.SQL> conn sys/abcd@jy as sysdbaConnected.
9.在源主机上配置目标数据库的tns名
[oracle@jytest1 admin]$ vi tnsnames.ora# tnsnames.ora Network Configuration File: /u01/app/oracle/product/12.2.0/db/network/admin/tnsnames.ora# Generated by Oracle configuration tools.JY = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = jytest-scan)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = jy) ) )DUPJY = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.138.130.180)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = dupjy) (UR = A) ) )
10.在源主机上测试能否可以使用网络服务名来连接源数据库与目标数据库
[oracle@jytest1 admin]$ sqlplus /nologSQL*Plus: Release 12.2.0.1.0 Production on Fri Jan 19 03:16:59 2018Copyright (c) 1982, 2016, Oracle. All rights reserved.SQL> conn sys/abcd@jy as sysdbaConnected.SQL> conn sys/abcd@dupjy as sysdbaConnected.
11.执行PDB数据库复制
[oracle@jytest1 ~]$ rman target sys/abcd@jy catalog rco/abcd@jypdb_173 auxiliary sys/abcd@dupjyRecovery Manager: Release 12.2.0.1.0 - Production on Tue Jan 23 17:47:09 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: DUPJY (not mounted)RMAN> duplicate database to dupjy pluggable database jypdb from active database nofilenamecheck using compressed backupset;Starting Duplicate Db at 23-JAN-18allocated channel: ORA_AUX_DISK_1channel ORA_AUX_DISK_1: SID=2269 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 = ''DUPJY'' 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 = ''DUPJY'' comment= ''Modified by RMAN duplicate'' scope=spfileOracle instance shut downOracle instance startedTotal System Global Area 2147483648 bytesFixed Size 8794848 bytesVariable Size 1056967968 bytesDatabase Buffers 1073741824 bytesRedo Buffers 7979008 bytesStarting restore at 23-JAN-18allocated channel: ORA_AUX_DISK_1channel ORA_AUX_DISK_1: SID=2269 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=/u01/app/oracle/oradata/dupjy/control01.ctlFinished restore at 23-JAN-18database mountedSkipping pluggable database TESTPDBAutomatically adding tablespace SYSTEMAutomatically adding tablespace SYSAUXAutomatically adding tablespace PDB$SEED:SYSTEMAutomatically adding tablespace PDB$SEED:SYSAUXAutomatically adding tablespace TESTPDB:SYSTEMAutomatically adding tablespace TESTPDB:UNDOTBS1Automatically adding tablespace UNDOTBS1Automatically adding tablespace TESTPDB:UNDO_2Automatically adding tablespace UNDOTBS2Skipping tablespace USERSRMAN-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 "/u01/app/oracle/oradata/dupjy/system.317.962209603"; set newname for datafile 3 to "/u01/app/oracle/oradata/dupjy/sysaux.298.962209605"; set newname for datafile 4 to "/u01/app/oracle/oradata/dupjy/undotbs1.277.962209605"; set newname for datafile 5 to "/u01/app/oracle/oradata/dupjy/system.256.962209675"; set newname for datafile 6 to "/u01/app/oracle/oradata/dupjy/sysaux.270.962209675"; set newname for datafile 8 to "/u01/app/oracle/oradata/dupjy/undotbs1.296.962209675"; set newname for datafile 9 to "/u01/app/oracle/oradata/dupjy/undotbs2.312.962209605"; set newname for datafile 10 to "/u01/app/oracle/oradata/dupjy/system.271.962209649"; set newname for datafile 11 to "/u01/app/oracle/oradata/dupjy/sysaux.316.962209649"; set newname for datafile 12 to "/u01/app/oracle/oradata/dupjy/undotbs1.264.962209649"; set newname for datafile 13 to "/u01/app/oracle/oradata/dupjy/undo_2.268.962209649"; set newname for datafile 14 to "/u01/app/oracle/oradata/dupjy/users.278.962209649"; set newname for datafile 15 to "/u01/app/oracle/oradata/dupjy/test.275.962210609"; restore from nonsparse from service 'jy' using compressed backupset clone database skip forever tablespace "USERS", "TESTPDB":"USERS", "TESTPDB":"UNDO_2", "TESTPDB":"UNDOTBS1", "TESTPDB":"TEST", "TESTPDB":"SYSTEM", "TESTPDB":"SYSAUX" ; 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 NEWNAMEStarting restore at 23-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 /u01/app/oracle/oradata/dupjy/system.317.962209603channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:45channel 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 /u01/app/oracle/oradata/dupjy/sysaux.298.962209605channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:01: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 00004 to /u01/app/oracle/oradata/dupjy/undotbs1.277.962209605channel 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 00005 to /u01/app/oracle/oradata/dupjy/system.256.962209675channel 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 /u01/app/oracle/oradata/dupjy/sysaux.270.962209675channel 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 00008 to /u01/app/oracle/oradata/dupjy/undotbs1.296.962209675channel 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 00009 to /u01/app/oracle/oradata/dupjy/undotbs2.312.962209605channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:26channel 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 /u01/app/oracle/oradata/dupjy/system.271.962209649channel 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 /u01/app/oracle/oradata/dupjy/sysaux.316.962209649channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00: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 00012 to /u01/app/oracle/oradata/dupjy/undotbs1.264.962209649channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:08channel 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 /u01/app/oracle/oradata/dupjy/undo_2.268.962209649channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:08channel 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 /u01/app/oracle/oradata/dupjy/users.278.962209649channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:01:05channel 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 /u01/app/oracle/oradata/dupjy/test.275.962210609channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:04Finished restore at 23-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 15660582; switch clone datafile all;}executing Memory ScriptStarting restore at 23-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=163channel 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=1 sequence=164channel 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=1 sequence=165channel 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=144channel 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=145channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:02Finished restore at 23-JAN-18datafile 1 switched to datafile copyinput datafile copy RECID=17 STAMP=966167434 file name=/u01/app/oracle/oradata/dupjy/system.317.962209603datafile 3 switched to datafile copyinput datafile copy RECID=18 STAMP=966167434 file name=/u01/app/oracle/oradata/dupjy/sysaux.298.962209605datafile 4 switched to datafile copyinput datafile copy RECID=19 STAMP=966167434 file name=/u01/app/oracle/oradata/dupjy/undotbs1.277.962209605datafile 5 switched to datafile copyinput datafile copy RECID=20 STAMP=966167434 file name=/u01/app/oracle/oradata/dupjy/system.256.962209675datafile 6 switched to datafile copyinput datafile copy RECID=21 STAMP=966167434 file name=/u01/app/oracle/oradata/dupjy/sysaux.270.962209675datafile 8 switched to datafile copyinput datafile copy RECID=22 STAMP=966167434 file name=/u01/app/oracle/oradata/dupjy/undotbs1.296.962209675datafile 9 switched to datafile copyinput datafile copy RECID=23 STAMP=966167434 file name=/u01/app/oracle/oradata/dupjy/undotbs2.312.962209605datafile 10 switched to datafile copyinput datafile copy RECID=24 STAMP=966167434 file name=/u01/app/oracle/oradata/dupjy/system.271.962209649datafile 11 switched to datafile copyinput datafile copy RECID=25 STAMP=966167434 file name=/u01/app/oracle/oradata/dupjy/sysaux.316.962209649datafile 12 switched to datafile copyinput datafile copy RECID=26 STAMP=966167435 file name=/u01/app/oracle/oradata/dupjy/undotbs1.264.962209649datafile 13 switched to datafile copyinput datafile copy RECID=27 STAMP=966167435 file name=/u01/app/oracle/oradata/dupjy/undo_2.268.962209649datafile 14 switched to datafile copyinput datafile copy RECID=28 STAMP=966167435 file name=/u01/app/oracle/oradata/dupjy/users.278.962209649datafile 15 switched to datafile copyinput datafile copy RECID=29 STAMP=966167435 file name=/u01/app/oracle/oradata/dupjy/test.275.962210609contents of Memory Script:{ set until scn 15661286; recover clone database skip forever tablespace "USERS", "TESTPDB":"USERS", "TESTPDB":"UNDO_2", "TESTPDB":"UNDOTBS1", "TESTPDB":"TEST", "TESTPDB":"SYSTEM", "TESTPDB":"SYSAUX" delete archivelog ;}executing Memory Scriptexecuting command: SET until clauseStarting recover at 23-JAN-18using channel ORA_AUX_DISK_1Executing: alter database datafile 7 offline dropExecuting: alter database datafile 20 offline dropExecuting: alter database datafile 19 offline dropExecuting: alter database datafile 18 offline dropExecuting: alter database datafile 21 offline dropExecuting: alter database datafile 16 offline dropExecuting: alter database datafile 17 offline dropstarting media recoveryarchived log for thread 1 with sequence 164 is already on disk as file /u01/app/oracle/oradata/arch_dupjy/1_164_961976319.dbfarchived log for thread 1 with sequence 165 is already on disk as file /u01/app/oracle/oradata/arch_dupjy/1_165_961976319.dbfarchived log for thread 2 with sequence 144 is already on disk as file /u01/app/oracle/oradata/arch_dupjy/2_144_961976319.dbfarchived log for thread 2 with sequence 145 is already on disk as file /u01/app/oracle/oradata/arch_dupjy/2_145_961976319.dbfarchived log file name=/u01/app/oracle/oradata/arch_dupjy/1_164_961976319.dbf thread=1 sequence=164archived log file name=/u01/app/oracle/oradata/arch_dupjy/2_144_961976319.dbf thread=2 sequence=144archived log file name=/u01/app/oracle/oradata/arch_dupjy/1_165_961976319.dbf thread=1 sequence=165archived log file name=/u01/app/oracle/oradata/arch_dupjy/2_145_961976319.dbf thread=2 sequence=145media recovery complete, elapsed time: 00:00:02Finished recover at 23-JAN-18Oracle instance startedTotal System Global Area 2147483648 bytesFixed Size 8794848 bytesVariable Size 1056967968 bytesDatabase Buffers 1073741824 bytesRedo Buffers 7979008 bytescontents of Memory Script:{ sql clone "alter system set db_name = ''DUPJY'' 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 = ''DUPJY'' 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 1056967968 bytesDatabase Buffers 1073741824 bytesRedo Buffers 7979008 bytessql statement: CREATE CONTROLFILE REUSE SET DATABASE "DUPJY" RESETLOGS ARCHIVELOG MAXLOGFILES 192 MAXLOGMEMBERS 3 MAXDATAFILES 1024 MAXINSTANCES 32 MAXLOGHISTORY 292 LOGFILE GROUP 1 ( '/u01/app/oracle/oradata/dupjy/group_1.261.961976319' ) SIZE 200 M REUSE, GROUP 2 ( '/u01/app/oracle/oradata/dupjy/group_2.302.961976321' ) SIZE 200 M REUSE DATAFILE '/u01/app/oracle/oradata/dupjy/system.317.962209603', '/u01/app/oracle/oradata/dupjy/system.256.962209675', '/u01/app/oracle/oradata/dupjy/system.271.962209649' CHARACTER SET ZHS16GBKsql statement: ALTER DATABASE ADD LOGFILE INSTANCE 'i2' GROUP 3 ( '/u01/app/oracle/oradata/dupjy/group_3.263.961976697' ) SIZE 200 M REUSE, GROUP 4 ( '/u01/app/oracle/oradata/dupjy/group_4.262.961976705' ) SIZE 200 M REUSEcontents of Memory Script:{ set newname for tempfile 1 to "+DATA"; set newname for tempfile 2 to "+DATA"; set newname for tempfile 3 to "+DATA"; switch clone tempfile all; catalog clone datafilecopy "/u01/app/oracle/oradata/dupjy/sysaux.298.962209605", "/u01/app/oracle/oradata/dupjy/undotbs1.277.962209605", "/u01/app/oracle/oradata/dupjy/sysaux.270.962209675", "/u01/app/oracle/oradata/dupjy/undotbs1.296.962209675", "/u01/app/oracle/oradata/dupjy/undotbs2.312.962209605", "/u01/app/oracle/oradata/dupjy/sysaux.316.962209649", "/u01/app/oracle/oradata/dupjy/undotbs1.264.962209649", "/u01/app/oracle/oradata/dupjy/undo_2.268.962209649", "/u01/app/oracle/oradata/dupjy/users.278.962209649", "/u01/app/oracle/oradata/dupjy/test.275.962210609"; switch clone datafile all;}executing Memory Scriptexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMErenamed tempfile 1 to +DATA in control filerenamed tempfile 2 to +DATA in control filerenamed tempfile 3 to +DATA in control filecataloged datafile copydatafile copy file name=/u01/app/oracle/oradata/dupjy/sysaux.298.962209605 RECID=1 STAMP=966167470cataloged datafile copydatafile copy file name=/u01/app/oracle/oradata/dupjy/undotbs1.277.962209605 RECID=2 STAMP=966167471cataloged datafile copydatafile copy file name=/u01/app/oracle/oradata/dupjy/sysaux.270.962209675 RECID=3 STAMP=966167471cataloged datafile copydatafile copy file name=/u01/app/oracle/oradata/dupjy/undotbs1.296.962209675 RECID=4 STAMP=966167471cataloged datafile copydatafile copy file name=/u01/app/oracle/oradata/dupjy/undotbs2.312.962209605 RECID=5 STAMP=966167471cataloged datafile copydatafile copy file name=/u01/app/oracle/oradata/dupjy/sysaux.316.962209649 RECID=6 STAMP=966167471cataloged datafile copydatafile copy file name=/u01/app/oracle/oradata/dupjy/undotbs1.264.962209649 RECID=7 STAMP=966167471cataloged datafile copydatafile copy file name=/u01/app/oracle/oradata/dupjy/undo_2.268.962209649 RECID=8 STAMP=966167471cataloged datafile copydatafile copy file name=/u01/app/oracle/oradata/dupjy/users.278.962209649 RECID=9 STAMP=966167471cataloged datafile copydatafile copy file name=/u01/app/oracle/oradata/dupjy/test.275.962210609 RECID=10 STAMP=966167471datafile 3 switched to datafile copyinput datafile copy RECID=1 STAMP=966167470 file name=/u01/app/oracle/oradata/dupjy/sysaux.298.962209605datafile 4 switched to datafile copyinput datafile copy RECID=2 STAMP=966167471 file name=/u01/app/oracle/oradata/dupjy/undotbs1.277.962209605datafile 6 switched to datafile copyinput datafile copy RECID=3 STAMP=966167471 file name=/u01/app/oracle/oradata/dupjy/sysaux.270.962209675datafile 8 switched to datafile copyinput datafile copy RECID=4 STAMP=966167471 file name=/u01/app/oracle/oradata/dupjy/undotbs1.296.962209675datafile 9 switched to datafile copyinput datafile copy RECID=5 STAMP=966167471 file name=/u01/app/oracle/oradata/dupjy/undotbs2.312.962209605datafile 11 switched to datafile copyinput datafile copy RECID=6 STAMP=966167471 file name=/u01/app/oracle/oradata/dupjy/sysaux.316.962209649datafile 12 switched to datafile copyinput datafile copy RECID=7 STAMP=966167471 file name=/u01/app/oracle/oradata/dupjy/undotbs1.264.962209649datafile 13 switched to datafile copyinput datafile copy RECID=8 STAMP=966167471 file name=/u01/app/oracle/oradata/dupjy/undo_2.268.962209649datafile 14 switched to datafile copyinput datafile copy RECID=9 STAMP=966167471 file name=/u01/app/oracle/oradata/dupjy/users.278.962209649datafile 15 switched to datafile copyinput datafile copy RECID=10 STAMP=966167471 file name=/u01/app/oracle/oradata/dupjy/test.275.962210609contents of Memory Script:{ Alter clone database open resetlogs;}executing Memory Scriptdatabase openedExecuting: drop pluggable database "TESTPDB" including datafilescontents of Memory Script:{ sql clone "alter pluggable database all open";}executing Memory Scriptsql statement: alter pluggable database all openDropping offline and skipped tablespacesExecuting: alter database default tablespace systemExecuting: drop tablespace "USERS" including contents cascade constraintsFinished Duplicate Db at 23-JAN-18
12.检查源数据库中的PDB(jypdb)是否被成功复制到目标数据库dupjy中
SQL> select name,open_mode from v$pdbs;NAME OPEN_MODE-------------------------------------------------------------------------------------------------------------------------------- ----------PDB$SEED READ ONLYJYPDB READ WRITE
到此,相信大家对"如何使用RMAN对CDB中的PDB进行复制"有了更深的了解,不妨来实际操作一番吧!这里是网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!
数据
数据库
文件
目标
主机
目录
日志
存储
参数
网络
网络服务
服务
配置
内容
实例
学习
控制
检查
测试
实用
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
傲鹏系统数据库表结构
异形丛生服务器搭建
设计一个土木工程数据库
软件开发老板面试
服务器搭建游戏主机
协同软件开发费用多少钱
数据库没有备份
国家网络安全标题
怎么查服务器是安卓还是ios
软件开发公司技术入股合同
江苏众道生鲜软件开发
用c语言设计数据库
广州知商互联网科技面试
poi数据库免费下载
win7进网络安全
山东计算机网络技术可报考院校
数据库的删除
我是幸存者手游服务器崩了
数据库开发 可视化
成都404网络技术公司
戴尔720服务器如何
网络安全阅读角
数据库外键显示外键信息
前端软件开发要求
河北项目软件开发费用是多少
软件开发属于第二还是第三
南开区应用软件开发服务技术规范
青海网络安全保护制度
武鸣网络安全演练
电脑网络安全模式有啥用