https://docs.oracle.com/database/121/BRADV/rcmbckba.htm#BRADV738
Backing Up a Whole CDB
Backing up a whole CDB is similar to backing up a non-CDB. When you back up a whole CDB, RMAN backs up the root, all the PDBs, and the archived redo logs. You can then recover either the whole CDB, the root only, or one or more PDBs from the CDB backup.
To back up a whole CDB:connecting to the root as a common user with the
SYSBACKUP or SYSDBA privilege.Backing Up the Root with RMAN
You can use RMAN to make a backup of only the root. Because the root contains critical metadata for the whole CDB, Oracle recommends that you back up the root or back up the whole CDB at regular intervals.
To back up the root with RMAN:
Start RMAN and connect to the root as a common user with the
SYSBACKUP or SYSDBA privilege.
Enter the following command:
BACKUP DATABASE ROOT;
login as: root
root@192.168.1.50's password:
Last login: Sun Sep 6 21:01:27 2015 from welsfargo_12c.localdomain
[root@welsfargo12c ~]# su - oracle
[oracle@welsfargo12c ~]$ su - root
Password:
[root@welsfargo12c ~]# mount /dev/sdb1 /data
[root@welsfargo12c ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 16G 11G 4.3G 71% /
tmpfs 1.3G 0 1.3G 0% /dev/shm
none 1.3G 40K 1.3G 1% /var/lib/xenstored
/dev/sdb1 40G 13G 25G 35% /data
[root@welsfargo12c ~]# su - oracle
[oracle@welsfargo12c ~]$ export ORACLE_BASE=/data/oracle
[oracle@welsfargo12c ~]$ export ORACLE_HOME= /wysheid/oracle/11c_home
-bash: export: `/wysheid/oracle/11c_home': not a valid identifier
[oracle@welsfargo12c ~]$ export ORACLE_HOME=/data/oracle/product/12.1.0.2/db_1
[oracle@welsfargo12c ~]$ export ORACLE_SID=CDBTES
[oracle@welsfargo12c ~]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Mon Sep 7 10:07:13 2015
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup;
ORACLE instance started.
Total System Global Area 1048576000 bytes
Fixed Size 2932336 bytes
Variable Size 654311824 bytes
Database Buffers 385875968 bytes
Redo Buffers 5455872 bytes
Database mounted.
Database opened.
SQL> SHOW CON_NAME;
CON_NAME
------------------------------
CDB$ROOT
SQL> SHOW USER;
USER is "SYS"
SQL> quit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
[oracle@welsfargo12c ~]$ rman target /
Recovery Manager: Release 12.1.0.2.0 - Production on Mon Sep 7 10:13:33 2015
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
connected to target database: CDBTES (DBID=3785441020)
RMAN> BACKUP DATABASE ROOT;
Starting backup at 07-SEP-15
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=46 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=/data/oracle/oradata/CDBTES/system01.dbf
input datafile file number=00005 name=/data/oracle/oradata/CDBTES/undotbs01.dbf
input datafile file number=00003 name=/data/oracle/oradata/CDBTES/sysaux01.dbf
input datafile file number=00006 name=/data/oracle/oradata/CDBTES/users01.dbf
channel ORA_DISK_1: starting piece 1 at 07-SEP-15
channel ORA_DISK_1: finished piece 1 at 07-SEP-15
piece handle=/data/oracle/fast_recovery_area/CDBTES/backupset/2015_09_07/o1_mf_nnndf_TAG20150907T101453_byv6z0d2_.bkp tag=TAG20150907T101453 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:04:52
Finished backup at 07-SEP-15
Starting Control File and SPFILE Autobackup at 07-SEP-15
piece handle=/data/oracle/fast_recovery_area/CDBTES/autobackup/2015_09_07/o1_mf_s_889784388_byv78f9q_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 07-SEP-15
RMAN> show all;
RMAN configuration parameters for database with db_unique_name CDBTES 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 '/data/oracle/product/12.1.0.2/db_1/dbs/snapcf_CDBTES.f'; # default
RMAN> list backup;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
1 Full 17.20M DISK 00:00:15 05-SEP-15
BP Key: 1 Status: AVAILABLE Compressed: NO Tag: TAG20150905T155827
Piece Name: /data/oracle/fast_recovery_area/CDBTES/autobackup/2015_09_05/o1_mf_s_889631911_byplcl8s_.bkp
SPFILE Included: Modification time: 05-SEP-15
SPFILE db_unique_name: CDBTES
Control File Included: Ckp SCN: 1330392 Ckp time: 05-SEP-15
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
2 Full 17.20M DISK 00:00:05 06-SEP-15
BP Key: 2 Status: AVAILABLE Compressed: NO Tag: TAG20150906T235320
Piece Name: /data/oracle/fast_recovery_area/CDBTES/autobackup/2015_09_06/o1_mf_s_889746800_byt2koft_.bkp
SPFILE Included: Modification time: 06-SEP-15
SPFILE db_unique_name: CDBTES
Control File Included: Ckp SCN: 1507455 Ckp time: 06-SEP-15
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
3 Full 17.20M DISK 00:00:04 07-SEP-15
BP Key: 3 Status: AVAILABLE Compressed: NO Tag: TAG20150907T001825
Piece Name: /data/oracle/fast_recovery_area/CDBTES/autobackup/2015_09_07/o1_mf_s_889748305_byt40nhz_.bkp
SPFILE Included: Modification time: 07-SEP-15
SPFILE db_unique_name: CDBTES
Control File Included: Ckp SCN: 1513691 Ckp time: 07-SEP-15
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
4 Full 17.20M DISK 00:00:03 07-SEP-15
BP Key: 4 Status: AVAILABLE Compressed: NO Tag: TAG20150907T003830
Piece Name: /data/oracle/fast_recovery_area/CDBTES/autobackup/2015_09_07/o1_mf_s_889749510_byt569c3_.bkp
SPFILE Included: Modification time: 07-SEP-15
SPFILE db_unique_name: CDBTES
Control File Included: Ckp SCN: 1515383 Ckp time: 07-SEP-15
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
5 Full 1.15G DISK 00:04:38 07-SEP-15
BP Key: 5 Status: AVAILABLE Compressed: NO Tag: TAG20150907T101453
Piece Name: /data/oracle/fast_recovery_area/CDBTES/backupset/2015_09_07/o1_mf_nnndf_TAG20150907T101453_byv6z0d2_.bkp
List of Datafiles in backup set 5
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 1517389 07-SEP-15 /data/oracle/oradata/CDBTES/system01.dbf
3 Full 1517389 07-SEP-15 /data/oracle/oradata/CDBTES/sysaux01.dbf
5 Full 1517389 07-SEP-15 /data/oracle/oradata/CDBTES/undotbs01.dbf
6 Full 1517389 07-SEP-15 /data/oracle/oradata/CDBTES/users01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
6 Full 17.20M DISK 00:00:09 07-SEP-15
BP Key: 6 Status: AVAILABLE Compressed: NO Tag: TAG20150907T101948
Piece Name: /data/oracle/fast_recovery_area/CDBTES/autobackup/2015_09_07/o1_mf_s_889784388_byv78f9q_.bkp
SPFILE Included: Modification time: 07-SEP-15
SPFILE db_unique_name: CDBTES
Control File Included: Ckp SCN: 1517518 Ckp time: 07-SEP-15
RMAN>
login as: root
root@192.168.1.50's password:
Last login: Sun Sep 6 21:01:27 2015 from welsfargo_12c.localdomain
[root@welsfargo12c ~]# su - oracle
[oracle@welsfargo12c ~]$ su - root
Password:
[root@welsfargo12c ~]# mount /dev/sdb1 /data
[root@welsfargo12c ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 16G 11G 4.3G 71% /
tmpfs 1.3G 0 1.3G 0% /dev/shm
none 1.3G 40K 1.3G 1% /var/lib/xenstored
/dev/sdb1 40G 13G 25G 35% /data
[root@welsfargo12c ~]# su - oracle
[oracle@welsfargo12c ~]$ export ORACLE_BASE=/data/oracle
[oracle@welsfargo12c ~]$ export ORACLE_HOME= /wysheid/oracle/11c_home
-bash: export: `/wysheid/oracle/11c_home': not a valid identifier
[oracle@welsfargo12c ~]$ export ORACLE_HOME=/data/oracle/product/12.1.0.2/db_1
[oracle@welsfargo12c ~]$ export ORACLE_SID=CDBTES
[oracle@welsfargo12c ~]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Mon Sep 7 10:07:13 2015
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup;
ORACLE instance started.
Total System Global Area 1048576000 bytes
Fixed Size 2932336 bytes
Variable Size 654311824 bytes
Database Buffers 385875968 bytes
Redo Buffers 5455872 bytes
Database mounted.
Database opened.
SQL> SHOW CON_NAME;
CON_NAME
------------------------------
CDB$ROOT
SQL> SHOW USER;
USER is "SYS"
SQL> quit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
[oracle@welsfargo12c ~]$ rman target /
Recovery Manager: Release 12.1.0.2.0 - Production on Mon Sep 7 10:13:33 2015
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
connected to target database: CDBTES (DBID=3785441020)
RMAN> BACKUP DATABASE ROOT;
Starting backup at 07-SEP-15
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=46 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=/data/oracle/oradata/CDBTES/system01.dbf
input datafile file number=00005 name=/data/oracle/oradata/CDBTES/undotbs01.dbf
input datafile file number=00003 name=/data/oracle/oradata/CDBTES/sysaux01.dbf
input datafile file number=00006 name=/data/oracle/oradata/CDBTES/users01.dbf
channel ORA_DISK_1: starting piece 1 at 07-SEP-15
channel ORA_DISK_1: finished piece 1 at 07-SEP-15
piece handle=/data/oracle/fast_recovery_area/CDBTES/backupset/2015_09_07/o1_mf_nnndf_TAG20150907T101453_byv6z0d2_.bkp tag=TAG20150907T101453 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:04:52
Finished backup at 07-SEP-15
Starting Control File and SPFILE Autobackup at 07-SEP-15
piece handle=/data/oracle/fast_recovery_area/CDBTES/autobackup/2015_09_07/o1_mf_s_889784388_byv78f9q_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 07-SEP-15
RMAN> show all;
RMAN configuration parameters for database with db_unique_name CDBTES 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 '/data/oracle/product/12.1.0.2/db_1/dbs/snapcf_CDBTES.f'; # default
RMAN> list backup;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
1 Full 17.20M DISK 00:00:15 05-SEP-15
BP Key: 1 Status: AVAILABLE Compressed: NO Tag: TAG20150905T155827
Piece Name: /data/oracle/fast_recovery_area/CDBTES/autobackup/2015_09_05/o1_mf_s_889631911_byplcl8s_.bkp
SPFILE Included: Modification time: 05-SEP-15
SPFILE db_unique_name: CDBTES
Control File Included: Ckp SCN: 1330392 Ckp time: 05-SEP-15
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
2 Full 17.20M DISK 00:00:05 06-SEP-15
BP Key: 2 Status: AVAILABLE Compressed: NO Tag: TAG20150906T235320
Piece Name: /data/oracle/fast_recovery_area/CDBTES/autobackup/2015_09_06/o1_mf_s_889746800_byt2koft_.bkp
SPFILE Included: Modification time: 06-SEP-15
SPFILE db_unique_name: CDBTES
Control File Included: Ckp SCN: 1507455 Ckp time: 06-SEP-15
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
3 Full 17.20M DISK 00:00:04 07-SEP-15
BP Key: 3 Status: AVAILABLE Compressed: NO Tag: TAG20150907T001825
Piece Name: /data/oracle/fast_recovery_area/CDBTES/autobackup/2015_09_07/o1_mf_s_889748305_byt40nhz_.bkp
SPFILE Included: Modification time: 07-SEP-15
SPFILE db_unique_name: CDBTES
Control File Included: Ckp SCN: 1513691 Ckp time: 07-SEP-15
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
4 Full 17.20M DISK 00:00:03 07-SEP-15
BP Key: 4 Status: AVAILABLE Compressed: NO Tag: TAG20150907T003830
Piece Name: /data/oracle/fast_recovery_area/CDBTES/autobackup/2015_09_07/o1_mf_s_889749510_byt569c3_.bkp
SPFILE Included: Modification time: 07-SEP-15
SPFILE db_unique_name: CDBTES
Control File Included: Ckp SCN: 1515383 Ckp time: 07-SEP-15
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
5 Full 1.15G DISK 00:04:38 07-SEP-15
BP Key: 5 Status: AVAILABLE Compressed: NO Tag: TAG20150907T101453
Piece Name: /data/oracle/fast_recovery_area/CDBTES/backupset/2015_09_07/o1_mf_nnndf_TAG20150907T101453_byv6z0d2_.bkp
List of Datafiles in backup set 5
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 1517389 07-SEP-15 /data/oracle/oradata/CDBTES/system01.dbf
3 Full 1517389 07-SEP-15 /data/oracle/oradata/CDBTES/sysaux01.dbf
5 Full 1517389 07-SEP-15 /data/oracle/oradata/CDBTES/undotbs01.dbf
6 Full 1517389 07-SEP-15 /data/oracle/oradata/CDBTES/users01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
6 Full 17.20M DISK 00:00:09 07-SEP-15
BP Key: 6 Status: AVAILABLE Compressed: NO Tag: TAG20150907T101948
Piece Name: /data/oracle/fast_recovery_area/CDBTES/autobackup/2015_09_07/o1_mf_s_889784388_byv78f9q_.bkp
SPFILE Included: Modification time: 07-SEP-15
SPFILE db_unique_name: CDBTES
Control File Included: Ckp SCN: 1517518 Ckp time: 07-SEP-15
RMAN>
Backing Up PDBs with RMAN
RMAN enables you to back up one or more PDBs in a CDB. There are two approaches to backing up a PDB with RMAN:
Connect to the root and then use the BACKUP PLUGGABLE DATABASE command. This approach enables you to back up multiple PDBs with a single command.
$ rman target=/
example
======================================================================================== Recovery Manager complete. [oracle@welsfargo12c ~]$ sqlplus / sysdba Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production With the Partitioning, Oracle Label Security, OLAP, Advanced Analytics and Real Application Testing options SQL> SHOW CON_NAME; CON_NAME ------------------------------ CDB$ROOT SQL> SHOW USER; USER is "SYS" SQL> SELECT name, open_mode FROM v$pdbs ORDER BY name; 2 3 NAME OPEN_MODE ------------------------------ ---------- PDB$SEED READ ONLY PDBTEST1 MOUNTED PDBTEST2 MOUNTED PDBTEST3 MOUNTED PDBTEST4 MOUNTED SQL> ALTER PLUGGABLE DATABASE ALL OPEN READ WRITE; Pluggable database altered. SQL> SELECT name, open_mode FROM v$pdbs ORDER BY name; 2 3 NAME OPEN_MODE ------------------------------ ---------- PDB$SEED READ ONLY PDBTEST1 READ WRITE PDBTEST2 READ WRITE PDBTEST3 READ WRITE PDBTEST4 READ WRITE SQL> quit Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production With the Partitioning, Oracle Label Security, OLAP, Advanced Analytics and Real Application Testing options [oracle@welsfargo12c ~]$ rman target / Recovery Manager: Release 12.1.0.2.0 - Production on Mon Sep 7 11:58:11 2015 Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved. connected to target database: CDBTES (DBID=3785441020) RMAN> BACKUP PLUGGABLE DATABASE PDBTEST1, PDBTEST2 ; Starting backup at 07-SEP-15 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=49 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=00008 name=/data/oracle/oradata/CDBTES/PDBTEST1/sysaux01.dbf input datafile file number=00007 name=/data/oracle/oradata/CDBTES/PDBTEST1/system01.dbf input datafile file number=00009 name=/data/oracle/oradata/CDBTES/PDBTEST1/PDBTEST1_users01.dbf channel ORA_DISK_1: starting piece 1 at 07-SEP-15 channel ORA_DISK_1: finished piece 1 at 07-SEP-15 piece handle=/data/oracle/fast_recovery_area/CDBTES/1F062B006B2C21F5E0530100007FBE08/backupset/2015_09_07/o1_mf_nnndf_TAG20150907T115834_byvf1cco_.bkp tag=TAG20150907T115834 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:03:00 channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00011 name=/data/oracle/oradata/CDBTES/PDBTEST2/sysaux01.dbf input datafile file number=00010 name=/data/oracle/oradata/CDBTES/PDBTEST2/system01.dbf input datafile file number=00012 name=/data/oracle/oradata/CDBTES/PDBTEST2/PDBTEST2_users01.dbf channel ORA_DISK_1: starting piece 1 at 07-SEP-15 channel ORA_DISK_1: finished piece 1 at 07-SEP-15 piece handle=/data/oracle/fast_recovery_area/CDBTES/1F0635C948E922F4E0530100007FA5B1/backupset/2015_09_07/o1_mf_nnndf_TAG20150907T115834_byvf716l_.bkp tag=TAG20150907T115834 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:02:39 Finished backup at 07-SEP-15 Starting Control File and SPFILE Autobackup at 07-SEP-15 piece handle=/data/oracle/fast_recovery_area/CDBTES/autobackup/2015_09_07/o1_mf_s_889790659_byvfd724_.bkp comment=NONE Finished Control File and SPFILE Autobackup at 07-SEP-15 RMAN> RMAN> list backup; List of Backup Sets =================== BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 1 Full 17.20M DISK 00:00:15 05-SEP-15 BP Key: 1 Status: AVAILABLE Compressed: NO Tag: TAG20150905T155827 Piece Name: /data/oracle/fast_recovery_area/CDBTES/autobackup/2015_09_05/o1_mf_s_889631911_byplcl8s_.bkp SPFILE Included: Modification time: 05-SEP-15 SPFILE db_unique_name: CDBTES Control File Included: Ckp SCN: 1330392 Ckp time: 05-SEP-15 BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 2 Full 17.20M DISK 00:00:05 06-SEP-15 BP Key: 2 Status: AVAILABLE Compressed: NO Tag: TAG20150906T235320 Piece Name: /data/oracle/fast_recovery_area/CDBTES/autobackup/2015_09_06/o1_mf_s_889746800_byt2koft_.bkp SPFILE Included: Modification time: 06-SEP-15 SPFILE db_unique_name: CDBTES Control File Included: Ckp SCN: 1507455 Ckp time: 06-SEP-15 BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 3 Full 17.20M DISK 00:00:04 07-SEP-15 BP Key: 3 Status: AVAILABLE Compressed: NO Tag: TAG20150907T001825 Piece Name: /data/oracle/fast_recovery_area/CDBTES/autobackup/2015_09_07/o1_mf_s_889748305_byt40nhz_.bkp SPFILE Included: Modification time: 07-SEP-15 SPFILE db_unique_name: CDBTES Control File Included: Ckp SCN: 1513691 Ckp time: 07-SEP-15 BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 4 Full 17.20M DISK 00:00:03 07-SEP-15 BP Key: 4 Status: AVAILABLE Compressed: NO Tag: TAG20150907T003830 Piece Name: /data/oracle/fast_recovery_area/CDBTES/autobackup/2015_09_07/o1_mf_s_889749510_byt569c3_.bkp SPFILE Included: Modification time: 07-SEP-15 SPFILE db_unique_name: CDBTES Control File Included: Ckp SCN: 1515383 Ckp time: 07-SEP-15 BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 5 Full 1.15G DISK 00:04:38 07-SEP-15 BP Key: 5 Status: AVAILABLE Compressed: NO Tag: TAG20150907T101453 Piece Name: /data/oracle/fast_recovery_area/CDBTES/backupset/2015_09_07/o1_mf_nnndf_TAG20150907T101453_byv6z0d2_.bkp List of Datafiles in backup set 5 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 1 Full 1517389 07-SEP-15 /data/oracle/oradata/CDBTES/system01.dbf 3 Full 1517389 07-SEP-15 /data/oracle/oradata/CDBTES/sysaux01.dbf 5 Full 1517389 07-SEP-15 /data/oracle/oradata/CDBTES/undotbs01.dbf 6 Full 1517389 07-SEP-15 /data/oracle/oradata/CDBTES/users01.dbf BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 6 Full 17.20M DISK 00:00:09 07-SEP-15 BP Key: 6 Status: AVAILABLE Compressed: NO Tag: TAG20150907T101948 Piece Name: /data/oracle/fast_recovery_area/CDBTES/autobackup/2015_09_07/o1_mf_s_889784388_byv78f9q_.bkp SPFILE Included: Modification time: 07-SEP-15 SPFILE db_unique_name: CDBTES Control File Included: Ckp SCN: 1517518 Ckp time: 07-SEP-15 BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 7 Full 617.20M DISK 00:02:53 07-SEP-15 BP Key: 7 Status: AVAILABLE Compressed: NO Tag: TAG20150907T115834 Piece Name: /data/oracle/fast_recovery_area/CDBTES/1F062B006B2C21F5E0530100007FBE08/backupset/2015_09_07/o1_mf_nnndf_TAG20150907T115834_byvf1cco_.bkp List of Datafiles in backup set 7 Container ID: 3, PDB Name: PDBTEST1 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 7 Full 1521977 07-SEP-15 /data/oracle/oradata/CDBTES/PDBTEST1/system01.dbf 8 Full 1521977 07-SEP-15 /data/oracle/oradata/CDBTES/PDBTEST1/sysaux01.dbf 9 Full 1521977 07-SEP-15 /data/oracle/oradata/CDBTES/PDBTEST1/PDBTEST1_users01.dbf BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 8 Full 617.04M DISK 00:02:30 07-SEP-15 BP Key: 8 Status: AVAILABLE Compressed: NO Tag: TAG20150907T115834 Piece Name: /data/oracle/fast_recovery_area/CDBTES/1F0635C948E922F4E0530100007FA5B1/backupset/2015_09_07/o1_mf_nnndf_TAG20150907T115834_byvf716l_.bkp List of Datafiles in backup set 8 Container ID: 4, PDB Name: PDBTEST2 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 10 Full 1522261 07-SEP-15 /data/oracle/oradata/CDBTES/PDBTEST2/system01.dbf 11 Full 1522261 07-SEP-15 /data/oracle/oradata/CDBTES/PDBTEST2/sysaux01.dbf 12 Full 1522261 07-SEP-15 /data/oracle/oradata/CDBTES/PDBTEST2/PDBTEST2_users01.dbf BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 9 Full 17.20M DISK 00:00:05 07-SEP-15 BP Key: 9 Status: AVAILABLE Compressed: NO Tag: TAG20150907T120418 Piece Name: /data/oracle/fast_recovery_area/CDBTES/autobackup/2015_09_07/o1_mf_s_889790659_byvfd724_.bkp SPFILE Included: Modification time: 07-SEP-15 SPFILE db_unique_name: CDBTES Control File Included: Ckp SCN: 1522332 Ckp time: 07-SEP-15 RMAN>
Container Database (CDB) Backup
Backup of a Container Database (CDB) is essentially the same as a non-Container Database. The main thing to remember is, by doing a full backup of the CDB you are also doing a full backup of all PDBs.Connect to RMAN using OS authentication and take a full backup using the following command. This means you are connecting to the root container with "AS SYSDBA" privilege.$ rman target=/ RMAN> BACKUP DATABASE PLUS ARCHIVELOG;piece handle=/data/oracle/fast_recovery_area/CDBTES/1F0635C948E922F4E0530100007F A5B1/backupset/2015_09_07/o1_mf_nnndf_TAG20150907T124408_byvj7brb_.bkp tag=TAG20 150907T124408 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:01:25 channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00014 name=/data/oracle/oradata/CDBTES/PDBTEST3/sysau x01.dbf input datafile file number=00013 name=/data/oracle/oradata/CDBTES/PDBTEST3/syste m01.dbf input datafile file number=00015 name=/data/oracle/oradata/CDBTES/PDBTEST3/PDBTE ST3_users01.dbf channel ORA_DISK_1: starting piece 1 at 07-SEP-15 channel ORA_DISK_1: finished piece 1 at 07-SEP-15 piece handle=/data/oracle/fast_recovery_area/CDBTES/1F06414268B62411E0530100007F 304D/backupset/2015_09_07/o1_mf_nnndf_TAG20150907T124408_byvjb4xg_.bkp tag=TAG20 150907T124408 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:01:36 channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00019 name=/data/oracle/oradata/CDBTES/PDBTEST4/sysau x01.dbf input datafile file number=00018 name=/data/oracle/oradata/CDBTES/PDBTEST4/syste m01.dbf input datafile file number=00020 name=/data/oracle/oradata/CDBTES/PDBTEST4/PDBTE ST3_users01.dbf channel ORA_DISK_1: starting piece 1 at 07-SEP-15 channel ORA_DISK_1: finished piece 1 at 07-SEP-15 piece handle=/data/oracle/fast_recovery_area/CDBTES/1F21076ABA6F1B6EE0530100007F 6F35/backupset/2015_09_07/o1_mf_nnndf_TAG20150907T124408_byvjf0jt_.bkp tag=TAG20 150907T124408 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:01:25 channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00004 name=/data/oracle/oradata/CDBTES/pdbseed/sysaux 01.dbf input datafile file number=00002 name=/data/oracle/oradata/CDBTES/pdbseed/system 01.dbf channel ORA_DISK_1: starting piece 1 at 07-SEP-15 channel ORA_DISK_1: finished piece 1 at 07-SEP-15 piece handle=/data/oracle/fast_recovery_area/CDBTES/1F02228F815E1269E0530100007F 238F/backupset/2015_09_07/o1_mf_nnndf_TAG20150907T124408_byvjhols_.bkp tag=TAG20 150907T124408 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:01:15 Finished backup at 07-SEP-15 Starting backup at 07-SEP-15 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=153 RECID=13 STAMP=889793922 channel ORA_DISK_1: starting piece 1 at 07-SEP-15 channel ORA_DISK_1: finished piece 1 at 07-SEP-15 piece handle=/data/oracle/fast_recovery_area/CDBTES/backupset/2015_09_07/o1_mf_a nnnn_TAG20150907T125843_byvjl498_.bkp tag=TAG20150907T125843 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:04 Finished backup at 07-SEP-15 Starting Control File and SPFILE Autobackup at 07-SEP-15 piece handle=/data/oracle/fast_recovery_area/CDBTES/autobackup/2015_09_07/o1_mf_ s_889793927_byvjlgf3_.bkp comment=NONE Finished Control File and SPFILE Autobackup at 07-SEP-15 RMAN> list backup; List of Backup Sets =================== BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 9 Full 17.20M DISK 00:00:05 07-SEP-15 BP Key: 9 Status: AVAILABLE Compressed: NO Tag: TAG20150907T120418 Piece Name: /data/oracle/fast_recovery_area/CDBTES/autobackup/2015_09_07 /o1_mf_s_889790659_byvfd724_.bkp SPFILE Included: Modification time: 07-SEP-15 SPFILE db_unique_name: CDBTES Control File Included: Ckp SCN: 1522332 Ckp time: 07-SEP-15 BS Key Size Device Type Elapsed Time Completion Time ------- ---------- ----------- ------------ --------------- 10 443.50M DISK 00:02:30 07-SEP-15 BP Key: 10 Status: AVAILABLE Compressed: NO Tag: TAG20150907T124128 Piece Name: /data/oracle/fast_recovery_area/CDBTES/backupset/2015_09_07/ o1_mf_annnn_TAG20150907T124128_byvhktk0_.bkp List of Archived Logs in backup set 10 Thrd Seq Low SCN Low Time Next SCN Next Time ---- ------- ---------- --------- ---------- --------- 1 141 1311738 05-SEP-15 1324416 05-SEP-15 1 142 1324416 05-SEP-15 1338322 05-SEP-15 1 143 1338322 05-SEP-15 1438725 06-SEP-15 1 144 1438725 06-SEP-15 1448923 06-SEP-15 1 145 1448923 06-SEP-15 1455558 06-SEP-15 1 146 1455558 06-SEP-15 1464882 06-SEP-15 1 147 1464882 06-SEP-15 1473010 06-SEP-15 1 148 1473010 06-SEP-15 1482656 06-SEP-15 1 149 1482656 06-SEP-15 1490366 06-SEP-15 1 150 1490366 06-SEP-15 1499329 06-SEP-15 1 151 1499329 06-SEP-15 1508410 07-SEP-15 1 152 1508410 07-SEP-15 1524685 07-SEP-15 BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 11 Full 1.14G DISK 00:05:23 07-SEP-15 BP Key: 11 Status: AVAILABLE Compressed: NO Tag: TAG20150907T124408 Piece Name: /data/oracle/fast_recovery_area/CDBTES/backupset/2015_09_07/ o1_mf_nnndf_TAG20150907T124408_byvhpt01_.bkp List of Datafiles in backup set 11 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 1 Full 1524770 07-SEP-15 /data/oracle/oradata/CDBTES/system01.dbf 3 Full 1524770 07-SEP-15 /data/oracle/oradata/CDBTES/sysaux01.dbf 5 Full 1524770 07-SEP-15 /data/oracle/oradata/CDBTES/undotbs01.dbf 6 Full 1524770 07-SEP-15 /data/oracle/oradata/CDBTES/users01.dbf BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 12 Full 617.36M DISK 00:03:06 07-SEP-15 BP Key: 12 Status: AVAILABLE Compressed: NO Tag: TAG20150907T124408 Piece Name: /data/oracle/fast_recovery_area/CDBTES/1F062B006B2C21F5E0530 100007FBE08/backupset/2015_09_07/o1_mf_nnndf_TAG20150907T124408_byvj15s7_.bkp List of Datafiles in backup set 12 Container ID: 3, PDB Name: PDBTEST1 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 7 Full 1524916 07-SEP-15 /data/oracle/oradata/CDBTES/PDBTEST1/system0 1.dbf 8 Full 1524916 07-SEP-15 /data/oracle/oradata/CDBTES/PDBTEST1/sysaux0 1.dbf 9 Full 1524916 07-SEP-15 /data/oracle/oradata/CDBTES/PDBTEST1/PDBTEST 1_users01.dbf BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 13 Full 617.20M DISK 00:01:05 07-SEP-15 BP Key: 13 Status: AVAILABLE Compressed: NO Tag: TAG20150907T124408 Piece Name: /data/oracle/fast_recovery_area/CDBTES/1F0635C948E922F4E0530 100007FA5B1/backupset/2015_09_07/o1_mf_nnndf_TAG20150907T124408_byvj7brb_.bkp List of Datafiles in backup set 13 Container ID: 4, PDB Name: PDBTEST2 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 10 Full 1525053 07-SEP-15 /data/oracle/oradata/CDBTES/PDBTEST2/system0 1.dbf 11 Full 1525053 07-SEP-15 /data/oracle/oradata/CDBTES/PDBTEST2/sysaux0 1.dbf 12 Full 1525053 07-SEP-15 /data/oracle/oradata/CDBTES/PDBTEST2/PDBTEST 2_users01.dbf BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 14 Full 617.38M DISK 00:01:26 07-SEP-15 BP Key: 14 Status: AVAILABLE Compressed: NO Tag: TAG20150907T124408 Piece Name: /data/oracle/fast_recovery_area/CDBTES/1F06414268B62411E0530 100007F304D/backupset/2015_09_07/o1_mf_nnndf_TAG20150907T124408_byvjb4xg_.bkp List of Datafiles in backup set 14 Container ID: 5, PDB Name: PDBTEST3 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 13 Full 1525230 07-SEP-15 /data/oracle/oradata/CDBTES/PDBTEST3/system0 1.dbf 14 Full 1525230 07-SEP-15 /data/oracle/oradata/CDBTES/PDBTEST3/sysaux0 1.dbf 15 Full 1525230 07-SEP-15 /data/oracle/oradata/CDBTES/PDBTEST3/PDBTEST 3_users01.dbf BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 15 Full 617.41M DISK 00:01:04 07-SEP-15 BP Key: 15 Status: AVAILABLE Compressed: NO Tag: TAG20150907T124408 Piece Name: /data/oracle/fast_recovery_area/CDBTES/1F21076ABA6F1B6EE0530 100007F6F35/backupset/2015_09_07/o1_mf_nnndf_TAG20150907T124408_byvjf0jt_.bkp List of Datafiles in backup set 15 Container ID: 6, PDB Name: PDBTEST4 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 18 Full 1525427 07-SEP-15 /data/oracle/oradata/CDBTES/PDBTEST4/system0 1.dbf 19 Full 1525427 07-SEP-15 /data/oracle/oradata/CDBTES/PDBTEST4/sysaux0 1.dbf 20 Full 1525427 07-SEP-15 /data/oracle/oradata/CDBTES/PDBTEST4/PDBTEST 3_users01.dbf BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 16 Full 607.90M DISK 00:01:12 07-SEP-15 BP Key: 16 Status: AVAILABLE Compressed: NO Tag: TAG20150907T124408 Piece Name: /data/oracle/fast_recovery_area/CDBTES/1F02228F815E1269E0530 100007F238F/backupset/2015_09_07/o1_mf_nnndf_TAG20150907T124408_byvjhols_.bkp List of Datafiles in backup set 16 Container ID: 2, PDB Name: PDB$SEED File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 2 Full 1325486 05-SEP-15 /data/oracle/oradata/CDBTES/pdbseed/system01 .dbf 4 Full 1325486 05-SEP-15 /data/oracle/oradata/CDBTES/pdbseed/sysaux01 .dbf BS Key Size Device Type Elapsed Time Completion Time ------- ---------- ----------- ------------ --------------- 17 495.50K DISK 00:00:01 07-SEP-15 BP Key: 17 Status: AVAILABLE Compressed: NO Tag: TAG20150907T125843 Piece Name: /data/oracle/fast_recovery_area/CDBTES/backupset/2015_09_07/ o1_mf_annnn_TAG20150907T125843_byvjl498_.bkp List of Archived Logs in backup set 17 Thrd Seq Low SCN Low Time Next SCN Next Time ---- ------- ---------- --------- ---------- --------- 1 153 1524685 07-SEP-15 1525507 07-SEP-15 BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 18 Full 17.20M DISK 00:00:07 07-SEP-15 BP Key: 18 Status: AVAILABLE Compressed: NO Tag: TAG20150907T125847 Piece Name: /data/oracle/fast_recovery_area/CDBTES/autobackup/2015_09_07 /o1_mf_s_889793927_byvjlgf3_.bkp SPFILE Included: Modification time: 07-SEP-15 SPFILE db_unique_name: CDBTES Control File Included: Ckp SCN: 1525518 Ckp time: 07-SEP-15 RMAN> RMAN> BACKUP DATABASE PLUS ARCHIVELOG;
The main thing to remember is, by doing a full backup of the CDB you are also doing a full backup of all PDBs
When you connect to the root and back up a PDB, this backup is visible to the root and to that particular PDB but not to the other PDBs.
Example
==========
Example
==========
Connect to the PDB and use the BACKUP DATABASE command. This approach backs up only a single PDB and enables you to use the same commands used for backing up non-CDBs.
Backups created when connected to any PDB are visible when connected to the root.
When you back up individual PDBs, the archived redo logs are not backed up.
Start RMAN and connect to the root as a common user with the
SYSBACKUP or SYSDBA privilege.
Issue a
BACKUP PLUGGABLE DATABASE command at the RMAN prompt.
The following example backs up the PDBs
sales and hr:
BACKUP PLUGGABLE DATABASE sales,hr
To back up one PDB while connected to the PDB:
Issue a
BACKUP DATABASE command at the RMAN prompt.BACKUP DATABASE ;Backing Up Tablespaces and Data Files in a PDB
Because tablespaces in different PDBs can have the same name, to eliminate ambiguity you must connect directly to a PDB to back up one or more of its tablespaces. In contrast, because data file numbers and paths are unique across the CDB, you can connect to either the root or a PDB to back up PDB data files. If you connect to the root, you can back up data files from multiple PDBs with a single command. If you connect to a PDB, you can back up only data files in that PDB.
- Start RMAN and connect to the PDB as a local user with the
SYSBACKUPorSYSDBAprivilege.Issue aBACKUP TABLESPACEcommand
BACKUP TABLESPACE users,hr
To back up data files in a PDB:
- Do one of the following:
- Start RMAN and connect to the root as a common user with the
SYSBACKUPorSYSDBAprivilege. - Start RMAN and connect to the PDB as a local user with the
SYSBACKUPorSYSDBAprivilege.
BACKUP DATAFILE command. BACKUP DATAFILE 10,13============================================================================
No comments:
Post a Comment