分享

使用RMAN复制数据库

 浸心阁 2015-08-28
RMAN> DUPLICATE TARGET DATABASE TO orclaux nofilenamecheck;
Starting Duplicate Db at 27-3月 -12
using channel ORA_AUX_DISK_1
contents of Memory Script:
{
   set until scn  555341;
   set newname for datafile  1 to
"/dev/raw/raw1";
   set newname for datafile  2 to
"/dev/raw/raw3";
   set newname for datafile  3 to
"/dev/raw/raw2";
   set newname for datafile  4 to
"/dev/raw/raw4";
   restore
   check readonly
   clone database
   ;
}
executing Memory Script
executing command: SET until clause
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 27-3月 -12
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: starting datafile backupset restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /dev/raw/raw1
restoring datafile 00002 to /dev/raw/raw3
restoring datafile 00003 to /dev/raw/raw2
restoring datafile 00004 to /dev/raw/raw4
channel ORA_AUX_DISK_1: reading from backup piece /oracle/backup/backdb<ORCL_23:778981561:1>.dbf
channel ORA_AUX_DISK_1: restored backup piece 1
piece handle=/oracle/backup/backdb<ORCL_23:778981561:1>.dbf tag=TAG20120326T234601
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:01:35
Finished restore at 27-3月 -12
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "ORCLAUX" RESETLOGS ARCHIVELOG
  MAXLOGFILES     16
  MAXLOGMEMBERS      3
  MAXDATAFILES     1024
  MAXINSTANCES     8
  MAXLOGHISTORY      292
LOGFILE
  GROUP  1 ( '/dev/raw/raw10', '/dev/raw/raw11' ) SIZE 50 M  REUSE,
  GROUP  2 ( '/dev/raw/raw12', '/dev/raw/raw13' ) SIZE 50 M  REUSE
DATAFILE
  '/dev/raw/raw1'
CHARACTER SET ZHS16GBK
contents of Memory Script:
{
   switch clone datafile all;
}
executing Memory Script
released channel: ORA_AUX_DISK_1
datafile 2 switched to datafile copy
input datafile copy recid=1 stamp=778987671 filename=/dev/raw/raw3
datafile 3 switched to datafile copy
input datafile copy recid=2 stamp=778987671 filename=/dev/raw/raw2
datafile 4 switched to datafile copy
input datafile copy recid=3 stamp=778987671 filename=/dev/raw/raw4
contents of Memory Script:
{
   set until scn  555341;
   recover
   clone database
    delete archivelog
   ;
}
executing Memory Script
executing command: SET until clause
Starting recover at 27-3月 -12
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid=1640 devtype=DISK
starting media recovery
channel ORA_AUX_DISK_1: starting archive log restore to default destination
channel ORA_AUX_DISK_1: restoring archive log
archive log thread=1 sequence=41
channel ORA_AUX_DISK_1: reading from backup piece /oracle/backup/archive<ORCL_25:778981619:1>.dbf
channel ORA_AUX_DISK_1: restored backup piece 1
piece handle=/oracle/backup/archive<ORCL_25:778981619:1>.dbf tag=TAG20120326T234659
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
archive log filename=/oracle/arch/1_41_777371211.dbf thread=1 sequence=41
channel clone_default: deleting archive log(s)
archive log filename=/oracle/arch/1_41_777371211.dbf recid=1 stamp=778987673
media recovery complete, elapsed time: 00:00:00
Finished recover at 27-3月 -12
contents of Memory Script:
{
   shutdown clone;
   startup clone nomount ;
}
executing Memory Script  --如果目标数据库还有会话,复制过程将在这里一直等待所有会话结束
database dismounted
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area     486539264 bytes
Fixed Size                     1268196 bytes
Variable Size                138413596 bytes
Database Buffers             339738624 bytes
Redo Buffers                   7118848 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "ORCLAUX" RESETLOGS ARCHIVELOG
  MAXLOGFILES     16
  MAXLOGMEMBERS      3
  MAXDATAFILES     1024
  MAXINSTANCES     8
  MAXLOGHISTORY      292
LOGFILE
  GROUP  1 ( '/dev/raw/raw10', '/dev/raw/raw11' ) SIZE 50 M  REUSE,
  GROUP  2 ( '/dev/raw/raw12', '/dev/raw/raw13' ) SIZE 50 M  REUSE
DATAFILE
  '/dev/raw/raw1'
CHARACTER SET ZHS16GBK
contents of Memory Script:
{
   set newname for tempfile  1 to
"/dev/raw/raw5";
   switch clone tempfile all;
   catalog clone datafilecopy  "/dev/raw/raw3";
   catalog clone datafilecopy  "/dev/raw/raw2";
   catalog clone datafilecopy  "/dev/raw/raw4";
   switch clone datafile all;
}
executing Memory Script
executing command: SET NEWNAME
renamed temporary file 1 to /dev/raw/raw5 in control file
cataloged datafile copy
datafile copy filename=/dev/raw/raw3 recid=1 stamp=778987902
cataloged datafile copy
datafile copy filename=/dev/raw/raw2 recid=2 stamp=778987902
cataloged datafile copy
datafile copy filename=/dev/raw/raw4 recid=3 stamp=778987902
datafile 2 switched to datafile copy
input datafile copy recid=1 stamp=778987902 filename=/dev/raw/raw3
datafile 3 switched to datafile copy
input datafile copy recid=2 stamp=778987902 filename=/dev/raw/raw2
datafile 4 switched to datafile copy
input datafile copy recid=3 stamp=778987902 filename=/dev/raw/raw4
contents of Memory Script:
{
   Alter clone database open resetlogs;
}
executing Memory Script
database opened
Finished Duplicate Db at 27-3月 -12
RMAN>

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多