这里分两个数据库;
本地数据库sid=PROD1 ip:192.168.0.11
远端数据库(应该说是数据库软件)ip:192.168.0.15
本地库和目标库sid应该一样,(因为我们用的是本地库的控制文件,如果sid不一样,不法使用,到时候控制文件里的database name无法改)
而本地路径和远端库路径可以一样,只不过这样更简单恢复。而路径不一样也没事,用set newname for datafile ,但必须写在run块里)
1、在本地数据库创建完整备份(数据文件、归档日志、控制文件)
RMAN> backup database plus archivelog;
Starting backup at 27-FEB-16
current log archived
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=39 device type=DISK
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=73 RECID=9 STAMP=904917179
input archived log thread=1 sequence=74 RECID=8 STAMP=904917179
input archived log thread=1 sequence=75 RECID=4 STAMP=904917179
input archived log thread=1 sequence=76 RECID=11 STAMP=904917179
input archived log thread=1 sequence=77 RECID=6 STAMP=904917179
input archived log thread=1 sequence=78 RECID=2 STAMP=904917179
input archived log thread=1 sequence=79 RECID=10 STAMP=904917179
input archived log thread=1 sequence=80 RECID=12 STAMP=904917179
input archived log thread=1 sequence=81 RECID=13 STAMP=904917179
channel ORA_DISK_1: starting piece 1 at 27-FEB-16
channel ORA_DISK_1: finished piece 1 at 27-FEB-16
piece handle=/u01/app/oracle/fast_recovery_area/PROD1/backupset/2016_02_27/o1_mf_annnn_TAG20160227T203013_cf35po7c_.bkp tag=TAG20160227T203013 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=1 RECID=18 STAMP=904917179
input archived log thread=1 sequence=2 RECID=17 STAMP=904917179
channel ORA_DISK_1: starting piece 1 at 27-FEB-16
channel ORA_DISK_1: finished piece 1 at 27-FEB-16
piece handle=/u01/app/oracle/fast_recovery_area/PROD1/backupset/2016_02_27/o1_mf_annnn_TAG20160227T203013_cf35pp92_.bkp tag=TAG20160227T203013 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=1 RECID=5 STAMP=904917179
input archived log thread=1 sequence=2 RECID=14 STAMP=904917179
input archived log thread=1 sequence=3 RECID=21 STAMP=904917179
input archived log thread=1 sequence=4 RECID=19 STAMP=904917179
input archived log thread=1 sequence=5 RECID=23 STAMP=904917179
channel ORA_DISK_1: starting piece 1 at 27-FEB-16
channel ORA_DISK_1: finished piece 1 at 27-FEB-16
piece handle=/u01/app/oracle/fast_recovery_area/PROD1/backupset/2016_02_27/o1_mf_annnn_TAG20160227T203013_cf35pqbq_.bkp tag=TAG20160227T203013 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=1 RECID=25 STAMP=904920922
input archived log thread=1 sequence=2 RECID=26 STAMP=904920922
input archived log thread=1 sequence=3 RECID=27 STAMP=904920922
channel ORA_DISK_1: starting piece 1 at 27-FEB-16
channel ORA_DISK_1: finished piece 1 at 27-FEB-16
piece handle=/u01/app/oracle/fast_recovery_area/PROD1/backupset/2016_02_27/o1_mf_annnn_TAG20160227T203013_cf35prdd_.bkp tag=TAG20160227T203013 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=1 RECID=28 STAMP=904923996
input archived log thread=1 sequence=2 RECID=29 STAMP=904923999
input archived log thread=1 sequence=3 RECID=30 STAMP=904924002
input archived log thread=1 sequence=4 RECID=31 STAMP=904924006
input archived log thread=1 sequence=5 RECID=32 STAMP=904924010
input archived log thread=1 sequence=6 RECID=33 STAMP=904924013
input archived log thread=1 sequence=7 RECID=34 STAMP=904924017
input archived log thread=1 sequence=8 RECID=35 STAMP=904924020
input archived log thread=1 sequence=9 RECID=36 STAMP=904924024
input archived log thread=1 sequence=10 RECID=37 STAMP=904924027
input archived log thread=1 sequence=11 RECID=38 STAMP=904924031
input archived log thread=1 sequence=12 RECID=39 STAMP=904924035
input archived log thread=1 sequence=13 RECID=40 STAMP=904924038
input archived log thread=1 sequence=14 RECID=46 STAMP=904925214
input archived log thread=1 sequence=15 RECID=41 STAMP=904925214
input archived log thread=1 sequence=16 RECID=42 STAMP=904925214
input archived log thread=1 sequence=17 RECID=44 STAMP=904925214
input archived log thread=1 sequence=18 RECID=43 STAMP=904925214
input archived log thread=1 sequence=19 RECID=48 STAMP=904926339
input archived log thread=1 sequence=20 RECID=49 STAMP=904926340
input archived log thread=1 sequence=21 RECID=50 STAMP=904926340
channel ORA_DISK_1: starting piece 1 at 27-FEB-16
channel ORA_DISK_1: finished piece 1 at 27-FEB-16
piece handle=/u01/app/oracle/fast_recovery_area/PROD1/backupset/2016_02_27/o1_mf_annnn_TAG20160227T203013_cf35psgn_.bkp tag=TAG20160227T203013 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=1 RECID=51 STAMP=904928710
input archived log thread=1 sequence=2 RECID=52 STAMP=904928778
input archived log thread=1 sequence=3 RECID=53 STAMP=904940992
input archived log thread=1 sequence=4 RECID=54 STAMP=904941012
channel ORA_DISK_1: starting piece 1 at 27-FEB-16
channel ORA_DISK_1: finished piece 1 at 27-FEB-16
piece handle=/u01/app/oracle/fast_recovery_area/PROD1/backupset/2016_02_27/o1_mf_annnn_TAG20160227T203013_cf35q8jb_.bkp tag=TAG20160227T203013 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 27-FEB-16
Starting backup at 27-FEB-16
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/PROD1/system01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/PROD1/undotbs01.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/PROD1/sysaux01.dbf
input datafile file number=00007 name=/u01/app/oracle/oradata/tt01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/tbs01.dbf
input datafile file number=00006 name=/u01/app/oracle/oradata/ts01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/PROD1/users01.dbf
channel ORA_DISK_1: starting piece 1 at 27-FEB-16
channel ORA_DISK_1: finished piece 1 at 27-FEB-16
piece handle=/u01/app/oracle/fast_recovery_area/PROD1/backupset/2016_02_27/o1_mf_nnndf_TAG20160227T203033_cf35q9p6_.bkp tag=TAG20160227T203033 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 27-FEB-16
channel ORA_DISK_1: finished piece 1 at 27-FEB-16
piece handle=/u01/app/oracle/fast_recovery_area/PROD1/backupset/2016_02_27/o1_mf_ncsnf_TAG20160227T203033_cf35qsq9_.bkp tag=TAG20160227T203033 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 27-FEB-16
Starting backup at 27-FEB-16
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=5 RECID=55 STAMP=904941050
channel ORA_DISK_1: starting piece 1 at 27-FEB-16
channel ORA_DISK_1: finished piece 1 at 27-FEB-16
piece handle=/u01/app/oracle/fast_recovery_area/PROD1/backupset/2016_02_27/o1_mf_annnn_TAG20160227T203050_cf35qttx_.bkp tag=TAG20160227T203050 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 27-FEB-16
RMAN> backup current controlfile;
Starting backup at 27-FEB-16
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
channel ORA_DISK_1: starting piece 1 at 27-FEB-16
channel ORA_DISK_1: finished piece 1 at 27-FEB-16
piece handle=/u01/app/oracle/fast_recovery_area/PROD1/backupset/2016_02_27/o1_mf_ncnnf_TAG20160227T203118_cf35rqkg_.bkp tag=TAG20160227T203118 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 27-FEB-16
2、把备份集和参数文件传到远端库
[oracle@localhost dbs]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Sat Feb 27 20:47:43 2016
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> create pfile from spfile;
File created.
SQL> !
[oracle@localhost dbs]$ ls
cntrlPROD1.dbf hc_PROD.dat initPROD1.ora lkPROD1 snapcf_PROD1.f spfilePROD1.ora.bak
hc_PROD1.dat init.ora lkDUMMY orapwPROD1 spfilePROD1.ora
scp initPROD1.ora domain:/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initPROD1.ora
The authenticity of host 'domain (192.168.0.15)' can't be established.
RSA key fingerprint is 78:dc:af:49:74:74:72:81:b5:7a:47:76:b1:03:71:fa.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'domain,192.168.0.15' (RSA) to the list of known hosts.
oracle@domain's password:
initPROD1.ora 100% 975 1.0KB/s 00:00
[oracle@localhost 2016_02_27]$ scp *.bkp domain:/u01/app/oracle/fast_recovery_area/
oracle@domain's password:
o1_mf_annnn_TAG20160227T203013_cf35po7c_.bkp 100% 32MB 31.6MB/s 00:01
o1_mf_annnn_TAG20160227T203013_cf35pp92_.bkp 100% 3274KB 3.2MB/s 00:00
o1_mf_annnn_TAG20160227T203013_cf35pqbq_.bkp 100% 2500KB 2.4MB/s 00:00
o1_mf_annnn_TAG20160227T203013_cf35prdd_.bkp 100% 3447KB 3.4MB/s 00:00
o1_mf_annnn_TAG20160227T203013_cf35psgn_.bkp 100% 954MB 106.0MB/s 00:09
o1_mf_annnn_TAG20160227T203013_cf35q8jb_.bkp 100% 3720KB 3.6MB/s 00:00
o1_mf_annnn_TAG20160227T203050_cf35qttx_.bkp 100% 4096 4.0KB/s 00:00
o1_mf_ncnnf_TAG20160227T203118_cf35rqkg_.bkp 100% 9888KB 9.7MB/s 00:01
o1_mf_ncsnf_TAG20160227T203033_cf35qsq9_.bkp 100% 9920KB 9.7MB/s 00:00
o1_mf_nnndf_TAG20160227T203033_cf35q9p6_.bkp 100% 1379MB 98.5MB/s 00:14
3、创建参数文件相关目录(在远端数据库)
[oracle@domain ~]$ mkdir -p /u01/app/oracle/admin/PROD1/adump
[oracle@domain ~]$ mkdir -p /u01/app/oracle/oradata/PROD1/
[oracle@domain ~]$ mkdir -p /u01/app/oracle/fast_recovery_area/PROD1/
[oracle@domain ~]$ mkdir -p /u01/app/oracle/fast_recovery_area/PROD1/backupset/2016_02_27/
4、恢复控制文件
[oracle@domain dbs]$ rman target/
Recovery Manager: Release 11.2.0.4.0 - Production on Sat Feb 27 21:17:30 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: PROD1 (not mounted)
RMAN> restore controlfile from '/u01/app/oracle/fast_recovery_area/o1_mf_ncnnf_TAG20160227T203118_cf35rqkg_.bkp'; 知道路径不用DBID
Starting restore at 27-FEB-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=20 device type=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/app/oracle/oradata/PROD1/control01.ctl
output file name=/u01/app/oracle/fast_recovery_area/PROD1/control02.ctl
Finished restore at 27-FEB-16
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
5、恢复数据库
RMAN> restore database;
Starting restore at 27-FEB-16
Starting implicit crosscheck backup at 27-FEB-16
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=20 device type=DISK
Crosschecked 18 objects
Finished implicit crosscheck backup at 27-FEB-16
Starting implicit crosscheck copy at 27-FEB-16
using channel ORA_DISK_1
Finished implicit crosscheck copy at 27-FEB-16
searching for all files in the recovery area
cataloging files...
no files cataloged
using channel ORA_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 02/27/2016 21:18:37
RMAN-06026: some targets not found - aborting restore
RMAN-06023: no backup or copy of datafile 7 found to restore
RMAN-06023: no backup or copy of datafile 6 found to restore
RMAN-06023: no backup or copy of datafile 5 found to restore
RMAN-06023: no backup or copy of datafile 4 found to restore
RMAN-06023: no backup or copy of datafile 3 found to restore
RMAN-06023: no backup or copy of datafile 2 found to restore
RMAN-06023: no backup or copy of datafile 1 found to restore
RMAN> restore database;
Starting restore at 27-FEB-16
using channel ORA_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 02/27/2016 21:22:44
RMAN-06026: some targets not found - aborting restore
RMAN-06023: no backup or copy of datafile 7 found to restore
RMAN-06023: no backup or copy of datafile 6 found to restore
RMAN-06023: no backup or copy of datafile 5 found to restore
RMAN-06023: no backup or copy of datafile 4 found to restore
RMAN-06023: no backup or copy of datafile 3 found to restore
RMAN-06023: no backup or copy of datafile 2 found to restore
RMAN-06023: no backup or copy of datafile 1 found to restore
RMAN> list backup;
specification does not match any backup in the repository
RMAN> catalog start with '/u01/app/oracle/fast_recovery_area/PROD1/backupset'; 如果备份集没放到默认位置,控制文件是不知道的,此时可以注册进去用catalog start with 加路径
searching for all files that match the pattern /u01/app/oracle/fast_recovery_area/PROD1/backupset
List of Files Unknown to the Database
=====================================
File Name: /u01/app/oracle/fast_recovery_area/PROD1/backupset/2016_02_27/o1_mf_annnn_TAG20160227T203013_cf35pqbq_.bkp
File Name: /u01/app/oracle/fast_recovery_area/PROD1/backupset/2016_02_27/o1_mf_nnndf_TAG20160227T203033_cf35q9p6_.bkp
File Name: /u01/app/oracle/fast_recovery_area/PROD1/backupset/2016_02_27/o1_mf_annnn_TAG20160227T203050_cf35qttx_.bkp
File Name: /u01/app/oracle/fast_recovery_area/PROD1/backupset/2016_02_27/o1_mf_annnn_TAG20160227T203013_cf35po7c_.bkp
File Name: /u01/app/oracle/fast_recovery_area/PROD1/backupset/2016_02_27/o1_mf_annnn_TAG20160227T203013_cf35pp92_.bkp
File Name: /u01/app/oracle/fast_recovery_area/PROD1/backupset/2016_02_27/o1_mf_ncsnf_TAG20160227T203033_cf35qsq9_.bkp
File Name: /u01/app/oracle/fast_recovery_area/PROD1/backupset/2016_02_27/o1_mf_annnn_TAG20160227T203013_cf35prdd_.bkp
File Name: /u01/app/oracle/fast_recovery_area/PROD1/backupset/2016_02_27/o1_mf_ncnnf_TAG20160227T203118_cf35rqkg_.bkp
File Name: /u01/app/oracle/fast_recovery_area/PROD1/backupset/2016_02_27/o1_mf_annnn_TAG20160227T203013_cf35psgn_.bkp
File Name: /u01/app/oracle/fast_recovery_area/PROD1/backupset/2016_02_27/o1_mf_annnn_TAG20160227T203013_cf35q8jb_.bkp
Do you really want to catalog the above files (enter YES or NO)? yes
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: /u01/app/oracle/fast_recovery_area/PROD1/backupset/2016_02_27/o1_mf_annnn_TAG20160227T203013_cf35pqbq_.bkp
File Name: /u01/app/oracle/fast_recovery_area/PROD1/backupset/2016_02_27/o1_mf_nnndf_TAG20160227T203033_cf35q9p6_.bkp
File Name: /u01/app/oracle/fast_recovery_area/PROD1/backupset/2016_02_27/o1_mf_annnn_TAG20160227T203050_cf35qttx_.bkp
File Name: /u01/app/oracle/fast_recovery_area/PROD1/backupset/2016_02_27/o1_mf_annnn_TAG20160227T203013_cf35po7c_.bkp
File Name: /u01/app/oracle/fast_recovery_area/PROD1/backupset/2016_02_27/o1_mf_annnn_TAG20160227T203013_cf35pp92_.bkp
File Name: /u01/app/oracle/fast_recovery_area/PROD1/backupset/2016_02_27/o1_mf_ncsnf_TAG20160227T203033_cf35qsq9_.bkp
File Name: /u01/app/oracle/fast_recovery_area/PROD1/backupset/2016_02_27/o1_mf_annnn_TAG20160227T203013_cf35prdd_.bkp
File Name: /u01/app/oracle/fast_recovery_area/PROD1/backupset/2016_02_27/o1_mf_ncnnf_TAG20160227T203118_cf35rqkg_.bkp
File Name: /u01/app/oracle/fast_recovery_area/PROD1/backupset/2016_02_27/o1_mf_annnn_TAG20160227T203013_cf35psgn_.bkp
File Name: /u01/app/oracle/fast_recovery_area/PROD1/backupset/2016_02_27/o1_mf_annnn_TAG20160227T203013_cf35q8jb_.bkp
RMAN> recover database;
Starting recover at 27-FEB-16
using channel ORA_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 02/27/2016 21:25:06
RMAN-06094: datafile 1 must be restored
RMAN> restore datafile 1;
Starting restore at 27-FEB-16
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /u01/app/oracle/oradata/PROD1/system01.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/fast_recovery_area/PROD1/backupset/2016_02_27/o1_mf_nnndf_TAG20160227T203033_cf35q9p6_.bkp
channel ORA_DISK_1: piece handle=/u01/app/oracle/fast_recovery_area/PROD1/backupset/2016_02_27/o1_mf_nnndf_TAG20160227T203033_cf35q9p6_.bkp tag=TAG20160227T203033
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:07
Finished restore at 27-FEB-16
RMAN> alter database open;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 02/27/2016 21:25:59
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
RMAN> alter database open resetlogs;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 02/27/2016 21:26:09
ORA-01152: file 1 was not restored from a sufficiently old backup
ORA-01110: data file 1: '/u01/app/oracle/oradata/PROD1/system01.dbf'
RMAN> restore database;
Starting restore at 27-FEB-16
using channel ORA_DISK_1
skipping datafile 1; already restored to file /u01/app/oracle/oradata/PROD1/system01.dbf
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00002 to /u01/app/oracle/oradata/PROD1/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/PROD1/undotbs01.dbf
channel ORA_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/PROD1/users01.dbf
channel ORA_DISK_1: restoring datafile 00005 to /u01/app/oracle/oradata/tbs01.dbf
channel ORA_DISK_1: restoring datafile 00006 to /u01/app/oracle/oradata/ts01.dbf
channel ORA_DISK_1: restoring datafile 00007 to /u01/app/oracle/oradata/tt01.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/fast_recovery_area/PROD1/backupset/2016_02_27/o1_mf_nnndf_TAG20160227T203033_cf35q9p6_.bkp
channel ORA_DISK_1: piece handle=/u01/app/oracle/fast_recovery_area/PROD1/backupset/2016_02_27/o1_mf_nnndf_TAG20160227T203033_cf35q9p6_.bkp tag=TAG20160227T203033
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:15
Finished restore at 27-FEB-16
RMAN> recover database;
Starting recover at 27-FEB-16
using channel ORA_DISK_1
starting media recovery
channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=5
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/fast_recovery_area/PROD1/backupset/2016_02_27/o1_mf_annnn_TAG20160227T203050_cf35qttx_.bkp
channel ORA_DISK_1: piece handle=/u01/app/oracle/fast_recovery_area/PROD1/backupset/2016_02_27/o1_mf_annnn_TAG20160227T203050_cf35qttx_.bkp tag=TAG20160227T203050
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
archived log file name=/u01/app/oracle/fast_recovery_area/PROD1/archivelog/2016_02_27/o1_mf_1_5_cf397p5r_.arc thread=1 sequence=5
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/fast_recovery_area/PROD1/archivelog/2016_02_27/o1_mf_1_5_cf397p5r_.arc RECID=56 STAMP=904944630
unable to find archived log
archived log thread=1 sequence=6
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 02/27/2016 21:30:31
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 6 and starting SCN of 1195148
RMAN> recover database until cancel;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "cancel": expecting one of: "scn, sequence, time"
RMAN-01007: at line 1 column 24 file: standard input
RMAN> recover database until sequence 5;
Starting recover at 27-FEB-16
using channel ORA_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 02/27/2016 21:33:06
RMAN-06556: datafile 1 must be restored from backup older than SCN 1195123
RMAN> recover database;
Starting recover at 27-FEB-16
using channel ORA_DISK_1
starting media recovery
unable to find archived log
archived log thread=1 sequence=6
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 02/27/2016 21:33:29
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 6 and starting SCN of 1195148
RMAN> recover database until scn 1195148;
Starting recover at 27-FEB-16
using channel ORA_DISK_1
starting media recovery
media recovery complete, elapsed time: 00:00:00
Finished recover at 27-FEB-16
RMAN> alter database open resetlogs;
database opened
整体是一个不完全恢复,因为没有在线日志,当然可以把本地库shutdown,然后拷贝日志文件做完全恢复。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/30604784/viewspace-2072346/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/30604784/viewspace-2072346/