Database Reference
In-Depth Information
Taking Backups of Pluggable Databases
Starting with Oracle 12c, you can create pluggable databases within a root container database. If you're using this
option, there are a few features to be aware of in regard to backups:
While connected to the root container, you can back up all the data files within the database or
just the root database data files; a specific pluggable database; or specific tablespaces or data
files, or a combination of these.
While connected to a pluggable database, you can only back up data files associated with that
database.
The bulleted items are detailed in the following two sections.
While Connected to the Root Container
Suppose you're connected to the root container as SYS and want to back up all data files (including any data files with
associated pluggable databases). First, verify that you are indeed connected to the root container as SYS :
RMAN> SELECT SYS_CONTEXT('USERENV', 'CON_ID') AS con_id,
SYS_CONTEXT('USERENV', 'CON_NAME') AS cur_container,
SYS_CONTEXT('USERENV', 'CURRENT_SCHEMA') AS cur_user
FROM DUAL;
Here is some sample output:
CON_ID CUR_CONTAINER CUR_USER
-------------------- -------------------- --------------------
1 CDB$ROOT SYS
Now, to back up all data files, both in the root container and in any associated pluggable databases, do so as
follows:
RMAN> backup database;
If you want to back up only the data files associated with the root container, then specify ROOT :
RMAN> backup database root;
You can also back up a specific pluggable database:
RMAN> backup pluggable database salespdb;
Additionally, you can back up specific tablespaces within a pluggable database:
RMAN> backup tablespace SALESPDB:SALES;
And, you can specify the file name to back up any data file within the root container or associated pluggable
databases:
RMAN> backup datafile '/ora01/app/oracle/oradata/CDB/salespdb/sales01.dbf';
 
Search WWH ::




Custom Search