Backup Pluggable Database

http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/12c/r1/pdb/pdb_pitr/pdb_pitr.html

Tested on: 
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

1.) Listing PDBS:

13:05:01 SQL> select name, open_mode from v$pdbs;

NAME                           OPEN_MODE
------------------------------ ----------
PDB$SEED                       READ ONLY
PDB1                           MOUNTED
PDB3                           MOUNTED


2.) Opening PDBs:

alter pluggable database all open;

Pluggable database altered.

select name, open_mode from v$pdbs;

NAME                           OPEN_MODE
------------------------------ ----------
PDB$SEED                       READ ONLY
PDB1                           READ WRITE
PDB3                           READ WRITE

3.) Backup directory:

/data02/backup/CDB

4.) Database in archive MODE:

archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /data01/CDB/archives
Oldest online log sequence     87
Next log sequence to archive   89
Current log sequence           89

5.) Flashback database enabled:

db_recovery_file_dest                string      /oracle/fast_recovery_area
db_recovery_file_dest_size           big integer 4560M

db_flashback_retention_target        integer     1440

select FLASHBACK_ON from v$database;

FLASHBACK_ON
------------------
NO

shut immediate;
startup mount;
alter database flashback on;
alter database open;

 select FLASHBACK_ON from v$database;

FLASHBACK_ON
------------------
YES


5.) Backup CDB:

rman target /

configure controlfile autobackup on;

new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored

 configure channel device type disk format '/data02/backup/CDB/CDB_%U';

new RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT   '/data02/backup/CDB/CDB_%U';
new RMAN configuration parameters are successfully stored

 backup database plus archivelog;


Starting backup at 06-MAR-16
current log archived
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=28 device type=DISK
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=77 RECID=1 STAMP=901791271
input archived log thread=1 sequence=78 RECID=2 STAMP=901791829
input archived log thread=1 sequence=79 RECID=3 STAMP=901791879
input archived log thread=1 sequence=80 RECID=4 STAMP=901794646
input archived log thread=1 sequence=81 RECID=5 STAMP=905701139
input archived log thread=1 sequence=82 RECID=6 STAMP=905701398
input archived log thread=1 sequence=83 RECID=7 STAMP=905701551
input archived log thread=1 sequence=84 RECID=8 STAMP=905778404
input archived log thread=1 sequence=85 RECID=9 STAMP=905778523
input archived log thread=1 sequence=86 RECID=10 STAMP=905778549
input archived log thread=1 sequence=87 RECID=11 STAMP=905778576
input archived log thread=1 sequence=88 RECID=12 STAMP=905778589
input archived log thread=1 sequence=89 RECID=13 STAMP=905779578
channel ORA_DISK_1: starting piece 1 at 06-MAR-16
channel ORA_DISK_1: finished piece 1 at 06-MAR-16
piece handle=/data02/backup/CDB/CDB_0kqvq6bq_1_1 tag=TAG20160306T132618 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 06-MAR-16

Starting backup at 06-MAR-16
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=00004 name=/oracle/oradata/CDB/undotbs01.dbf
input datafile file number=00001 name=/oracle/oradata/CDB/system01.dbf
input datafile file number=00003 name=/oracle/oradata/CDB/sysaux01.dbf
input datafile file number=00006 name=/oracle/oradata/CDB/users01.dbf
channel ORA_DISK_1: starting piece 1 at 06-MAR-16
channel ORA_DISK_1: finished piece 1 at 06-MAR-16
piece handle=/data02/backup/CDB/CDB_0lqvq6bt_1_1 tag=TAG20160306T132621 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00017 name=/oracle/oradata/CDB/pdb1/sysaux01.dbf
input datafile file number=00016 name=/oracle/oradata/CDB/pdb1/system01.dbf
channel ORA_DISK_1: starting piece 1 at 06-MAR-16
channel ORA_DISK_1: finished piece 1 at 06-MAR-16
piece handle=/data02/backup/CDB/CDB_0mqvq6cc_1_1 tag=TAG20160306T132621 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
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/CDB/PDB3/sysaux01.dbf
input datafile file number=00018 name=+DATA/CDB/PDB3/system01.dbf
channel ORA_DISK_1: starting piece 1 at 06-MAR-16
channel ORA_DISK_1: finished piece 1 at 06-MAR-16
piece handle=/data02/backup/CDB/CDB_0nqvq6cj_1_1 tag=TAG20160306T132621 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00007 name=/oracle/oradata/CDB/pdbseed/sysaux01.dbf
input datafile file number=00005 name=/oracle/oradata/CDB/pdbseed/system01.dbf
channel ORA_DISK_1: starting piece 1 at 06-MAR-16
channel ORA_DISK_1: finished piece 1 at 06-MAR-16
piece handle=/data02/backup/CDB/CDB_0oqvq6cr_1_1 tag=TAG20160306T132621 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
Finished backup at 06-MAR-16

Starting backup at 06-MAR-16
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=90 RECID=14 STAMP=905779618
channel ORA_DISK_1: starting piece 1 at 06-MAR-16
channel ORA_DISK_1: finished piece 1 at 06-MAR-16
piece handle=/data02/backup/CDB/CDB_0pqvq6d2_1_1 tag=TAG20160306T132658 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 06-MAR-16

Starting Control File and SPFILE Autobackup at 06-MAR-16
piece handle=/oracle/fast_recovery_area/CDB/autobackup/2016_03_06/o1_mf_s_905779619_cfrxmmm0_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 06-MAR-16

6.) Backup PDB

BACKUP PLUGGABLE DATABASE pdb1;

Starting backup at 06-MAR-16
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=00017 name=/oracle/oradata/CDB/pdb1/sysaux01.dbf
input datafile file number=00016 name=/oracle/oradata/CDB/pdb1/system01.dbf
channel ORA_DISK_1: starting piece 1 at 06-MAR-16
channel ORA_DISK_1: finished piece 1 at 06-MAR-16
piece handle=/data02/backup/CDB/CDB_0rqvq6jl_1_1 tag=TAG20160306T133029 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
Finished backup at 06-MAR-16

Starting Control File and SPFILE Autobackup at 06-MAR-16
piece handle=/oracle/fast_recovery_area/CDB/autobackup/2016_03_06/o1_mf_s_905779836_cfrxtf16_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 06-MAR-16

7.) Listing Backups:

list backup of database summary;


List of Backups
===============
Key     TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
21      B  F  A DISK        06-MAR-16       1       1       NO         TAG20160306T132621
22      B  F  A DISK        06-MAR-16       1       1       NO         TAG20160306T132621
23      B  F  A DISK        06-MAR-16       1       1       NO         TAG20160306T132621
24      B  F  A DISK        06-MAR-16       1       1       NO         TAG20160306T132621
27      B  F  A DISK        06-MAR-16       1       1       NO         TAG20160306T133029


list backup  of pluggable database pdb1;


List of Backup Sets
===================


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
22      Full    603.45M    DISK        00:00:04     06-MAR-16
        BP Key: 22   Status: AVAILABLE  Compressed: NO  Tag: TAG20160306T132621
        Piece Name: /data02/backup/CDB/CDB_0mqvq6cc_1_1
  List of Datafiles in backup set 22
  Container ID: 3, PDB Name: PDB1
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  16      Full 2053591    06-MAR-16 /oracle/oradata/CDB/pdb1/system01.dbf
  17      Full 2053591    06-MAR-16 /oracle/oradata/CDB/pdb1/sysaux01.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
27      Full    603.45M    DISK        00:00:04     06-MAR-16
        BP Key: 27   Status: AVAILABLE  Compressed: NO  Tag: TAG20160306T133029
        Piece Name: /data02/backup/CDB/CDB_0rqvq6jl_1_1
  List of Datafiles in backup set 27
  Container ID: 3, PDB Name: PDB1
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  16      Full 2053591    06-MAR-16 /oracle/oradata/CDB/pdb1/system01.dbf
  17      Full 2053591    06-MAR-16 /oracle/oradata/CDB/pdb1/sysaux01.dbf

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s