码迷,mamicode.com
首页 > 其他好文 > 详细

dg rman

时间:2015-02-06 23:03:50      阅读:261      评论:0      收藏:0      [点我收藏+]

标签:

技术分享

sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Fri Feb 6 21:05:43 2015

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

Connected to an idle instance.

SQL> startup nomount
ORACLE instance started.

Total System Global Area 1068937216 bytes
Fixed Size                  2220200 bytes
Variable Size             624955224 bytes
Database Buffers          436207616 bytes
Redo Buffers                5554176 bytes
SQL> quit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@DB200 ~]$ rman target sys/Aa7788123@dadifilma auxiliary sys/Aa7788123@dadifilmb

Recovery Manager: Release 11.2.0.1.0 - Production on Fri Feb 6 21:05:57 2015

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

connected to target database: DADIFILM (DBID=4240448887)
connected to auxiliary database: DADIFILM (not mounted)

RMAN> duplicate target database for standby nofilenamecheck from active database;

Starting Duplicate Db at 06-FEB-15
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=156 device type=DISK

contents of Memory Script:
{
   backup as copy reuse
   targetfile  ‘/data/DBSoftware/app/oracle/product/11.2.0/dbhome_1/dbs/orapwdadifilm‘ auxiliary format
 ‘/data/DBSoftware/app/oracle/product/11.2.0/dbhome_1/dbs/orapwdadifilm‘   ;
}
executing Memory Script

Starting backup at 06-FEB-15
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=128 device type=DISK
Finished backup at 06-FEB-15

contents of Memory Script:
{
   backup as copy current controlfile for standby auxiliary format  ‘/data/DBData/oradata/dadifilm/control01.ctl‘;
   restore clone controlfile to  ‘/data/DBSoftware/app/oracle/flash_recovery_area/dadifilm/control02.ctl‘ from
 ‘/data/DBData/oradata/dadifilm/control01.ctl‘;
}
executing Memory Script

Starting backup at 06-FEB-15
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying standby control file
output file name=/data/DBSoftware/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_dadifilm.f tag=TAG20150206T210609 RECID=2 STAMP=870987969
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 06-FEB-15

Starting restore at 06-FEB-15
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: copied control file copy
Finished restore at 06-FEB-15

contents of Memory Script:
{
   sql clone ‘alter database mount standby database‘;
}
executing Memory Script

sql statement: alter database mount standby database

contents of Memory Script:
{
   set newname for tempfile  1 to
 "/data/DBData/oradata/dadifilm/temp01.dbf";
   switch clone tempfile all;
   set newname for datafile  1 to
 "/data/DBData/oradata/dadifilm/system01.dbf";
   set newname for datafile  2 to
 "/data/DBData/oradata/dadifilm/sysaux01.dbf";
   set newname for datafile  3 to
 "/data/DBData/oradata/dadifilm/undotbs01.dbf";
   set newname for datafile  4 to
 "/data/DBData/oradata/dadifilm/users01.dbf";
   set newname for datafile  5 to
 "/data/DBData/oradata/dadifilm/example01.dbf";
   backup as copy reuse
   datafile  1 auxiliary format
 "/data/DBData/oradata/dadifilm/system01.dbf"   datafile
 2 auxiliary format
 "/data/DBData/oradata/dadifilm/sysaux01.dbf"   datafile
 3 auxiliary format
 "/data/DBData/oradata/dadifilm/undotbs01.dbf"   datafile
 4 auxiliary format
 "/data/DBData/oradata/dadifilm/users01.dbf"   datafile
 5 auxiliary format
 "/data/DBData/oradata/dadifilm/example01.dbf"   ;
   sql ‘alter system archive log current‘;
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to /data/DBData/oradata/dadifilm/temp01.dbf in control file

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting backup at 06-FEB-15
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/data/DBData/oradata/dadifilm/system01.dbf
output file name=/data/DBData/oradata/dadifilm/system01.dbf tag=TAG20150206T210617
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=/data/DBData/oradata/dadifilm/sysaux01.dbf
output file name=/data/DBData/oradata/dadifilm/sysaux01.dbf tag=TAG20150206T210617
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=/data/DBData/oradata/dadifilm/undotbs01.dbf
output file name=/data/DBData/oradata/dadifilm/undotbs01.dbf tag=TAG20150206T210617
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=/data/DBData/oradata/dadifilm/example01.dbf
output file name=/data/DBData/oradata/dadifilm/example01.dbf tag=TAG20150206T210617
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=/data/DBData/oradata/dadifilm/users01.dbf
output file name=/data/DBData/oradata/dadifilm/users01.dbf tag=TAG20150206T210617
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 06-FEB-15

sql statement: alter system archive log current

contents of Memory Script:
{
   switch clone datafile all;
}
executing Memory Script

datafile 1 switched to datafile copy
input datafile copy RECID=2 STAMP=870988015 file name=/data/DBData/oradata/dadifilm/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=3 STAMP=870988015 file name=/data/DBData/oradata/dadifilm/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=4 STAMP=870988015 file name=/data/DBData/oradata/dadifilm/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=5 STAMP=870988015 file name=/data/DBData/oradata/dadifilm/users01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=6 STAMP=870988015 file name=/data/DBData/oradata/dadifilm/example01.dbf
Finished Duplicate Db at 06-FEB-15

 

dg rman

标签:

原文地址:http://www.cnblogs.com/ruiy/p/4278138.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!