1、 CDB环境下RMAN使用
可以使用RMAN连接到CDB进行备份恢复操作,当对整个CDB操作时,可以连接到ROOT容器,当对单个PDB进行操作时,可以连接到具体的PDB,比如我们要备份多个PDB,则需要连接到ROOT执行:BACKUP PLUGGABLE
DATABASE newpdb1,newpdb2;
当连接到PDB进行操作时有一定的限制,下列操作是不能进行的:
a) 备份归档日志
b) 删除归档日志
c) 删除归档日志的备份
d) 恢复归档日志
e) 基于时间的恢复(PITR)
f) TSPITR
g) 复制数据库
h) FLASHBACK 操作
i) 删除过期备份
当使用一个用户连接到PDB进行操作时,他必须被赋予SYSDBA权限。
[oracle@hadoop3 admin]$ rman target pdbuser1@newpdb1
Recovery Manager: Release 12.1.0.1.0 - Production on Tue Aug 6 13:40:48 2013
Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved.
target database Password:
connected to target database: NEWCDB (DBID=4206789664)
RMAN> report schema;
using target database control file instead of recovery catalog
Report of database schema for database with db_unique_name NEWCDB
List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
8 270 SYSTEM *** /u01/oracle/oradata/newcdb/newpdb1/system01.dbf
9 680 SYSAUX *** /u01/oracle/oradata/newcdb/newpdb1/sysaux01.dbf
10 5 USERS *** /u01/oracle/oradata/newcdb/newpdb1/newpdb1_users01.dbf
List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
3 20 TEMP 32767 /u01/oracle/oradata/newcdb/newpdb1/temp01.dbf
备份整个CDB:
RMAN> backup format '/u01/backup/%U' database
2> plus archivelog delete input;
Starting backup at 06-AUG-13
current log archived
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=92device type=DISK
channel ORA_DISK_1: startingarchived log backup set
channel ORA_DISK_1: specifyingarchived log(s) in backup set
input archived log thread=1sequence=29 RECID=18 STAMP=822751267
只备份ROOT
RMAN> backup database root;
Starting backup at 06-AUG-13
using channel ORA_DISK_1
channel ORA_DISK_1: startingfull datafile backup set
channel ORA_DISK_1: specifyingdatafile(s) in backup set
input datafile filenumber=00001 name=/u01/oracle/oradata/newcdb/system01.dbf
input datafile filenumber=00003 name=/u01/oracle/oradata/newcdb/sysaux01.dbf
input datafile filenumber=00004 name=/u01/oracle/oradata/newcdb/undotbs01.dbf
input datafile filenumber=00006 name=/u01/oracle/oradata/newcdb/users01.dbf
channel ORA_DISK_1: startingpiece 1 at 06-AUG-13
一次备份多个PDB:
RMAN> backup pluggable database newpdb1,newpdb2;
Starting backup at 06-AUG-13
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) inbackup set
input datafile file number=00009name=/u01/oracle/oradata/newcdb/newpdb1/sysaux01.dbf
input datafile file number=00008 name=/u01/oracle/oradata/newcdb/newpdb1/system01.dbf