12c pdb 备份&恢复

链接CDB 单个文件备份测试

[oracle@ora12 admin]$ rman target /

Recovery Manager: Release 12.1.0.2.0 - Production on Tue Jan 6 19:55:59 2015
Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.
connected to target database: D12C1 (DBID=3804677488)
RMAN> backup datafile 1;
Starting backup at 06-JAN-15
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=44 device type=DISK
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=/home/oracle/app/oracle/oradata/D12C1/system01.dbf
channel ORA_DISK_1: starting piece 1 at 06-JAN-15
channel ORA_DISK_1: finished piece 1 at 06-JAN-15
piece handle=/home/oracle/app/oracle/product/12.1.0/dbhome_1/dbs/01ps2ieq_1_1 tag=TAG20150106T195610 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:46
Finished backup at 06-JAN-15
Starting Control File and SPFILE Autobackup at 06-JAN-15
piece handle=/home/oracle/app/oracle/product/12.1.0/dbhome_1/dbs/c-3804677488-20150106-00 comment=NONE
Finished Control File and SPFILE Autobackup at 06-JAN-15
RMAN> backup pluggable database hj_pdb format '/u01/em12c/arch/pldb%p_%u';
Starting backup at 06-JAN-15
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=00012 name=/home/oracle/app/oracle/oradata/D12C1/HJPDB/sysaux01.dbf
input datafile file number=00011 name=/home/oracle/app/oracle/oradata/D12C1/HJPDB/system01.dbf
channel ORA_DISK_1: starting piece 1 at 06-JAN-15
channel ORA_DISK_1: finished piece 1 at 06-JAN-15
piece handle=/u01/em12c/arch/pldb1_03ps2ij4 tag=TAG20150106T195828 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:58
Finished backup at 06-JAN-15
Starting Control File and SPFILE Autobackup at 06-JAN-15
piece handle=/home/oracle/app/oracle/product/12.1.0/dbhome_1/dbs/c-3804677488-20150106-01 comment=NONE
Finished Control File and SPFILE Autobackup at 06-JAN-15
RMAN> show all;
RMAN configuration parameters for database with db_unique_name D12C1 are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE RMAN OUTPUT TO KEEP FOR 7 DAYS; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/home/oracle/app/oracle/product/12.1.0/dbhome_1/dbs/snapcf_D12C1.f'; # default

RMAN> restore pluggable database hj_pdb;
Starting restore at 06-JAN-15
using channel ORA_DISK_1
skipping datafile 11; already restored to file /home/oracle/app/oracle/oradata/D12C1/HJPDB/system01.dbf
skipping datafile 12; already restored to file /home/oracle/app/oracle/oradata/D12C1/HJPDB/sysaux01.dbf
restore not done; all files read only, offline, or already restored

Finished restore at 06-JAN-15

文件删除后再处理

RMAN> restore pluggable database hj_pdb;
Starting restore at 06-JAN-15
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 00011 to /home/oracle/app/oracle/oradata/D12C1/HJPDB/system01.dbf
channel ORA_DISK_1: restoring datafile 00012 to /home/oracle/app/oracle/oradata/D12C1/HJPDB/sysaux01.dbf
channel ORA_DISK_1: reading from backup piece /u01/em12c/arch/pldb1_03ps2ij4
channel ORA_DISK_1: piece handle=/u01/em12c/arch/pldb1_03ps2ij4 tag=TAG20150106T195828
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:55
Finished restore at 06-JAN-15
RMAN> recover pluggable database hj_pdb;
Starting recover at 06-JAN-15
using channel ORA_DISK_1
starting media recovery
media recovery complete, elapsed time: 00:00:00
Finished recover at 06-JAN-15
RMAN> alter pluggable database all open;
Statement processed

RMAN> 

总结

  • rman可以比较好的操作cdb和pdb备份
  • pdb的备份和恢复可以通过cdb来完成

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值