cdb+pdb$seed全备 (由于cdb和pdb$seed种子库所占空间总容量不多,所以每次都可以执行全备,不完全恢复的时候,restore时注意选择cdb库的时间)
RUN{
ALLOCATE CHANNEL ch0 TYPE DISK;
backup as compressed backupset INCREMENTAL LEVEL=0 FILESPERSET 5 database root tag cdbfull_lv0 format '/u01/arch/bk_%s_%p_%t';
backup as compressed backupset INCREMENTAL LEVEL=0 FILESPERSET 5 database 'PDB$SEED' force tag cdbfull_lv0 format '/u01/arch/bk_%s_%p_%t';
RELEASE CHANNEL ch0;
}
pdb全备
RUN {
# backup all archive logs
ALLOCATE CHANNEL ch0 TYPE DISK;
backup as compressed backupset INCREMENTAL LEVEL=0 FILESPERSET 5 pluggable database ERWAPDB tag pdbfull_lv0 format '/u01/arch/bk_%s_%p_%t';
sql 'alter system archive log current';
backup as compressed backupset filesperset 20 FORMAT '/u01/arch/al_%s_%p_%t' ARCHIVELOG ALL;
backup FORMAT '/u01/arch/cntrl_%s_%p_%t' CURRENT CONTROLFILE tag=cntrl_lv0;
backup FORMAT '/u01/arch/spfile_%s_%p_%t' spfile tag=sfile_lv0;
RELEASE CHANNEL ch0;
}
pdb累积差异备份
RUN {
# backup all archive logs
ALLOCATE CHANNEL ch0 TYPE DISK;
backup as compressed backupset INCREMENTAL LEVEL=1 CUMULATIVE FILESPERSET 5 pluggable database ERWAPDB tag pdbfull_lv0 format '/u01/arch/bk_%s_%p_%t';
sql 'alter system archive log current';
backup as compressed backupset filesperset 20 FORMAT '/u01/arch/al_%s_%p_%t' ARCHIVELOG ALL;
backup FORMAT '/u01/arch/cntrl_%s_%p_%t' CURRENT CONTROLFILE tag=cntrl_lv0;
backup FORMAT '/u01/arch/spfile_%s_%p_%t' spfile tag=sfile_lv0;
RELEASE CHANNEL ch0;
}
参考资料:
How to use Rman to Restore Of Single PDB in Multitenant to Alternate Server (文档 ID 2142675.1)
Missing PDB$SEED's Datafiles with no backup (文档 ID 2104370.1)
R12c 新特性:RMAN 可插拔数据库的备份和恢复 (文档 ID 1945849.1)
测试的log记录
cdb全备:
[oracle@lxtrac05 arch]$ rman target /
Recovery Manager: Release 18.0.0.0.0 - Production on Mon Aug 13 15:28:45 2018
Version 18.3.0.0.0
Copyright (c) 1982, 2018, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1510984000)
RMAN> RUN{
2> ALLOCATE CHANNEL ch0 TYPE DISK;
3> backup as compressed backupset INCREMENTAL LEVEL=0 FILESPERSET 5 database root tag cdbfull_lv0 format '/u01/arch/bk_%s_%p_%t';
4> backup as compressed backupset INCREMENTAL LEVEL=0 FILESPERSET 5 database "PDB$SEED" tag cdbfull_lv0 format '/u01/arch/bk_%s_%p_%t';
5> RELEASE CHANNEL ch0;
6> }
using target database control file instead of recovery catalog
allocated channel: ch0
channel ch0: SID=400 device type=DISK
Starting backup at 13-AUG-18
channel ch0: starting compressed incremental level 0 datafile backup set
channel ch0: specifying datafile(s) in backup set
input datafile file number=00003 name=/u01/app/oracle/oradata/ORCL/sysaux01.dbf
input datafile file number=00001 name=/u01/app/oracle/oradata/ORCL/system01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/ORCL/undotbs01.dbf
input datafile file number=00007 name=/u01/app/oracle/oradata/ORCL/users01.dbf
channel ch0: starting piece 1 at 13-AUG-18
channel ch0: finished piece 1 at 13-AUG-18
piece handle=/u01/arch/bk_101_1_984065363 tag=CDBFULL_LV0 comment=NONE
channel ch0: backup set complete, elapsed time: 00:00:55
Finished backup at 13-AUG-18
Starting backup at 13-AUG-18
channel ch0: starting compressed incremental level 0 datafile backup set
channel ch0: specifying datafile(s) in backup set
input datafile file number=00006 name=/u01/app/oracle/oradata/ORCL/pdbseed/sysaux01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/ORCL/pdbseed/system01.dbf
input datafile file number=00008 name=/u01/app/oracle/oradata/ORCL/pdbseed/undotbs01.dbf
channel ch0: starting piece 1 at 13-AUG-18
channel ch0: finished piece 1 at 13-AUG-18
piece handle=/u01/arch/bk_102_1_984065418 tag=CDBFULL_LV0 comment=NONE
channel ch0: backup set complete, elapsed time: 00:00:25
Finished backup at 13-AUG-18
Starting Control File and SPFILE Autobackup at 13-AUG-18
piece handle=/u01/arch/ORCL/autobackup/2018_08_13/o1_mf_s_984065444_fq2dx43y_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 13-AUG-18
released channel: ch0
RMAN>
pdb全备+归档日志备份:
[oracle@lxtrac05 arch]$ rman target /
Recovery Manager: Release 18.0.0.0.0 - Production on Mon Aug 13 15:32:51 2018
Version 18.3.0.0.0
Copyright (c) 1982, 2018, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1510984000)
RMAN> RUN {
2> # backup all archive logs
3> ALLOCATE CHANNEL ch0 TYPE DISK;
4> backup as compressed backupset INCREMENTAL LEVEL=0 FILESPERSET 5 pluggable database ERWAPDB tag pdbfull_lv0 format '/u01/arch/bk_%s_%p_%t';
5> sql 'alter system archive log current';
6> backup as compressed backupset filesperset 20 FORMAT '/u01/arch/al_%s_%p_%t' ARCHIVELOG ALL;
7> backup FORMAT '/u01/arch/cntrl_%s_%p_%t' CURRENT CONTROLFILE tag=cntrl_lv0;
8> backup FORMAT '/u01/arch/spfile_%s_%p_%t' spfile tag=sfile_lv0;
9> RELEASE CHANNEL ch0;
10> }
using target database control file instead of recovery catalog
allocated channel: ch0
channel ch0: SID=397 device type=DISK
Starting backup at 13-AUG-18
channel ch0: starting compressed incremental level 0 datafile backup set
channel ch0: specifying datafile(s) in backup set
input datafile file number=00010 name=/u01/app/oracle/oradata/ORCL/erwapdb/sysaux01.dbf
channel ch0: starting piece 1 at 13-AUG-18
channel ch0: finished piece 1 at 13-AUG-18
piece handle=/u01/arch/bk_104_1_984065573 tag=PDBFULL_LV0 comment=NONE
channel ch0: backup set complete, elapsed time: 00:00:25
channel ch0: starting compressed incremental level 0 datafile backup set
channel ch0: specifying datafile(s) in backup set
input datafile file number=00009 name=/u01/app/oracle/oradata/ORCL/erwapdb/system01.dbf
input datafile file number=00011 name=/u01/app/oracle/oradata/ORCL/erwapdb/undotbs01.dbf
input datafile file number=00013 name=/u01/app/oracle/oradata/ORCL/erwapdb/erwa01.dbf
input datafile file number=00012 name=/u01/app/oracle/oradata/ORCL/erwapdb/users01.dbf
input datafile file number=00014 name=/u01/app/oracle/oradata/ORCL/erwapdb/test02.dbf
channel ch0: starting piece 1 at 13-AUG-18
channel ch0: finished piece 1 at 13-AUG-18
piece handle=/u01/arch/bk_105_1_984065598 tag=PDBFULL_LV0 comment=NONE
channel ch0: backup set complete, elapsed time: 00:00:15
Finished backup at 13-AUG-18
Starting Control File and SPFILE Autobackup at 13-AUG-18
piece handle=/u01/arch/ORCL/autobackup/2018_08_13/o1_mf_s_984065613_fq2f2g3p_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 13-AUG-18
sql statement: alter system archive log current
Starting backup at 13-AUG-18
current log archived
channel ch0: starting compressed archived log backup set
channel ch0: specifying archived log(s) in backup set
input archived log thread=1 sequence=61 RECID=39 STAMP=984047671
input archived log thread=1 sequence=62 RECID=40 STAMP=984047671
input archived log thread=1 sequence=63 RECID=41 STAMP=984048277
input archived log thread=1 sequence=64 RECID=42 STAMP=984048277
input archived log thread=1 sequence=65 RECID=43 STAMP=984059334
input archived log thread=1 sequence=66 RECID=44 STAMP=984059384
input archived log thread=1 sequence=67 RECID=45 STAMP=984059387
input archived log thread=1 sequence=68 RECID=46 STAMP=984059627
input archived log thread=1 sequence=69 RECID=47 STAMP=984059627
input archived log thread=1 sequence=70 RECID=48 STAMP=984059630
input archived log thread=1 sequence=71 RECID=49 STAMP=984059630
input archived log thread=1 sequence=72 RECID=50 STAMP=984059712
input archived log thread=1 sequence=73 RECID=51 STAMP=984059713
input archived log thread=1 sequence=74 RECID=52 STAMP=984059723
input archived log thread=1 sequence=75 RECID=53 STAMP=984059723
input archived log thread=1 sequence=76 RECID=54 STAMP=984064487
input archived log thread=1 sequence=77 RECID=55 STAMP=984064487
input archived log thread=1 sequence=78 RECID=56 STAMP=984065615
input archived log thread=1 sequence=79 RECID=57 STAMP=984065615
channel ch0: starting piece 1 at 13-AUG-18
channel ch0: finished piece 1 at 13-AUG-18
piece handle=/u01/arch/al_107_1_984065615 tag=TAG20180813T153335 comment=NONE
channel ch0: backup set complete, elapsed time: 00:00:07
Finished backup at 13-AUG-18
Starting backup at 13-AUG-18
channel ch0: starting full datafile backup set
channel ch0: specifying datafile(s) in backup set
including current control file in backup set
channel ch0: starting piece 1 at 13-AUG-18
channel ch0: finished piece 1 at 13-AUG-18
piece handle=/u01/arch/cntrl_108_1_984065623 tag=CNTRL_LV0 comment=NONE
channel ch0: backup set complete, elapsed time: 00:00:01
Finished backup at 13-AUG-18
Starting backup at 13-AUG-18
channel ch0: starting full datafile backup set
channel ch0: specifying datafile(s) in backup set
including current SPFILE in backup set
channel ch0: starting piece 1 at 13-AUG-18
channel ch0: finished piece 1 at 13-AUG-18
piece handle=/u01/arch/spfile_109_1_984065625 tag=SFILE_LV0 comment=NONE
channel ch0: backup set complete, elapsed time: 00:00:01
Finished backup at 13-AUG-18
Starting Control File and SPFILE Autobackup at 13-AUG-18
piece handle=/u01/arch/ORCL/autobackup/2018_08_13/o1_mf_s_984065626_fq2f2tk0_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 13-AUG-18
released channel: ch0
RMAN>
pdb累积增量备份
[oracle@lxtrac05 arch]$ rman target /
Recovery Manager: Release 18.0.0.0.0 - Production on Mon Aug 13 15:40:42 2018
Version 18.3.0.0.0
Copyright (c) 1982, 2018, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1510984000)
RMAN> RUN {
2> # backup all archive logs
3> ALLOCATE CHANNEL ch0 TYPE DISK;
4> backup as compressed backupset INCREMENTAL LEVEL=1 CUMULATIVE FILESPERSET 5 pluggable database ERWAPDB tag pdbfull_lv0 format '/u01/arch/bk_%s_%p_%t';
5> sql 'alter system archive log current';
6> backup as compressed backupset filesperset 20 FORMAT '/u01/arch/al_%s_%p_%t' ARCHIVELOG ALL;
7> backup FORMAT '/u01/arch/cntrl_%s_%p_%t' CURRENT CONTROLFILE tag=cntrl_lv0;
8> backup FORMAT '/u01/arch/spfile_%s_%p_%t' spfile tag=sfile_lv0;
9> RELEASE CHANNEL ch0;
10> }
using target database control file instead of recovery catalog
allocated channel: ch0
channel ch0: SID=397 device type=DISK
Starting backup at 13-AUG-18
channel ch0: starting compressed incremental level 1 datafile backup set
channel ch0: specifying datafile(s) in backup set
input datafile file number=00010 name=/u01/app/oracle/oradata/ORCL/erwapdb/sysaux01.dbf
channel ch0: starting piece 1 at 13-AUG-18
channel ch0: finished piece 1 at 13-AUG-18
piece handle=/u01/arch/bk_111_1_984066053 tag=PDBFULL_LV0 comment=NONE
channel ch0: backup set complete, elapsed time: 00:00:01
channel ch0: starting compressed incremental level 1 datafile backup set
channel ch0: specifying datafile(s) in backup set
input datafile file number=00009 name=/u01/app/oracle/oradata/ORCL/erwapdb/system01.dbf
input datafile file number=00011 name=/u01/app/oracle/oradata/ORCL/erwapdb/undotbs01.dbf
input datafile file number=00013 name=/u01/app/oracle/oradata/ORCL/erwapdb/erwa01.dbf
input datafile file number=00012 name=/u01/app/oracle/oradata/ORCL/erwapdb/users01.dbf
input datafile file number=00015 name=/u01/app/oracle/oradata/ORCL/erwapdb/test03.dbf
channel ch0: starting piece 1 at 13-AUG-18
channel ch0: finished piece 1 at 13-AUG-18
piece handle=/u01/arch/bk_112_1_984066055 tag=PDBFULL_LV0 comment=NONE
channel ch0: backup set complete, elapsed time: 00:00:01
Finished backup at 13-AUG-18
Starting Control File and SPFILE Autobackup at 13-AUG-18
piece handle=/u01/arch/ORCL/autobackup/2018_08_13/o1_mf_s_984066056_fq2fj895_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 13-AUG-18
sql statement: alter system archive log current
Starting backup at 13-AUG-18
current log archived
channel ch0: starting compressed archived log backup set
channel ch0: specifying archived log(s) in backup set
input archived log thread=1 sequence=61 RECID=39 STAMP=984047671
channel ch0: starting piece 1 at 13-AUG-18
channel ch0: finished piece 1 at 13-AUG-18
piece handle=/u01/arch/al_114_1_984066057 tag=TAG20180813T154057 comment=NONE
channel ch0: backup set complete, elapsed time: 00:00:07
channel ch0: starting compressed archived log backup set
channel ch0: specifying archived log(s) in backup set
input archived log thread=1 sequence=62 RECID=40 STAMP=984047671
input archived log thread=1 sequence=63 RECID=41 STAMP=984048277
input archived log thread=1 sequence=64 RECID=42 STAMP=984048277
input archived log thread=1 sequence=65 RECID=43 STAMP=984059334
input archived log thread=1 sequence=66 RECID=44 STAMP=984059384
input archived log thread=1 sequence=67 RECID=45 STAMP=984059387
input archived log thread=1 sequence=68 RECID=46 STAMP=984059627
input archived log thread=1 sequence=69 RECID=47 STAMP=984059627
input archived log thread=1 sequence=70 RECID=48 STAMP=984059630
input archived log thread=1 sequence=71 RECID=49 STAMP=984059630
input archived log thread=1 sequence=72 RECID=50 STAMP=984059712
input archived log thread=1 sequence=73 RECID=51 STAMP=984059713
input archived log thread=1 sequence=74 RECID=52 STAMP=984059723
input archived log thread=1 sequence=75 RECID=53 STAMP=984059723
input archived log thread=1 sequence=76 RECID=54 STAMP=984064487
input archived log thread=1 sequence=77 RECID=55 STAMP=984064487
input archived log thread=1 sequence=78 RECID=56 STAMP=984065615
input archived log thread=1 sequence=79 RECID=57 STAMP=984065615
input archived log thread=1 sequence=80 RECID=58 STAMP=984066057
input archived log thread=1 sequence=81 RECID=59 STAMP=984066057
channel ch0: starting piece 1 at 13-AUG-18
channel ch0: finished piece 1 at 13-AUG-18
piece handle=/u01/arch/al_115_1_984066064 tag=TAG20180813T154057 comment=NONE
channel ch0: backup set complete, elapsed time: 00:00:01
Finished backup at 13-AUG-18
Starting backup at 13-AUG-18
channel ch0: starting full datafile backup set
channel ch0: specifying datafile(s) in backup set
including current control file in backup set
channel ch0: starting piece 1 at 13-AUG-18
channel ch0: finished piece 1 at 13-AUG-18
piece handle=/u01/arch/cntrl_116_1_984066066 tag=CNTRL_LV0 comment=NONE
channel ch0: backup set complete, elapsed time: 00:00:01
Finished backup at 13-AUG-18
Starting backup at 13-AUG-18
channel ch0: starting full datafile backup set
channel ch0: specifying datafile(s) in backup set
including current SPFILE in backup set
channel ch0: starting piece 1 at 13-AUG-18
channel ch0: finished piece 1 at 13-AUG-18
piece handle=/u01/arch/spfile_117_1_984066068 tag=SFILE_LV0 comment=NONE
channel ch0: backup set complete, elapsed time: 00:00:01
Finished backup at 13-AUG-18
Starting Control File and SPFILE Autobackup at 13-AUG-18
piece handle=/u01/arch/ORCL/autobackup/2018_08_13/o1_mf_s_984066069_fq2fjomg_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 13-AUG-18
released channel: ch0
RMAN>
CDB异机恢复操作
1.恢复spfile文件,恢复控制文件
RMAN> restore spfile to '/u01/app/oracle/oradata/ORCL/spfileORCL.ora' from '/u01/arch/spfile_58_1_984048287';
Starting restore at 13-AUG-2018 10:55:10
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=2543 device type=DISK
channel ORA_DISK_1: restoring spfile from AUTOBACKUP /u01/arch/spfile_58_1_984048287
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 13-AUG-2018 10:55:12
RMAN>
控制文件
RMAN> restore controlfile to '/u01/app/oracle/oradata/ORCL/control01.ctl' from '/u01/arch/cntrl_57_1_984048285';
Starting restore at 13-AUG-2018 10:56:50
using channel ORA_DISK_1
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 13-AUG-2018 10:56:51
RMAN>
2.使用恢复的spfile+控制文件,将数据库启动到mount状态。spfile的一些参数可能需要修改
[oracle@lenovotest2 arch]$ sqlplus / as sysdba
SQL*Plus: Release 18.0.0.0.0 - Production on Mon Aug 13 11:03:47 2018
Version 18.3.0.0.0
Copyright (c) 1982, 2018, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 4966054640 bytes
Fixed Size 8907504 bytes
Variable Size 2063597568 bytes
Database Buffers 2868903936 bytes
Redo Buffers 24645632 bytes
SQL> alter database mount;
Database altered.
SQL>
3.查看备份文件,然后restore database
RMAN> catalog start with '/u01/arch'; <<<如果不是同路径,使用catalog重新注册备份
恢复cdb+pdb$seed lv0
RMAN> run {
2> # set newname for to '+ASM'
3> restore database root ;
4> restore database "PDB$SEED";
5> }
Starting restore at 13-AUG-2018 15:48:16
Starting implicit crosscheck backup at 13-AUG-2018 15:48:16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=33 device type=DISK
Crosschecked 15 objects
Finished implicit crosscheck backup at 13-AUG-2018 15:48:17
Starting implicit crosscheck copy at 13-AUG-2018 15:48:17
using channel ORA_DISK_1
Finished implicit crosscheck copy at 13-AUG-2018 15:48:17
searching for all files in the recovery area
cataloging files...
no files cataloged
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/ORCL/system01.dbf
channel ORA_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/ORCL/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/ORCL/undotbs01.dbf
channel ORA_DISK_1: restoring datafile 00007 to /u01/app/oracle/oradata/ORCL/users01.dbf
channel ORA_DISK_1: reading from backup piece /u01/arch/bk_101_1_984065363
channel ORA_DISK_1: piece handle=/u01/arch/bk_101_1_984065363 tag=CDBFULL_LV0
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:01:05
Finished restore at 13-AUG-2018 15:49:23
Starting restore at 13-AUG-2018 15:49:23
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 00005 to /u01/app/oracle/oradata/ORCL/pdbseed/system01.dbf
channel ORA_DISK_1: restoring datafile 00006 to /u01/app/oracle/oradata/ORCL/pdbseed/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00008 to /u01/app/oracle/oradata/ORCL/pdbseed/undotbs01.dbf
channel ORA_DISK_1: reading from backup piece /u01/arch/bk_102_1_984065418
channel ORA_DISK_1: piece handle=/u01/arch/bk_102_1_984065418 tag=CDBFULL_LV0
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:25
Finished restore at 13-AUG-2018 15:49:48
RMAN>
恢复pdb lv0
RMAN> restore database erwapdb;
Starting restore at 13-AUG-2018 15:59:23
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 00010 to /u01/app/oracle/oradata/ORCL/erwapdb/sysaux01.dbf
channel ORA_DISK_1: reading from backup piece /u01/arch/bk_104_1_984065573
channel ORA_DISK_1: piece handle=/u01/arch/bk_104_1_984065573 tag=PDBFULL_LV0
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:15
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 00009 to /u01/app/oracle/oradata/ORCL/erwapdb/system01.dbf
channel ORA_DISK_1: restoring datafile 00011 to /u01/app/oracle/oradata/ORCL/erwapdb/undotbs01.dbf
channel ORA_DISK_1: restoring datafile 00012 to /u01/app/oracle/oradata/ORCL/erwapdb/users01.dbf
channel ORA_DISK_1: restoring datafile 00013 to /u01/app/oracle/oradata/ORCL/erwapdb/erwa01.dbf
channel ORA_DISK_1: reading from backup piece /u01/arch/bk_105_1_984065598
channel ORA_DISK_1: piece handle=/u01/arch/bk_105_1_984065598 tag=PDBFULL_LV0
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:15
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 00015 to /u01/app/oracle/oradata/ORCL/erwapdb/test03.dbf
channel ORA_DISK_1: reading from backup piece /u01/arch/bk_112_1_984066055
channel ORA_DISK_1: piece handle=/u01/arch/bk_112_1_984066055 tag=PDBFULL_LV0
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 13-AUG-2018 15:59:55
RMAN>
recover database cdb+pdb(执行不完全恢复的 时间/logseq)
RMAN> recover database;
Starting recover at 13-AUG-2018 16:47:00
using channel ORA_DISK_1
starting media recovery
archived log for thread 1 with sequence 78 is already on disk as file /u01/arch/ORCL/archivelog/2018_08_13/o1_mf_1_78_fq2j7tvk_.arc
archived log for thread 1 with sequence 79 is already on disk as file /u01/arch/ORCL/archivelog/2018_08_13/o1_mf_1_79_fq2j7vb3_.arc
archived log for thread 1 with sequence 80 is already on disk as file /u01/arch/ORCL/archivelog/2018_08_13/o1_mf_1_80_fq2j7tx4_.arc
archived log for thread 1 with sequence 81 is already on disk as file /u01/arch/ORCL/archivelog/2018_08_13/o1_mf_1_81_fq2j7vb6_.arc
archived log file name=/u01/arch/ORCL/archivelog/2018_08_13/o1_mf_1_78_fq2j7tvk_.arc thread=1 sequence=78
archived log file name=/u01/arch/ORCL/archivelog/2018_08_13/o1_mf_1_79_fq2j7vb3_.arc thread=1 sequence=79
archived log file name=/u01/arch/ORCL/archivelog/2018_08_13/o1_mf_1_80_fq2j7tx4_.arc thread=1 sequence=80
archived log file name=/u01/arch/ORCL/archivelog/2018_08_13/o1_mf_1_81_fq2j7vb6_.arc thread=1 sequence=81
unable to find archived log
archived log thread=1 sequence=82
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 08/13/2018 16:47:02
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 82 and starting SCN of 2945920 <<<<由于联机日志未拷贝过来,只能用resetlogs打开数据库
RMAN>
用restlogs打开数据库
RMAN> alter database open resetlogs;
Statement processed
RMAN>
备注:
由于配置了CONFIGURE BACKUP OPTIMIZATION ON; 在备份的时候会跳过read only的表空间。也就是说pdb$seed会被跳过。在脚本里面加force即可。保证每次都会备份