BACKUP AS COPY 恢复数据文件

RMAN> run {
2> backup as copy       tag "201307252028_copy" database;
3> }


Starting backup at 2013-07-25 20:28:21
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/u01/app/oracle/oradata/orcl/system01.dbf
output file name=/opt/oracle/obak/bkup_data_D-ORCL_I-1310729769_TS-SYSTEM_FNO-1_3tofle75 tag=201307252028_COPY RECID=15 STAMP=821737792
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:35
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=/u01/app/oracle/oradata/orcl/sysaux01.dbf
output file name=/opt/oracle/obak/bkup_data_D-ORCL_I-1310729769_TS-SYSAUX_FNO-2_3uoflea4 tag=201307252028_COPY RECID=16 STAMP=821737819
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=/u01/app/oracle/oradata/orcl/undotbs01.dbf
output file name=/opt/oracle/obak/bkup_data_D-ORCL_I-1310729769_TS-UNDOTBS1_FNO-3_3vofleat tag=201307252028_COPY RECID=17 STAMP=821737832
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=/u01/app/oracle/oradata/orcl/example01.dbf
output file name=/opt/oracle/obak/bkup_data_D-ORCL_I-1310729769_TS-EXAMPLE_FNO-5_40oflebc tag=201307252028_COPY RECID=18 STAMP=821737839
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile copy
input datafile file number=00008 name=/u01/app/oracle/oradata/orcl/rman01.dbf
output file name=/opt/oracle/obak/bkup_data_D-ORCL_I-1310729769_TS-RMAN_FNO-8_41oflebj tag=201307252028_COPY RECID=19 STAMP=821737847
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile copy
input datafile file number=00009 name=/u01/app/oracle/oradata/orcl/eygle01.dbf
output file name=/opt/oracle/obak/bkup_data_D-ORCL_I-1310729769_TS-EYGLE_FNO-9_42oflebr tag=201307252028_COPY RECID=20 STAMP=821737853
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting datafile copy
input datafile file number=00006 name=/u01/app/oracle/oradata/orcl/jerry.db
output file name=/opt/oracle/obak/bkup_data_D-ORCL_I-1310729769_TS-JERRY_FNO-6_43oflebu tag=201307252028_COPY RECID=21 STAMP=821737854
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting datafile copy
input datafile file number=00007 name=/u01/app/oracle/oradata/orcl/bftbs01.dbf
output file name=/opt/oracle/obak/bkup_data_D-ORCL_I-1310729769_TS-BFTBS_FNO-7_44oflebv tag=201307252028_COPY RECID=22 STAMP=821737855
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=/u01/app/oracle/oradata/orcl/users01.dbf
output file name=/opt/oracle/obak/bkup_data_D-ORCL_I-1310729769_TS-USERS_FNO-4_45oflec0 tag=201307252028_COPY RECID=23 STAMP=821737856
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 2013-07-25 20:30:57


Starting Control File and SPFILE Autobackup at 2013-07-25 20:30:57
piece handle=/u01/app/oracle/flash_recovery_area/ORCL/autobackup/2013_07_25/o1_mf_s_821737857_8z26n1wv_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 2013-07-25 20:30:58


SQL> select file_name,file_id from dba_data_files;       
 
FILE_NAME                                                                           FILE_ID
-------------------------------------------------------------------------------- ----------
/u01/app/oracle/oradata/orcl/users01.dbf                                                  4
/u01/app/oracle/oradata/orcl/undotbs01.dbf                                                3
/u01/app/oracle/oradata/orcl/sysaux01.dbf                                                 2
/u01/app/oracle/oradata/orcl/system01.dbf                                                 1
/u01/app/oracle/oradata/orcl/example01.dbf                                                5
/u01/app/oracle/oradata/orcl/jerry.db                                                     6
/u01/app/oracle/oradata/orcl/bftbs01.dbf                                                  7
/u01/app/oracle/oradata/orcl/rman01.dbf                                                   8
/u01/app/oracle/oradata/orcl/eygle01.dbf                                                  9
 


RMAN> run {
2>     set newname for datafile 1 to '/u01/app/oracle/oradata/orcl/system01.dbf';
3>     restore datafile 1;
4>     switch datafile all;
5>     recover datafile 1;
6>     
7> }


executing command: SET NEWNAME


Starting restore at 2013-07-25 20:33:56
using channel ORA_DISK_1


channel ORA_DISK_1: restoring datafile 00001
input datafile copy RECID=15 STAMP=821737792 file name=/opt/oracle/obak/bkup_data_D-ORCL_I-1310729769_TS-SYSTEM_FNO-1_3tofle75
destination for restore of datafile 00001: /u01/app/oracle/oradata/orcl/system01.dbf
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 07/25/2013 20:33:56
ORA-19573: cannot obtain exclusive enqueue for datafile 1
ORA-19600: input file is datafile-copy 15 (/opt/oracle/obak/bkup_data_D-ORCL_I-1310729769_TS-SYSTEM_FNO-1_3tofle75)
ORA-19601: output file is datafile 1 (/u01/app/oracle/oradata/orcl/system01.dbf)


RMAN> shutdown immediate;


database closed
database dismounted
Oracle instance shut down


RMAN> startup mount;


connected to target database (not started)
Oracle instance started
database mounted


Total System Global Area     451981312 bytes


Fixed Size                     1337100 bytes
Variable Size                331352308 bytes
Database Buffers             113246208 bytes
Redo Buffers                   6045696 bytes


RMAN> run {
2>     set newname for datafile 1 to '/u01/app/oracle/oradata/orcl/system01.dbf';
3>     restore datafile 1;
4>     switch datafile all;
5>     recover datafile 1;
6>     
7> }


executing command: SET NEWNAME


Starting restore at 2013-07-25 20:41:23
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=22 device type=DISK


channel ORA_DISK_1: restoring datafile 00001
input datafile copy RECID=15 STAMP=821737792 file name=/opt/oracle/obak/bkup_data_D-ORCL_I-1310729769_TS-SYSTEM_FNO-1_3tofle75
destination for restore of datafile 00001: /u01/app/oracle/oradata/orcl/system01.dbf
channel ORA_DISK_1: copied datafile copy of datafile 00001
output file name=/u01/app/oracle/oradata/orcl/system01.dbf RECID=0 STAMP=0
Finished restore at 2013-07-25 20:42:48




Starting recover at 2013-07-25 20:42:49
using channel ORA_DISK_1


starting media recovery
media recovery complete, elapsed time: 00:00:00


Finished recover at 2013-07-25 20:42:49


RMAN> alter database open;


database opened
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值