duplicate
最近公司准备迁移数据库,迁移的办法有很多,由于考虑到生产系统的安全性和停机时间等其他因素,选择的方案有很多,这里我们谈一下rman的duplicate:
11g的rman duplicate 相比10g先进了很多,10G需要在rman备份的基础上进行复制,使用 RMAN duplicate 创建一个数据完全相同但DBID不同的数据库。而11g的RMAN duplicate ,可以通过Active database duplicate和Backup-based duplicate两种方法实现。这里的测试使用的是Active database duplicate,因为Active database duplicate 功能强大,不需要先把目标数据库进行rman备份,只要目标数据库处于归档模式下即可直接通过网络对数据库进行copy,且copy完成后自动open数据库。这对于大数据特别是T级别的数据库来说优点非常明显,复制前不需要进行备份,减少了备份和传送备份的时间,同时节省备份空间。

步骤和说明:
实验环境
source端:
centos6.5
ip:192.168.6.151
oracle_sid=pu

oracle版本11g

hostname  oracle

target端:
centos6.5
ip:192.168.6.152
oracle_sid=pu

oracle版本11g

hostname  target

需要注意的是我这里的db_name是一致的,数据库目录也是一致

1、安装source端的数据库软件以及建库(详细步骤这里不在介绍可以参考:我的博客http://blog.csdn.net/freedompuge/article/details/45028961)

查看source数据库的数据文件

[oracle@target admin]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Mon May 9 16:01:30 2016

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing options

SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
/u01/oracle/oradata/pu/system01.dbf
/u01/oracle/oradata/pu/sysaux01.dbf
/u01/oracle/oradata/pu/undotbs01.dbf
/u01/oracle/oradata/pu/users01.dbf
/u01/salary.dbf
/u01/11g/ggs.dbf
/u01/ogg01.dbf

7 rows selected.

2、安装target端数据库软件,但不建库(详细步骤这里不在介绍可以参考:我的博客http://blog.csdn.net/freedompuge/article/details/45028961)

3、创建密码文件
可以手工创建orapwd file='$ORACLE_HOME/dbs/orapwpu'  password=oracle entries=5 force=y;
最好是直接source端的密码文件scp $ORACLE_HOME/dbs/orapwpu  root@192.168.6.152:/u01/11g/dbs/

4、创建参数文件init.ora

这里也可以直接拷贝

source端

SQL> create pfile='/u01/init.ora' from spfile;
scp /u01/init.ora  root@192.168.6.152:/u01
[oracle@oracle dbs]$ cat /u01/init.ora
pu.__db_cache_size=33554432
pu.__java_pool_size=12582912
pu.__large_pool_size=4194304
pu.__oracle_base='/u01/oracle'#ORACLE_BASE set from environment
pu.__pga_aggregate_target=176160768
pu.__sga_target=239075328
pu.__shared_io_pool_size=0
pu.__shared_pool_size=171966464
pu.__streams_pool_size=4194304
*.audit_file_dest='/u01/oracle/admin/pu/adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='/u01/oracle/oradata/pu/control01.ctl','/u01/oracle/fast_recovery_area/pu/control02.ctl'#Restore Controlfile
*.db_block_size=8192
*.db_domain=''
*.db_name='pu'
*.db_recovery_file_dest='/u01/oracle/fast_recovery_area'
*.db_recovery_file_dest_size=8589934592
*.diagnostic_dest='/u01/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=puXDB)'
*.memory_target=414187520
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'

5、创建参数文件中的目录路径,并授予权限
最简单的防范  chown oralce.oinstall /u01 -R
[oracle@target dbs]$ cat init.ora | grep /
pu.__oracle_base='/u01/oracle'#ORACLE_BASE set from environment
*.audit_file_dest='/u01/oracle/admin/pu/adump'
*.control_files='/u01/oracle/oradata/pu/control01.ctl','/u01/oracle/fast_recovery_area/pu/control02.ctl'#Restore Controlfile
*.db_recovery_file_dest='/u01/oracle/fast_recovery_area'
*.diagnostic_dest='/u01/oracle'
创建以上目录
[oracle@target dbs]$ mkdir -p /u01/oracle/admin/pu/adump^C
[oracle@target dbs]$ mkdir -p /u01/oracle/admin/pu/adump
[oracle@target dbs]$ mkdir -p /u01/oracle/oradata/pu/
[oracle@target dbs]$ mkdir -p /u01/oracle/fast_recovery_area/pu/
[oracle@target dbs]$ mkdir -p /u01/oracle/fast_recovery_area

6、启动到nomount,并网络互通
[oracle@target ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Mon May 9 13:57:59 2016

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup nomount pfile='/u01/11g/dbs/init.ora';
ORACLE instance started.

Total System Global Area  413372416 bytes
Fixed Size                  2228904 bytes
Variable Size             369102168 bytes
Database Buffers           37748736 bytes
Redo Buffers                4292608 bytes

关闭iptables和selinux
开启监听,tnsping能互相ping通
静态监听listener.ora
source端:

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (ORACLE_HOME = /u01/11g)
      (SID_NAME = pu)
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = oracle)(PORT = 1521))
    )
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )

ADR_BASE_LISTENER = /u01/oracle

target端:

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (ORACLE_HOME = /u01/11g)
      (SID_NAME = pu)
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = target)(PORT = 1521))
    )
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )

ADR_BASE_LISTENER = /u01/oracle

tnsnames.ora(两端一致)
sss =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.6.151)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = pu)
#      (UR=A)
    )
  )

target =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.6.152)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = pu)
#      (UR=A)
    )
  )
测试tnsping sss 和tnsping target

7、开始执行duplicate
rman target sys/oracle@sss auxiliary sys/oracle@target

duplicate target database to pu(这个指定的是db_name,我两端的db_name相同,这点需要注意) from active database nofilenamecheck(由于我两边的数据库目录和sid都相同,所以需要加这个参数不检查文件,否则会报错);             
由于我使用的软件屏幕显示有问题,所以只截取了最后完成的一段输出日志
contents of Memory Script:
{
   Alter clone database open resetlogs;
}
executing Memory Script

database opened
Finished Duplicate Db at 09-MAY-16

RMAN> contents of Memory Script:
{
   Alter clone database open resetlogs;
}
executing Memory Script

8、验证
查询target端的数据文件
[oracle@target admin]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Mon May 9 15:32:08 2016

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing options

SQL> select open_mode from v$database;

OPEN_MODE
--------------------
READ WRITE

SQL>
直接是打开状态
SQL> select name from v$datafile;

NAME
-------------------------------------------------------------------------------
/u01/oracle/oradata/pu/system01.dbf
/u01/oracle/oradata/pu/sysaux01.dbf
/u01/oracle/oradata/pu/undotbs01.dbf
/u01/oracle/oradata/pu/users01.dbf
/u01/salary.dbf
/u01/11g/ggs.dbf
/u01/ogg01.dbf

7 rows selected.

SQL>

生成了7个数据文件

常见的错误1:

1、rman target auxiliary 的时候,目标库显示为 not started

[oracle@oracle1 ~]$ rman target sys/oracle@ttt

Recovery Manager: Release 11.2.0.3.0 - Production on Mon May 16 16:28:30 2016

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

connected to target database (not started) ---这个地方按照必须是not mount的状态才可以执行duplicate

如果一直显示是not started,请检查监听,ORACLE_SID,SID_NAME的设置

在使用rman duplicate复制standby数据库的时候,由于standby数据库实例必须处于非mount状态,所以主数据库直接连接是会报错的,需要在standby数据库服务上的监听器上配置静态的服务名,如下:
$GRID_HOME/network/admin/listener.ora
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = rtdg1)
      (ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1)
      (SID_NAME = rtdg1)
    )
  )

----以上参考:http://blog.itpub.net/23135684/viewspace-692707/

常见错误2:

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 05/16/2016 16:35:16
RMAN-05501: aborting duplication of target database
RMAN-03015: error occurred in stored script Memory Script
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 05/16/2016 16:35:16
ORA-17628: Oracle error 19505 returned by remote Oracle server

检查target端已经启动到mount状态,但是数据文件都没有拷贝到指定的目录,而目录的路径和权限全是正确的

参考资料http://www.07net01.com/2016/01/1128880.html

http://blog.itpub.net/23135684/viewspace-757998/

这个是因为source端和target端的路径不一致导致的,需要添加

DB_FILE_NAME_CONVERT 和 LOG_FILE_NAME_CONVERT参数 (如果路径完全一致不需要这个两个参数)

参数可以写在init<sid>.ora文件中也可以执行duplicate的时候直接指定

详见

RMAN> report schema;  ---报告source端的schema

Report of database schema for database with db_unique_name ZHPHPGG

List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    720      SYSTEM               ***     /u01/oracle/oradata/zhphpgg/system01.dbf
2    580      SYSAUX               ***     /u01/oracle/oradata/zhphpgg/sysaux01.dbf
3    90       UNDOTBS1             ***     /u01/oracle/oradata/zhphpgg/undotbs01.dbf
4    38       USERS                ***     /u01/oracle/oradata/zhphpgg/users01.dbf
5    1200     CLSP                 ***     /u01/clsp01.dbf
6    50       SALARY               ***     /u01/salary01.dbf

List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1    29       TEMP                 32767       /u01/oracle/oradata/zhphpgg/temp01.dbf

RMAN> exit

Recovery Manager complete.
[oracle@oracle1 ~]$ rman target sys/oracle@sss auxiliary sys/oracle@ttt   --执行这一步之前,请清除target端的所有复制失败的数据文件和控制文件,并重新启动到nomount阶段。

Recovery Manager: Release 11.2.0.3.0 - Production on Tue May 17 09:21:13 2016

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

connected to target database: ZHPHPGG (DBID=4110104824)
connected to auxiliary database: PU (not mounted)

由于这是线上遇到的问题,所以sid和上面的例子有所不同:

source端是zhphpgg   target端是pu
RMAN> duplicate target database to pu from active database nofilenamecheck
2> spfile PARAMETER_VALUE_CONVERT 'zhphpgg','pu'
3> set CONTROL_FILES='/u01/oracle/oradata/pu/control01.ctl','/u01/oracle/fast_recovery_area/pu/control02.ctl'
4> set DB_FILE_NAME_CONVERT='/u01/oracle/oradata/zhphpgg/','/u01/oracle/oradata/pu/'
5> set LOG_FILE_NAME_CONVERT='zhphpgg','pu';

Starting Duplicate Db at 17-MAY-16
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=17 device type=DISK

contents of Memory Script:
{
   backup as copy reuse
   targetfile  '/u01/11g/dbs/spfilezhphpgg.ora' auxiliary format 
 '/u01/11g/dbs/spfilepu.ora'   ;
   sql clone "alter system set spfile= ''/u01/11g/dbs/spfilepu.ora''";
}
executing Memory Script

Starting backup at 17-MAY-16
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=30 device type=DISK
Finished backup at 17-MAY-16

sql statement: alter system set spfile= ''/u01/11g/dbs/spfilepu.ora''

contents of Memory Script:
{
   sql clone "alter system set  db_name = 
 ''PU'' comment=
 ''duplicate'' scope=spfile";
   sql clone "alter system set  audit_file_dest = 
 ''/u01/oracle/admin/pu/adump'' comment=
 '''' scope=spfile";
   sql clone "alter system set  dispatchers = 
 ''(PROTOCOL=TCP) (SERVICE=puXDB)'' comment=
 '''' scope=spfile";
   sql clone "alter system set  CONTROL_FILES = 
 ''/u01/oracle/oradata/pu/control01.ctl'', ''/u01/oracle/fast_recovery_area/pu/control02.ctl'' comment=
 '''' scope=spfile";
   sql clone "alter system set  db_file_name_convert = 
 ''/u01/oracle/oradata/zhphpgg/'', ''/u01/oracle/oradata/pu/'' comment=
 '''' scope=spfile";
   sql clone "alter system set  LOG_FILE_NAME_CONVERT = 
 ''zhphpgg'', ''pu'' comment=
 '''' scope=spfile";
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script

sql statement: alter system set  db_name =  ''PU'' comment= ''duplicate'' scope=spfile

sql statement: alter system set  audit_file_dest =  ''/u01/oracle/admin/pu/adump'' comment= '''' scope=spfile

sql statement: alter system set  dispatchers =  ''(PROTOCOL=TCP) (SERVICE=puXDB)'' comment= '''' scope=spfile

sql statement: alter system set  CONTROL_FILES =  ''/u01/oracle/oradata/pu/control01.ctl'', ''/u01/oracle/fast_recovery_area/pu/control02.ctl'' comment= '''' scope=spfile

sql statement: alter system set  db_file_name_convert =  ''/u01/oracle/oradata/zhphpgg/'', ''/u01/oracle/oradata/pu/'' comment= '''' scope=spfile

sql statement: alter system set  LOG_FILE_NAME_CONVERT =  ''zhphpgg'', ''pu'' comment= '''' scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area     830930944 bytes

Fixed Size                     2232920 bytes
Variable Size                490737064 bytes
Database Buffers             335544320 bytes
Redo Buffers                   2416640 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name = 
 ''ZHPHPGG'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   sql clone "alter system set  db_unique_name = 
 ''PU'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   shutdown clone immediate;
   startup clone force nomount
   backup as copy current controlfile auxiliary format  '/u01/oracle/oradata/pu/control01.ctl';
   restore clone controlfile to  '/u01/oracle/fast_recovery_area/pu/control02.ctl' from 
 '/u01/oracle/oradata/pu/control01.ctl';
   alter clone database mount;
}
executing Memory Script

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

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

Oracle instance shut down

Oracle instance started

Total System Global Area     830930944 bytes

Fixed Size                     2232920 bytes
Variable Size                490737064 bytes
Database Buffers             335544320 bytes
Redo Buffers                   2416640 bytes

Starting backup at 17-MAY-16
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying current control file
output file name=/u01/11g/dbs/snapcf_zhphpgg.f tag=TAG20160517T092233 RECID=9 STAMP=912072153
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
Finished backup at 17-MAY-16

Starting restore at 17-MAY-16
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=17 device type=DISK

channel ORA_AUX_DISK_1: copied control file copy
Finished restore at 17-MAY-16

database mounted

contents of Memory Script:
{
   set newname for datafile  1 to 
 "/u01/oracle/oradata/pu/system01.dbf";
   set newname for datafile  2 to 
 "/u01/oracle/oradata/pu/sysaux01.dbf";
   set newname for datafile  3 to 
 "/u01/oracle/oradata/pu/undotbs01.dbf";
   set newname for datafile  4 to 
 "/u01/oracle/oradata/pu/users01.dbf";
   set newname for datafile  5 to 
 "/u01/clsp01.dbf";
   set newname for datafile  6 to 
 "/u01/salary01.dbf";
   backup as copy reuse
   datafile  1 auxiliary format 
 "/u01/oracle/oradata/pu/system01.dbf"   datafile 
 2 auxiliary format 
 "/u01/oracle/oradata/pu/sysaux01.dbf"   datafile 
 3 auxiliary format 
 "/u01/oracle/oradata/pu/undotbs01.dbf"   datafile 
 4 auxiliary format 
 "/u01/oracle/oradata/pu/users01.dbf"   datafile 
 5 auxiliary format 
 "/u01/clsp01.dbf"   datafile 
 6 auxiliary format 
 "/u01/salary01.dbf"   ;
   sql 'alter system archive log current';
}
executing Memory Script

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting backup at 17-MAY-16
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=/u01/clsp01.dbf
output file name=/u01/clsp01.dbf tag=TAG20160517T092249
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:02:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/u01/oracle/oradata/zhphpgg/system01.dbf
output file name=/u01/oracle/oradata/pu/system01.dbf tag=TAG20160517T092249
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:45
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=/u01/oracle/oradata/zhphpgg/sysaux01.dbf
output file name=/u01/oracle/oradata/pu/sysaux01.dbf tag=TAG20160517T092249
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:45
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=/u01/oracle/oradata/zhphpgg/undotbs01.dbf
output file name=/u01/oracle/oradata/pu/undotbs01.dbf tag=TAG20160517T092249
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00006 name=/u01/salary01.dbf
output file name=/u01/salary01.dbf tag=TAG20160517T092249
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=/u01/oracle/oradata/zhphpgg/users01.dbf
output file name=/u01/oracle/oradata/pu/users01.dbf tag=TAG20160517T092249
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 17-MAY-16

sql statement: alter system archive log current

contents of Memory Script:
{
   backup as copy reuse
   archivelog like  "/u01/oracle/fast_recovery_area/ZHPHPGG/archivelog/2016_05_17/o1_mf_1_20_cmnwv5f9_.arc" auxiliary format 
 "/u01/oracle/fast_recovery_area/PU/archivelog/2016_05_17/o1_mf_1_20_%u_.arc"   ;
   catalog clone recovery area;
   switch clone datafile all;
}
executing Memory Script

Starting backup at 17-MAY-16
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=20 RECID=16 STAMP=912072421
output file name=/u01/oracle/fast_recovery_area/PU/archivelog/2016_05_17/o1_mf_1_20_1mr5q7n6_.arc RECID=0 STAMP=0
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:01
Finished backup at 17-MAY-16

searching for all files in the recovery area

List of Files Unknown to the Database
=====================================
File Name: /u01/oracle/fast_recovery_area/PU/archivelog/2016_05_17/o1_mf_1_20_1mr5q7n6_.arc
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: /u01/oracle/fast_recovery_area/PU/archivelog/2016_05_17/o1_mf_1_20_1mr5q7n6_.arc

datafile 1 switched to datafile copy
input datafile copy RECID=9 STAMP=912061195 file name=/u01/oracle/oradata/pu/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=10 STAMP=912061195 file name=/u01/oracle/oradata/pu/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=11 STAMP=912061195 file name=/u01/oracle/oradata/pu/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=12 STAMP=912061195 file name=/u01/oracle/oradata/pu/users01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=13 STAMP=912061196 file name=/u01/clsp01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=14 STAMP=912061196 file name=/u01/salary01.dbf

contents of Memory Script:
{
   set until scn  1302202;
   recover
   clone database
    delete archivelog
   ;
}
executing Memory Script

executing command: SET until clause

Starting recover at 17-MAY-16
using channel ORA_AUX_DISK_1

starting media recovery

archived log for thread 1 with sequence 20 is already on disk as file /u01/oracle/fast_recovery_area/PU/archivelog/2016_05_17/o1_mf_1_20_1mr5q7n6_.arc
archived log file name=/u01/oracle/fast_recovery_area/PU/archivelog/2016_05_17/o1_mf_1_20_1mr5q7n6_.arc thread=1 sequence=20
media recovery complete, elapsed time: 00:00:01
Finished recover at 17-MAY-16
Oracle instance started

Total System Global Area     830930944 bytes

Fixed Size                     2232920 bytes
Variable Size                490737064 bytes
Database Buffers             335544320 bytes
Redo Buffers                   2416640 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name = 
 ''PU'' comment=
 ''Reset to original value by RMAN'' scope=spfile";
   sql clone "alter system reset  db_unique_name scope=spfile";
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script

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

sql statement: alter system reset  db_unique_name scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area     830930944 bytes

Fixed Size                     2232920 bytes
Variable Size                490737064 bytes
Database Buffers             335544320 bytes
Redo Buffers                   2416640 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "PU" RESETLOGS ARCHIVELOG 
  MAXLOGFILES     16
  MAXLOGMEMBERS      3
  MAXDATAFILES      100
  MAXINSTANCES     8
  MAXLOGHISTORY      292
 LOGFILE
  GROUP   1 ( '/u01/oracle/oradata/pu/redo01.log' ) SIZE 50 M  REUSE,
  GROUP   2 ( '/u01/oracle/oradata/pu/redo02.log' ) SIZE 50 M  REUSE,
  GROUP   3 ( '/u01/oracle/oradata/pu/redo03.log' ) SIZE 50 M  REUSE
 DATAFILE
  '/u01/oracle/oradata/pu/system01.dbf'
 CHARACTER SET ZHS16GBK

contents of Memory Script:
{
   set newname for tempfile  1 to 
 "/u01/oracle/oradata/pu/temp01.dbf";
   switch clone tempfile all;
   catalog clone datafilecopy  "/u01/oracle/oradata/pu/sysaux01.dbf", 
 "/u01/oracle/oradata/pu/undotbs01.dbf", 
 "/u01/oracle/oradata/pu/users01.dbf", 
 "/u01/clsp01.dbf", 
 "/u01/salary01.dbf";
   switch clone datafile all;
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to /u01/oracle/oradata/pu/temp01.dbf in control file

cataloged datafile copy
datafile copy file name=/u01/oracle/oradata/pu/sysaux01.dbf RECID=1 STAMP=912061222
cataloged datafile copy
datafile copy file name=/u01/oracle/oradata/pu/undotbs01.dbf RECID=2 STAMP=912061222
cataloged datafile copy
datafile copy file name=/u01/oracle/oradata/pu/users01.dbf RECID=3 STAMP=912061222
cataloged datafile copy
datafile copy file name=/u01/clsp01.dbf RECID=4 STAMP=912061222
cataloged datafile copy
datafile copy file name=/u01/salary01.dbf RECID=5 STAMP=912061222

datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=912061222 file name=/u01/oracle/oradata/pu/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=912061222 file name=/u01/oracle/oradata/pu/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=912061222 file name=/u01/oracle/oradata/pu/users01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=4 STAMP=912061222 file name=/u01/clsp01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=5 STAMP=912061222 file name=/u01/salary01.dbf

contents of Memory Script:
{
   Alter clone database open resetlogs;
}
executing Memory Script

database opened
Finished Duplicate Db at 17-MAY-16  完成duplicate,检查target端,并创建spfile

rman的duplicate复制数据库相关推荐

  1. Oracle 11gR2 使用RMAN Duplicate复制数据库

    Oracle 11gR2 使用RMAN Duplicate复制数据库 整体步骤 构建辅助数据库目录结构配置辅助数据库相关参数 安装软件并创建数据库 开启归档 配置静态监听 启动数据库到nomount状 ...

  2. oracle10g数据库复制,oracle -10g 中Duplicate 复制数据库

    oracle --10g 中Duplicate 复制数据库 本次实验通过duplicate命令,在本机环境中创建一个复制数据库.目标数据库为hongye.复制数据库为catdb. 环境别名设置: al ...

  3. Duplicate复制数据库并创建物理StandBy(spfile+不同实例名+不同路径)

    过程和Duplicate复制数据库并创建物理StandBy类似,只是不需要重启数据库. 目的:创建standby,不重启源数据库 1设定环境如下: Primary数据库 IP 172.17.22.16 ...

  4. duplicate复制数据库

    无论是rman迁移表空间,还是duplicate复制数据库,其实这些都是oracle封装好的一个处理流程,我们都可以手动来达到同样的效果,但是oracle想的很周到,为DBA节省了不少时间和经历,下面 ...

  5. 复制oracle9i数据库,Oracle 10g 中Duplicate 复制数据库

    Oracle 10g 中Duplicate 复制数据库,本次实验通过duplicate命令,在本机环境中创建一个复制数据库.目标数据库为hongye.复制数 本次实验通过duplicate命令,在本机 ...

  6. oracle10g数据库复制,Oracle10g中Duplicate复制数据库

    Oracle 10g 中Duplicate 复制数据库,本次实验通过duplicate命令,在本机环境中创建一个复制数据库.目标数据库为hongye.复制数 本次实验通过duplicate命令,在本机 ...

  7. 使用RMAN传输数据_复制数据库

    本章介绍如何使用DUPLICATE命令创建独立运行的数据库副本. 1.RMAN数据库复制概述 数据库复制使用DUPLICATE命令拷贝源数据库中的所有数据或数据子集.复制数据库(拷贝的数据库)完全独立 ...

  8. rman本机复制数据库

    1.启动监听 [oracle@odd201 ~]$ lsnrctl status LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 28-JA ...

  9. RMAN利用auxiliary复制数据库

    这个是经理给的一份复制备份计划,只需要利用rman智能管理复制,无需手工操作.关键字是auxiliary,在rman中使用到,其实不是什么技术名称.操作过程整理及错误收集如下. 1 在主库上备份数据库 ...

最新文章

  1. Android应用程序消息处理机制(Looper、Handler)分析(2)
  2. 通俗易懂!使用Excel和TF实现Transformer
  3. 基于OpenCV的直方图匹配
  4. [国家集训队]航班安排
  5. winform 安装部署
  6. arcgis在面内创建随机点
  7. caas k8s主控节点如何查询_k8s--04 部署harbor作为k8s镜像仓库
  8. 1273 - Unknown collation: 'utf8mb4_0900_ai_ci'
  9. java类验证和装载顺序_Java类的加载机制和双亲委派模型
  10. 用rz,sz命令在xshell传输文件
  11. 3给定关键字不在字典中_Python龙珠训练营五:数据结构之字符串、字典
  12. Python—常用的几种列表、字典
  13. Jquery表单清空
  14. web打印组件康虎云报表与odoo整合示例
  15. android维文字体下载,Badam维汉输入法
  16. multism中ui和uo应该怎么表示_multisim12中XBP1怎么使用
  17. matlab 同态滤波
  18. 【采用】社交网络分析与金融反欺诈应用(知识图谱?)
  19. 【fake_useragent】网络爬虫获取随机User-Agent
  20. Presto error executing query

热门文章

  1. 树莓派接手机屏幕_使用Android手机作为树莓派的屏幕
  2. universal bios_技嘉开始为400系主板提供BIOS更新
  3. e4a官方服务器php中间件,e4a接入博维云无服务器平台的接口函数实例
  4. 使用jQuery完成无缝轮播图案例
  5. java商城系统方案,开发b2b2c商城系统的几种方案
  6. 东北师范大学计算机考研资料汇总
  7. spring security 安全框架改造统一登录oauth2.0方式
  8. linux 配置snmp端口号,Linux系统安装、配置SNMP 服务
  9. 腾讯音乐下载的tkm格式文件如何转换成mp3
  10. 如何写好新基建概念介绍总结PPT?