怎么将源RAC CDB数据库复制成为单实例CDB数据库
这篇文章主要介绍"怎么将源RAC CDB数据库复制成为单实例CDB数据库",在日常操作中,相信很多人在怎么将源RAC CDB数据库复制成为单实例CDB数据库问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答"怎么将源RAC CDB数据库复制成为单实例CDB数据库"的疑惑有所帮助!接下来,请跟着小编一起来学习吧!
不连接目标数据库和恢复目录使用备份来将RAC CDB复制成单实例CDB数据库操作如下
1.检查源RAC CDB(jy)的参数文件,数据文件,联机日志文件,控制文件,归档日志文件的存储目录
SQL> show parameter spfileNAME TYPE VALUE------------------------------------ ----------- --------------------------------------------spfile string +DATA/JY/PARAMETERFILE/spfile.303.961976713RMAN> report schema;Report of database schema for database with db_unique_name JYList of Permanent Datafiles===========================File Size(MB) Tablespace RB segs Datafile Name---- -------- -------------------- ------- ------------------------1 840 SYSTEM YES +DATA/JY/DATAFILE/system.317.9622096033 2340 SYSAUX NO +DATA/JY/DATAFILE/sysaux.298.9622096054 1015 UNDOTBS1 YES +DATA/JY/DATAFILE/undotbs1.277.9622096055 250 PDB$SEED:SYSTEM NO +DATA/JY/5F9AA264B21F3ED9E053AB828A0A6088/DATAFILE/system.256.9622096756 340 PDB$SEED:SYSAUX NO +DATA/JY/5F9AA264B21F3ED9E053AB828A0A6088/DATAFILE/sysaux.270.9622096757 5 USERS NO +DATA/JY/DATAFILE/users.301.9622096058 100 PDB$SEED:UNDOTBS1 NO +DATA/JY/5F9AA264B21F3ED9E053AB828A0A6088/DATAFILE/undotbs1.296.9622096759 1350 UNDOTBS2 YES +DATA/JY/DATAFILE/undotbs2.312.96220960510 270 JYPDB:SYSTEM YES +DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/system.271.96220964911 590 JYPDB:SYSAUX NO +DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/sysaux.316.96220964912 205 JYPDB:UNDOTBS1 YES +DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/undotbs1.264.96220964913 310 JYPDB:UNDO_2 YES +DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/undo_2.268.96220964914 1267 JYPDB:USERS NO +DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/users.278.96220964915 100 JYPDB:TEST NO +DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/test.275.96221060916 260 TESTPDB:SYSTEM YES +DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/system.260.96246940917 550 TESTPDB:SYSAUX NO +DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/sysaux.259.96246940918 245 TESTPDB:UNDOTBS1 YES +DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/undotbs1.265.96246940919 100 TESTPDB:UNDO_2 YES +DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/undo_2.266.96246940920 5 TESTPDB:USERS NO +DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/users.267.96246940921 100 TESTPDB:TEST NO +DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/test.269.962469409List of Temporary Files=======================File Size(MB) Tablespace Maxsize(MB) Tempfile Name---- -------- -------------------- ----------- --------------------1 144 TEMP 32767 +DATA/JY/TEMPFILE/temp.299.9619763392 64 PDB$SEED:TEMP 32767 +DATA/JY/5F9AA264B21F3ED9E053AB828A0A6088/TEMPFILE/temp.297.9622098653 137 JYPDB:TEMP 32767 +DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/TEMPFILE/temp.276.9622105194 135 TESTPDB:TEMP 32767 +DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/TEMPFILE/temp.258.962469435SQL> 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.对源RAC CDB数据库创建RMAN备份,这里将远程主机的目录/ora_backup通过nfs挂载到源主机的/ora_backup目录这样可以避免对备份文件进行复制操作
[oracle@jytest1 ~]$ rman target/ catalog rco/abcd@jypdb_173Recovery Manager: Release 12.2.0.1.0 - Production on Wed Jan 24 19:47:12 2018Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved.connected to target database: JY (DBID=979425723)connected to recovery catalog databaseRMAN> run2> {3> backup as compressed backupset database format '/ora_backup/jy_%u_%d_%t_%s_%p' plus archivelog format '/ora_backup/arch_%d_%T_%U';4> backup current controlfile format'/ora_backup/%d_%s.ctl';5> backup spfile format '/ora_backup/spf%d_%s.ora';6> }Starting backup at 24-JAN-18current log archivedallocated channel: ORA_DISK_1channel ORA_DISK_1: SID=385 instance=jy1 device type=DISKchannel ORA_DISK_1: starting compressed archived log backup setchannel ORA_DISK_1: specifying archived log(s) in backup setinput archived log thread=2 sequence=141 RECID=320 STAMP=966188816input archived log thread=1 sequence=161 RECID=321 STAMP=966188818input archived log thread=2 sequence=142 RECID=323 STAMP=966188832input archived log thread=1 sequence=162 RECID=322 STAMP=966188829input archived log thread=1 sequence=163 RECID=325 STAMP=966188842input archived log thread=2 sequence=143 RECID=324 STAMP=966188842input archived log thread=2 sequence=144 RECID=327 STAMP=966189268input archived log thread=1 sequence=164 RECID=326 STAMP=966189266input archived log thread=1 sequence=165 RECID=328 STAMP=966189274input archived log thread=2 sequence=145 RECID=329 STAMP=966189274input archived log thread=1 sequence=166 RECID=330 STAMP=966192976input archived log thread=2 sequence=146 RECID=331 STAMP=966192977input archived log thread=1 sequence=167 RECID=333 STAMP=966193374input archived log thread=2 sequence=147 RECID=332 STAMP=966193373input archived log thread=2 sequence=148 RECID=334 STAMP=966193380input archived log thread=1 sequence=168 RECID=335 STAMP=966193380input archived log thread=1 sequence=169 RECID=336 STAMP=966207796input archived log thread=2 sequence=149 RECID=338 STAMP=966208644input archived log thread=1 sequence=170 RECID=337 STAMP=966208634input archived log thread=1 sequence=171 RECID=339 STAMP=966208856input archived log thread=2 sequence=150 RECID=340 STAMP=966208857input archived log thread=1 sequence=172 RECID=341 STAMP=966209350input archived log thread=2 sequence=151 RECID=342 STAMP=966209350input archived log thread=1 sequence=173 RECID=344 STAMP=966209356input archived log thread=2 sequence=152 RECID=343 STAMP=966209356input archived log thread=2 sequence=153 RECID=346 STAMP=966246980input archived log thread=1 sequence=174 RECID=345 STAMP=966246243input archived log thread=1 sequence=175 RECID=347 STAMP=966271688input archived log thread=2 sequence=154 RECID=349 STAMP=966282445input archived log thread=1 sequence=176 RECID=348 STAMP=966282440channel ORA_DISK_1: starting piece 1 at 24-JAN-18channel ORA_DISK_1: finished piece 1 at 24-JAN-18piece handle=/ora_backup/arch_JY_20180124_78spgj6g_1_1 tag=TAG20180124T194727 comment=NONEchannel ORA_DISK_1: backup set complete, elapsed time: 00:01:45Finished backup at 24-JAN-18Starting backup at 24-JAN-18using channel ORA_DISK_1channel ORA_DISK_1: starting compressed full datafile backup setchannel ORA_DISK_1: specifying datafile(s) in backup setinput datafile file number=00003 name=+DATA/JY/DATAFILE/sysaux.298.962209605input datafile file number=00009 name=+DATA/JY/DATAFILE/undotbs2.312.962209605input datafile file number=00004 name=+DATA/JY/DATAFILE/undotbs1.277.962209605input datafile file number=00001 name=+DATA/JY/DATAFILE/system.317.962209603input datafile file number=00007 name=+DATA/JY/DATAFILE/users.301.962209605channel ORA_DISK_1: starting piece 1 at 24-JAN-18channel ORA_DISK_1: finished piece 1 at 24-JAN-18piece handle=/ora_backup/jy_79spgj9s_JY_966282556_233_1 tag=TAG20180124T194913 comment=NONEchannel ORA_DISK_1: backup set complete, elapsed time: 00:02:55channel ORA_DISK_1: starting compressed full datafile backup setchannel ORA_DISK_1: specifying datafile(s) in backup setinput datafile file number=00014 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/users.278.962209649input datafile file number=00011 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/sysaux.316.962209649input datafile file number=00013 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/undo_2.268.962209649input datafile file number=00010 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/system.271.962209649input datafile file number=00012 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/undotbs1.264.962209649input datafile file number=00015 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/test.275.962210609channel ORA_DISK_1: starting piece 1 at 24-JAN-18channel ORA_DISK_1: finished piece 1 at 24-JAN-18piece handle=/ora_backup/jy_7aspgjfb_JY_966282731_234_1 tag=TAG20180124T194913 comment=NONEchannel ORA_DISK_1: backup set complete, elapsed time: 00:01:15channel ORA_DISK_1: starting compressed full datafile backup setchannel ORA_DISK_1: specifying datafile(s) in backup setinput datafile file number=00017 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/sysaux.259.962469409input datafile file number=00016 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/system.260.962469409input datafile file number=00018 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/undotbs1.265.962469409input datafile file number=00019 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/undo_2.266.962469409input datafile file number=00021 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/test.269.962469409input datafile file number=00020 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/users.267.962469409channel ORA_DISK_1: starting piece 1 at 24-JAN-18channel ORA_DISK_1: finished piece 1 at 24-JAN-18piece handle=/ora_backup/jy_7bspgjhn_JY_966282807_235_1 tag=TAG20180124T194913 comment=NONEchannel ORA_DISK_1: backup set complete, elapsed time: 00:01:05channel ORA_DISK_1: starting compressed full datafile backup setchannel ORA_DISK_1: specifying datafile(s) in backup setinput datafile file number=00006 name=+DATA/JY/5F9AA264B21F3ED9E053AB828A0A6088/DATAFILE/sysaux.270.962209675input datafile file number=00005 name=+DATA/JY/5F9AA264B21F3ED9E053AB828A0A6088/DATAFILE/system.256.962209675input datafile file number=00008 name=+DATA/JY/5F9AA264B21F3ED9E053AB828A0A6088/DATAFILE/undotbs1.296.962209675channel ORA_DISK_1: starting piece 1 at 24-JAN-18channel ORA_DISK_1: finished piece 1 at 24-JAN-18piece handle=/ora_backup/jy_7cspgjjo_JY_966282872_236_1 tag=TAG20180124T194913 comment=NONEchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:55channel ORA_DISK_1: starting compressed full datafile backup setchannel ORA_DISK_1: specifying datafile(s) in backup setincluding current control file in backup setincluding current SPFILE in backup setchannel ORA_DISK_1: starting piece 1 at 24-JAN-18channel ORA_DISK_1: finished piece 1 at 24-JAN-18piece handle=/ora_backup/jy_7dspgjlg_JY_966282928_237_1 tag=TAG20180124T194913 comment=NONEchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:01Finished backup at 24-JAN-18Starting backup at 24-JAN-18current log archivedusing channel ORA_DISK_1channel ORA_DISK_1: starting compressed archived log backup setchannel ORA_DISK_1: specifying archived log(s) in backup setinput archived log thread=1 sequence=177 RECID=351 STAMP=966282933input archived log thread=2 sequence=155 RECID=350 STAMP=966282933channel ORA_DISK_1: starting piece 1 at 24-JAN-18channel ORA_DISK_1: finished piece 1 at 24-JAN-18piece handle=/ora_backup/arch_JY_20180124_7espgjln_1_1 tag=TAG20180124T195535 comment=NONEchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:01Finished backup at 24-JAN-18Starting backup at 24-JAN-18using channel ORA_DISK_1channel ORA_DISK_1: starting full datafile backup setchannel ORA_DISK_1: specifying datafile(s) in backup setincluding current control file in backup setchannel ORA_DISK_1: starting piece 1 at 24-JAN-18channel ORA_DISK_1: finished piece 1 at 24-JAN-18piece handle=/ora_backup/JY_239.ctl tag=TAG20180124T195540 comment=NONEchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:03Finished backup at 24-JAN-18Starting backup at 24-JAN-18using channel ORA_DISK_1channel ORA_DISK_1: starting full datafile backup setchannel ORA_DISK_1: specifying datafile(s) in backup setincluding current SPFILE in backup setchannel ORA_DISK_1: starting piece 1 at 24-JAN-18channel ORA_DISK_1: finished piece 1 at 24-JAN-18piece handle=/ora_backup/spfJY_240.ora tag=TAG20180124T195549 comment=NONEchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:01Finished backup at 24-JAN-18在目标主机的/ora_backup目录中查看生成的RMAN备份文件[root@shard1 ora_backup]# ls -lrttotal 1646052-rw-r-----. 1 oracle 1006 473020928 Jan 24 13:45 arch_JY_20180124_78spgj6g_1_1-rw-r-----. 1 oracle 1006 615038976 Jan 24 13:48 jy_79spgj9s_JY_966282556_233_1-rw-r-----. 1 oracle 1006 213581824 Jan 24 13:49 jy_7aspgjfb_JY_966282731_234_1-rw-r-----. 1 oracle 1006 190742528 Jan 24 13:50 jy_7bspgjhn_JY_966282807_235_1-rw-r-----. 1 oracle 1006 171524096 Jan 24 13:51 jy_7cspgjjo_JY_966282872_236_1-rw-r-----. 1 oracle 1006 1163264 Jan 24 13:51 jy_7dspgjlg_JY_966282928_237_1-rw-r-----. 1 oracle 1006 392192 Jan 24 13:51 arch_JY_20180124_7espgjln_1_1-rw-r-----. 1 oracle 1006 19972096 Jan 24 13:51 JY_239.ctl-rw-r-----. 1 oracle 1006 114688 Jan 24 13:51 spfJY_240.ora
3.在目标主机上创建存储目标数据库(dupjy)相关数据库文件的目录,目标主机上的/u01/app/oracle/oradata/dupjy目录用来存储数据库的数据文件,控制文件,联机重做日志文件),/u01/app/oracle/arch/dupjy目录用来存储数据库的归档重做日志文件。
4.将源数据库的密码文件复制到目标主机的相应目录中并修改为目标数据库(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
5.使用源数据库的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/DATAFILE/','/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.
6.使用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
7.给目标数据库配置静态监听
[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
8.在目标主机上配置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) ) )
9.在目标主机上测试是否可以通过使用网络服务名来连接源数据库与目标数据库
[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.
10.在源主机上配置目标数据库的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) ) )
11.在源主机上测试能否可以使用网络服务名来连接源数据库与目标数据库
[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.
12.使用备份来复制RAC CDB为单实例CDB(dupjy),执行duplicate命令,如果没有配置自动通道,那么至少手动分配一个辅助实例。如果是使用PFILE参数文件启动辅助实例需要指定pfile参数文件,且pfile参数文件必须存储在运行RMAN执行复制的主机上。复制命令没有指定数据库名。使用database关键字而不指定数据库名,duplicate将从备份中获得数据库名和DBID。如果在backup location目录中一个数据库有多个备份将会显示错误。使用backup子句来识别没有目标数据库和恢复目录的复制类型。until time选项用来指定恢复目标时间,它是唯一能与backup location子句一起使用的选项。因为副本数据库和原数据库文件的文件名相同所以要指定nofilenamecheck选项:
[oracle@shard1 ora_backup]$ rman auxiliary sys/abcd@dupjyRecovery Manager: Release 12.2.0.1.0 - Production on Wed Jan 24 17:13:28 2018Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved.connected to auxiliary database: JY (not mounted)RMAN> run2> {3> set newname for database to '/u01/app/oracle/oradata/dupjy/%b';4> duplicate database 'JY' to 'dupjy'5> logfile group 1 ('/u01/app/oracle/oradata/dupjy/group_1.261.961976319') size 200M reuse,6> group 2 ('/u01/app/oracle/oradata/dupjy/group_2.302.961976321') size 200M reuse,7> group 3 ('/u01/app/oracle/oradata/dupjy/group_3.263.961976697') size 200M reuse,8> group 4 ('/u01/app/oracle/oradata/dupjy/group_4.262.961976705') size 200M reuse9> backup location '/ora_backup';10> }executing command: SET NEWNAMEStarting Duplicate Db at 24-JAN-18contents of Memory Script:{ sql clone "alter system set db_name = ''JY'' comment= ''Modified by RMAN duplicate'' scope=spfile"; shutdown clone immediate; startup clone force nomount restore clone primary controlfile from '/ora_backup/JY_239.ctl'; alter clone database mount;}executing Memory Scriptsql statement: alter system set db_name = ''JY'' 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 24-JAN-18allocated channel: ORA_AUX_DISK_1channel ORA_AUX_DISK_1: SID=2269 device type=DISKchannel ORA_AUX_DISK_1: restoring control filechannel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01output file name=/u01/app/oracle/oradata/dupjy/control01.ctlFinished restore at 24-JAN-18database mountedreleased channel: ORA_AUX_DISK_1allocated channel: ORA_AUX_DISK_1channel ORA_AUX_DISK_1: SID=2269 device type=DISKcontents of Memory Script:{ set until scn 15999223; 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 7 to "/u01/app/oracle/oradata/dupjy/users.301.962209605"; 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"; set newname for datafile 16 to "/u01/app/oracle/oradata/dupjy/system.260.962469409"; set newname for datafile 17 to "/u01/app/oracle/oradata/dupjy/sysaux.259.962469409"; set newname for datafile 18 to "/u01/app/oracle/oradata/dupjy/undotbs1.265.962469409"; set newname for datafile 19 to "/u01/app/oracle/oradata/dupjy/undo_2.266.962469409"; set newname for datafile 20 to "/u01/app/oracle/oradata/dupjy/users.267.962469409"; set newname for datafile 21 to "/u01/app/oracle/oradata/dupjy/test.269.962469409"; restore clone database ;}executing Memory Scriptexecuting command: SET until clausesql 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 24-JAN-18using channel ORA_AUX_DISK_1channel ORA_AUX_DISK_1: starting datafile backup set restorechannel 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: restoring datafile 00003 to /u01/app/oracle/oradata/dupjy/sysaux.298.962209605channel ORA_AUX_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/dupjy/undotbs1.277.962209605channel ORA_AUX_DISK_1: restoring datafile 00007 to /u01/app/oracle/oradata/dupjy/users.301.962209605channel ORA_AUX_DISK_1: restoring datafile 00009 to /u01/app/oracle/oradata/dupjy/undotbs2.312.962209605channel ORA_AUX_DISK_1: reading from backup piece /ora_backup/jy_79spgj9s_JY_966282556_233_1channel ORA_AUX_DISK_1: piece handle=/ora_backup/jy_79spgj9s_JY_966282556_233_1 tag=TAG20180124T194913channel ORA_AUX_DISK_1: restored backup piece 1channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:02:25channel ORA_AUX_DISK_1: starting datafile backup set restorechannel 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: restoring datafile 00011 to /u01/app/oracle/oradata/dupjy/sysaux.316.962209649channel ORA_AUX_DISK_1: restoring datafile 00012 to /u01/app/oracle/oradata/dupjy/undotbs1.264.962209649channel ORA_AUX_DISK_1: restoring datafile 00013 to /u01/app/oracle/oradata/dupjy/undo_2.268.962209649channel ORA_AUX_DISK_1: restoring datafile 00014 to /u01/app/oracle/oradata/dupjy/users.278.962209649channel ORA_AUX_DISK_1: restoring datafile 00015 to /u01/app/oracle/oradata/dupjy/test.275.962210609channel ORA_AUX_DISK_1: reading from backup piece /ora_backup/jy_7aspgjfb_JY_966282731_234_1channel ORA_AUX_DISK_1: piece handle=/ora_backup/jy_7aspgjfb_JY_966282731_234_1 tag=TAG20180124T194913channel ORA_AUX_DISK_1: restored backup piece 1channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:55channel ORA_AUX_DISK_1: starting datafile backup set restorechannel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup setchannel ORA_AUX_DISK_1: restoring datafile 00016 to /u01/app/oracle/oradata/dupjy/system.260.962469409channel ORA_AUX_DISK_1: restoring datafile 00017 to /u01/app/oracle/oradata/dupjy/sysaux.259.962469409channel ORA_AUX_DISK_1: restoring datafile 00018 to /u01/app/oracle/oradata/dupjy/undotbs1.265.962469409channel ORA_AUX_DISK_1: restoring datafile 00019 to /u01/app/oracle/oradata/dupjy/undo_2.266.962469409channel ORA_AUX_DISK_1: restoring datafile 00020 to /u01/app/oracle/oradata/dupjy/users.267.962469409channel ORA_AUX_DISK_1: restoring datafile 00021 to /u01/app/oracle/oradata/dupjy/test.269.962469409channel ORA_AUX_DISK_1: reading from backup piece /ora_backup/jy_7bspgjhn_JY_966282807_235_1channel ORA_AUX_DISK_1: piece handle=/ora_backup/jy_7bspgjhn_JY_966282807_235_1 tag=TAG20180124T194913channel ORA_AUX_DISK_1: restored backup piece 1channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:45channel ORA_AUX_DISK_1: starting datafile backup set restorechannel 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: restoring datafile 00006 to /u01/app/oracle/oradata/dupjy/sysaux.270.962209675channel ORA_AUX_DISK_1: restoring datafile 00008 to /u01/app/oracle/oradata/dupjy/undotbs1.296.962209675channel ORA_AUX_DISK_1: reading from backup piece /ora_backup/jy_7cspgjjo_JY_966282872_236_1channel ORA_AUX_DISK_1: piece handle=/ora_backup/jy_7cspgjjo_JY_966282872_236_1 tag=TAG20180124T194913channel ORA_AUX_DISK_1: restored backup piece 1channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:36Finished restore at 24-JAN-18contents of Memory Script:{ switch clone datafile all;}executing Memory Scriptdatafile 1 switched to datafile copyinput datafile copy RECID=21 STAMP=966273552 file name=/u01/app/oracle/oradata/dupjy/system.317.962209603datafile 3 switched to datafile copyinput datafile copy RECID=22 STAMP=966273552 file name=/u01/app/oracle/oradata/dupjy/sysaux.298.962209605datafile 4 switched to datafile copyinput datafile copy RECID=23 STAMP=966273552 file name=/u01/app/oracle/oradata/dupjy/undotbs1.277.962209605datafile 5 switched to datafile copyinput datafile copy RECID=24 STAMP=966273552 file name=/u01/app/oracle/oradata/dupjy/system.256.962209675datafile 6 switched to datafile copyinput datafile copy RECID=25 STAMP=966273552 file name=/u01/app/oracle/oradata/dupjy/sysaux.270.962209675datafile 7 switched to datafile copyinput datafile copy RECID=26 STAMP=966273552 file name=/u01/app/oracle/oradata/dupjy/users.301.962209605datafile 8 switched to datafile copyinput datafile copy RECID=27 STAMP=966273552 file name=/u01/app/oracle/oradata/dupjy/undotbs1.296.962209675datafile 9 switched to datafile copyinput datafile copy RECID=28 STAMP=966273552 file name=/u01/app/oracle/oradata/dupjy/undotbs2.312.962209605datafile 10 switched to datafile copyinput datafile copy RECID=29 STAMP=966273552 file name=/u01/app/oracle/oradata/dupjy/system.271.962209649datafile 11 switched to datafile copyinput datafile copy RECID=30 STAMP=966273553 file name=/u01/app/oracle/oradata/dupjy/sysaux.316.962209649datafile 12 switched to datafile copyinput datafile copy RECID=31 STAMP=966273553 file name=/u01/app/oracle/oradata/dupjy/undotbs1.264.962209649datafile 13 switched to datafile copyinput datafile copy RECID=32 STAMP=966273553 file name=/u01/app/oracle/oradata/dupjy/undo_2.268.962209649datafile 14 switched to datafile copyinput datafile copy RECID=33 STAMP=966273553 file name=/u01/app/oracle/oradata/dupjy/users.278.962209649datafile 15 switched to datafile copyinput datafile copy RECID=34 STAMP=966273553 file name=/u01/app/oracle/oradata/dupjy/test.275.962210609datafile 16 switched to datafile copyinput datafile copy RECID=35 STAMP=966273553 file name=/u01/app/oracle/oradata/dupjy/system.260.962469409datafile 17 switched to datafile copyinput datafile copy RECID=36 STAMP=966273553 file name=/u01/app/oracle/oradata/dupjy/sysaux.259.962469409datafile 18 switched to datafile copyinput datafile copy RECID=37 STAMP=966273553 file name=/u01/app/oracle/oradata/dupjy/undotbs1.265.962469409datafile 19 switched to datafile copyinput datafile copy RECID=38 STAMP=966273553 file name=/u01/app/oracle/oradata/dupjy/undo_2.266.962469409datafile 20 switched to datafile copyinput datafile copy RECID=39 STAMP=966273553 file name=/u01/app/oracle/oradata/dupjy/users.267.962469409datafile 21 switched to datafile copyinput datafile copy RECID=40 STAMP=966273553 file name=/u01/app/oracle/oradata/dupjy/test.269.962469409contents of Memory Script:{ set until scn 15999223; recover clone database delete archivelog ;}executing Memory Scriptexecuting command: SET until clauseStarting recover at 24-JAN-18using channel ORA_AUX_DISK_1starting media recoverychannel ORA_AUX_DISK_1: starting archived log restore to default destinationchannel ORA_AUX_DISK_1: restoring archived logarchived log thread=1 sequence=177channel ORA_AUX_DISK_1: restoring archived logarchived log thread=2 sequence=155channel ORA_AUX_DISK_1: reading from backup piece /ora_backup/arch_JY_20180124_7espgjln_1_1channel ORA_AUX_DISK_1: piece handle=/ora_backup/arch_JY_20180124_7espgjln_1_1 tag=TAG20180124T195535channel ORA_AUX_DISK_1: restored backup piece 1channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01archived log file name=/u01/app/oracle/oradata/arch_dupjy/1_177_961976319.dbf thread=1 sequence=177archived log file name=/u01/app/oracle/oradata/arch_dupjy/2_155_961976319.dbf thread=2 sequence=155channel clone_default: deleting archived log(s)archived log file name=/u01/app/oracle/oradata/arch_dupjy/1_177_961976319.dbf RECID=1 STAMP=966273556channel clone_default: deleting archived log(s)archived log file name=/u01/app/oracle/oradata/arch_dupjy/2_155_961976319.dbf RECID=2 STAMP=966273556media recovery complete, elapsed time: 00:00:02Finished recover at 24-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";}executing Memory Scriptsql statement: alter system set db_name = ''DUPJY'' comment= ''Reset to original value by RMAN'' 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, 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 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', '/u01/app/oracle/oradata/dupjy/system.260.962469409' CHARACTER SET ZHS16GBKcontents of Memory Script:{ set newname for tempfile 1 to "/u01/app/oracle/oradata/dupjy/temp.299.961976339"; set newname for tempfile 2 to "/u01/app/oracle/oradata/dupjy/temp.297.962209865"; set newname for tempfile 3 to "/u01/app/oracle/oradata/dupjy/temp.276.962210519"; set newname for tempfile 4 to "/u01/app/oracle/oradata/dupjy/temp.258.962469435"; 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/users.301.962209605", "/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", "/u01/app/oracle/oradata/dupjy/sysaux.259.962469409", "/u01/app/oracle/oradata/dupjy/undotbs1.265.962469409", "/u01/app/oracle/oradata/dupjy/undo_2.266.962469409", "/u01/app/oracle/oradata/dupjy/users.267.962469409", "/u01/app/oracle/oradata/dupjy/test.269.962469409"; switch clone datafile all;}executing Memory Scriptexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMErenamed tempfile 1 to /u01/app/oracle/oradata/dupjy/temp.299.961976339 in control filerenamed tempfile 2 to /u01/app/oracle/oradata/dupjy/temp.297.962209865 in control filerenamed tempfile 3 to /u01/app/oracle/oradata/dupjy/temp.276.962210519 in control filerenamed tempfile 4 to /u01/app/oracle/oradata/dupjy/temp.258.962469435 in control filecataloged datafile copydatafile copy file name=/u01/app/oracle/oradata/dupjy/sysaux.298.962209605 RECID=1 STAMP=966273582cataloged datafile copydatafile copy file name=/u01/app/oracle/oradata/dupjy/undotbs1.277.962209605 RECID=2 STAMP=966273582cataloged datafile copydatafile copy file name=/u01/app/oracle/oradata/dupjy/sysaux.270.962209675 RECID=3 STAMP=966273582cataloged datafile copydatafile copy file name=/u01/app/oracle/oradata/dupjy/users.301.962209605 RECID=4 STAMP=966273582cataloged datafile copydatafile copy file name=/u01/app/oracle/oradata/dupjy/undotbs1.296.962209675 RECID=5 STAMP=966273582cataloged datafile copydatafile copy file name=/u01/app/oracle/oradata/dupjy/undotbs2.312.962209605 RECID=6 STAMP=966273582cataloged datafile copydatafile copy file name=/u01/app/oracle/oradata/dupjy/sysaux.316.962209649 RECID=7 STAMP=966273582cataloged datafile copydatafile copy file name=/u01/app/oracle/oradata/dupjy/undotbs1.264.962209649 RECID=8 STAMP=966273582cataloged datafile copydatafile copy file name=/u01/app/oracle/oradata/dupjy/undo_2.268.962209649 RECID=9 STAMP=966273582cataloged datafile copydatafile copy file name=/u01/app/oracle/oradata/dupjy/users.278.962209649 RECID=10 STAMP=966273582cataloged datafile copydatafile copy file name=/u01/app/oracle/oradata/dupjy/test.275.962210609 RECID=11 STAMP=966273583cataloged datafile copydatafile copy file name=/u01/app/oracle/oradata/dupjy/sysaux.259.962469409 RECID=12 STAMP=966273583cataloged datafile copydatafile copy file name=/u01/app/oracle/oradata/dupjy/undotbs1.265.962469409 RECID=13 STAMP=966273583cataloged datafile copydatafile copy file name=/u01/app/oracle/oradata/dupjy/undo_2.266.962469409 RECID=14 STAMP=966273583cataloged datafile copydatafile copy file name=/u01/app/oracle/oradata/dupjy/users.267.962469409 RECID=15 STAMP=966273583cataloged datafile copydatafile copy file name=/u01/app/oracle/oradata/dupjy/test.269.962469409 RECID=16 STAMP=966273583datafile 3 switched to datafile copyinput datafile copy RECID=1 STAMP=966273582 file name=/u01/app/oracle/oradata/dupjy/sysaux.298.962209605datafile 4 switched to datafile copyinput datafile copy RECID=2 STAMP=966273582 file name=/u01/app/oracle/oradata/dupjy/undotbs1.277.962209605datafile 6 switched to datafile copyinput datafile copy RECID=3 STAMP=966273582 file name=/u01/app/oracle/oradata/dupjy/sysaux.270.962209675datafile 7 switched to datafile copyinput datafile copy RECID=4 STAMP=966273582 file name=/u01/app/oracle/oradata/dupjy/users.301.962209605datafile 8 switched to datafile copyinput datafile copy RECID=5 STAMP=966273582 file name=/u01/app/oracle/oradata/dupjy/undotbs1.296.962209675datafile 9 switched to datafile copyinput datafile copy RECID=6 STAMP=966273582 file name=/u01/app/oracle/oradata/dupjy/undotbs2.312.962209605datafile 11 switched to datafile copyinput datafile copy RECID=7 STAMP=966273582 file name=/u01/app/oracle/oradata/dupjy/sysaux.316.962209649datafile 12 switched to datafile copyinput datafile copy RECID=8 STAMP=966273582 file name=/u01/app/oracle/oradata/dupjy/undotbs1.264.962209649datafile 13 switched to datafile copyinput datafile copy RECID=9 STAMP=966273582 file name=/u01/app/oracle/oradata/dupjy/undo_2.268.962209649datafile 14 switched to datafile copyinput datafile copy RECID=10 STAMP=966273582 file name=/u01/app/oracle/oradata/dupjy/users.278.962209649datafile 15 switched to datafile copyinput datafile copy RECID=11 STAMP=966273583 file name=/u01/app/oracle/oradata/dupjy/test.275.962210609datafile 17 switched to datafile copyinput datafile copy RECID=12 STAMP=966273583 file name=/u01/app/oracle/oradata/dupjy/sysaux.259.962469409datafile 18 switched to datafile copyinput datafile copy RECID=13 STAMP=966273583 file name=/u01/app/oracle/oradata/dupjy/undotbs1.265.962469409datafile 19 switched to datafile copyinput datafile copy RECID=14 STAMP=966273583 file name=/u01/app/oracle/oradata/dupjy/undo_2.266.962469409datafile 20 switched to datafile copyinput datafile copy RECID=15 STAMP=966273583 file name=/u01/app/oracle/oradata/dupjy/users.267.962469409datafile 21 switched to datafile copyinput datafile copy RECID=16 STAMP=966273583 file name=/u01/app/oracle/oradata/dupjy/test.269.962469409contents 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 24-JAN-18
13.检查源RAC CDB(jy)是否被成功复制成单实例CDB(dupjy)
SQL> alter session set container=testpdb;Session altered.SQL> select count(*) from jy.t1; COUNT(*)---------- 39SQL> select table_name,tablespace_name from dba_tables where owner='JY';TABLE_NAME TABLESPACE_NAME-------------------------------------------------------------------------------------------------------------------------------- ------------------------------T1
到此,关于"怎么将源RAC CDB数据库复制成为单实例CDB数据库"的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注网站,小编会继续努力为大家带来更多实用的文章!