Skip to main content

How to backup a container database using RMAN?

To backup the container database , connect RMAN to the root using sysdba or sysbackup.
Note: sysdbackup is a new user introduced in 12c.

After setting the environment variables for the CDB I'm connecting using OS level authentication  (sysdba is already the part of OS group)  as below.

-bash-4.1$ rman target /

Recovery Manager: Release 12.1.0.2.0 - Production on Sat Aug 4 16:50:18 2018

Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.


connected to target database: ORCL1210 (DBID=2368395079)

Now you can take the backup in the same way you take it for non -CDB databases.

RMAN> backup database;

Starting backup at 04-AUG-18
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=21 device type=DISK
channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

*********************excerpts*********************

Starting Control File and SPFILE Autobackup at 04-AUG-18
piece handle=u01/app/12.1.0.2/oracle/product/12.1.0.2/dbhome2/dbs/c-2368395079-20180804-02 comment=NONE
Finished Control File and SPFILE Autobackup at 04-AUG-18

RMAN>


Now, Can we backup pluggable database in same session ?  

Yes , I checked it , see below. Please make a note to use the keyword "PLUGGABLE" when backing up the pluggable database.

RMAN> backup pluggable database pdb1;

Starting backup at 04-AUG-18
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=42 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set

**************excerpts*****************

piece handle=/u01/app/12.1.0.2/oracle/product/12.1.0.2/dbhome2/dbs/c-2368395079-20180804-03 comment=NONE
Finished Control File and SPFILE Autobackup at 04-AUG-18

RMAN>

Hope it helps.



Comments

Popular posts from this blog

Can we open a pluggable database if CDB is in mount state?

We cannot open a pluggable database if the CDB is in mount state. Demo: SQL> show con_name; CON_NAME ------------------------------ CDB$ROOT SQL> select name,open_mode from v$database; NAME      OPEN_MODE --------- -------------------- ORCL1210  MOUNTED SQL> alter session set container=pdb1; Session altered. SQL> show con_name; CON_NAME ------------------------------ PDB1 SQL> alter database open; alter database open * ERROR at line 1: ORA-65054: Cannot open a pluggable database in the desired mode. Now, I'm opening the container Database first and then running the same command SQL> alter session set container=CDB$ROOT; Session altered. SQL> sho con_name CON_NAME ------------------------------ CDB$ROOT SQL> alter database open; Database altered. SQL> select name,open_mode from v$database; NAME      OPEN_MODE --------- -------------------- ORCL1210  READ WRITE SQL>...