Saturday, 7 November 2015

Container and Pluggable database backup command in oracle database 12c.

1) Backup container database plus pluggable database.

-> connect rman with sys user.

[oracle@cdb1 dbs]$ rman target=/
Recovery Manager: Release 12.1.0.2.0 - Production on Sun Oct 18 05:20:11 2015
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1413747592)

RMAN> BACKUP DATABASE PLUS ARCHIVELOG;
Starting backup at 18-OCT-15
current log archived
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=52 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=10 RECID=1 STAMP=893395257
channel ORA_DISK_1: starting piece 1 at 18-OCT-15
channel ORA_DISK_1: finished piece 1 at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2015_10_18/o1_mf_annnn_TAG20151018T052058_c25qq26k_.bkp tag=TAG20151018T052058 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 18-OCT-15
Starting backup at 18-OCT-15
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=00001 name=/u01/app/oracle/oradata/orcl/system01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/orcl/sysaux01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/orcl/undotbs01.dbf
input datafile file number=00006 name=/u01/app/oracle/oradata/orcl/users01.dbf
channel ORA_DISK_1: starting piece 1 at 18-OCT-15
channel ORA_DISK_1: finished piece 1 at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2015_10_18/o1_mf_nnndf_TAG20151018T052059_c25qq3j0_.bkp tag=TAG20151018T052059 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:35
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00009 name=/u01/app/oracle/oradata/orcl/pdb1/sysaux01.dbf
input datafile file number=00008 name=/u01/app/oracle/oradata/orcl/pdb1/system01.dbf
channel ORA_DISK_1: starting piece 1 at 18-OCT-15
channel ORA_DISK_1: finished piece 1 at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/1BA9531D0DD53B0EE05348304B74C6C7/backupset/2015_10_18/o1_mf_nnndf_TAG20151018T052059_c25qr711_.bkp tag=TAG20151018T052059 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:16
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=/u01/app/oracle/oradata/orcl/pdbseed/sysaux01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/orcl/pdbseed/system01.dbf
channel ORA_DISK_1: starting piece 1 at 18-OCT-15
channel ORA_DISK_1: finished piece 1 at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/1BA927A157F92B65E05348304B740CF8/backupset/2015_10_18/o1_mf_nnndf_TAG20151018T052059_c25qrp62_.bkp tag=TAG20151018T052059 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
Finished backup at 18-OCT-15
Starting backup at 18-OCT-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=11 RECID=2 STAMP=893395325
channel ORA_DISK_1: starting piece 1 at 18-OCT-15
channel ORA_DISK_1: finished piece 1 at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2015_10_18/o1_mf_annnn_TAG20151018T052205_c25qs5pm_.bkp tag=TAG20151018T052205 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 18-OCT-15
Starting Control File Autobackup at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/autobackup/2015_10_18/o1_mf_n_893395326_c25qs7b9_.bkp comment=NONE
Finished Control File Autobackup at 18-OCT-15

2) Backup only container database.

RMAN> BACKUP DATABASE ROOT plus archivelog;
Starting backup at 18-OCT-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=10 RECID=1 STAMP=893395257
input archived log thread=1 sequence=11 RECID=2 STAMP=893395325
input archived log thread=1 sequence=12 RECID=3 STAMP=893395548
channel ORA_DISK_1: starting piece 1 at 18-OCT-15
channel ORA_DISK_1: finished piece 1 at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2015_10_18/o1_mf_annnn_TAG20151018T052548_c25r04nz_.bkp tag=TAG20151018T052548 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 18-OCT-15
Starting backup at 18-OCT-15
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=00001 name=/u01/app/oracle/oradata/orcl/system01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/orcl/sysaux01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/orcl/undotbs01.dbf
input datafile file number=00006 name=/u01/app/oracle/oradata/orcl/users01.dbf
channel ORA_DISK_1: starting piece 1 at 18-OCT-15
channel ORA_DISK_1: finished piece 1 at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2015_10_18/o1_mf_nnndf_TAG20151018T052549_c25r05xs_.bkp tag=TAG20151018T052549 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:35
Finished backup at 18-OCT-15
Starting backup at 18-OCT-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=13 RECID=4 STAMP=893395585
channel ORA_DISK_1: starting piece 1 at 18-OCT-15
channel ORA_DISK_1: finished piece 1 at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2015_10_18/o1_mf_annnn_TAG20151018T052625_c25r19gf_.bkp tag=TAG20151018T052625 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 18-OCT-15
Starting Control File Autobackup at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/autobackup/2015_10_18/o1_mf_n_893395586_c25r1btk_.bkp comment=NONE
Finished Control File Autobackup at 18-OCT-15

3) Backup only pluggable database.

I have only one pluggable database pdb1.

SQL> select con_id,name from v$containers;
CON_ID NAME
---------- ------------------------------
1 CDB$ROOT
2 PDB$SEED
3 PDB1
RMAN> BACKUP PLUGGABLE DATABASE pdb1;
Starting backup at 18-OCT-15
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=00009 name=/u01/app/oracle/oradata/orcl/pdb1/sysaux01.dbf
input datafile file number=00008 name=/u01/app/oracle/oradata/orcl/pdb1/system01.dbf
channel ORA_DISK_1: starting piece 1 at 18-OCT-15
channel ORA_DISK_1: finished piece 1 at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/1BA9531D0DD53B0EE05348304B74C6C7/backupset/2015_10_18/o1_mf_nnndf_TAG20151018T053410_c25rhv5z_.bkp tag=TAG20151018T053410 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
Finished backup at 18-OCT-15
Starting Control File Autobackup at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/autobackup/2015_10_18/o1_mf_n_893396066_c25rjbgf_.bkp comment=NONE
Finished Control File Autobackup at 18-OCT-15

---> backup pluggable database using pluggable database.

[oracle@cdb1 dbs]$ rman target=sys/*****@pdb1

Recovery Manager: Release 12.1.0.2.0 - Production on Sun Oct 18 05:36:30 2015
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1413747592, not open)

RMAN> backup database;

Starting backup at 18-OCT-15
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1 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=00009 name=/u01/app/oracle/oradata/orcl/pdb1/sysaux01.dbf
input datafile file number=00008 name=/u01/app/oracle/oradata/orcl/pdb1/system01.dbf
channel ORA_DISK_1: starting piece 1 at 18-OCT-15
channel ORA_DISK_1: finished piece 1 at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/1BA9531D0DD53B0EE05348304B74C6C7/backupset
/2015_10_18/o1_mf_nnndf_TAG20151018T053658_c25ro2c4_.bkp tag=TAG20151018T053658 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
Finished backup at 18-OCT-15
Starting Control File Autobackup at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/autobackup/2015_10_18/o1_mf_n_893396233_c25roksn_.bkp comment=NONE
Finished Control File Autobackup at 18-OCT-15

4) Backup pluggable database tablespace.

RMAN> backup tablespace sysaux,system;

Starting backup at 18-OCT-15
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=00009 name=/u01/app/oracle/oradata/orcl/pdb1/sysaux01.dbf
input datafile file number=00008 name=/u01/app/oracle/oradata/orcl/pdb1/system01.dbf
channel ORA_DISK_1: starting piece 1 at 18-OCT-15
channel ORA_DISK_1: finished piece 1 at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/1BA9531D0DD53B0EE05348304B74C6C7/backupset/2015_10_18/o1_mf_nnndf_TAG20151018T053829_c25rqxkt_.bkp tag=TAG20151018T053829 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
Finished backup at 18-OCT-15
Starting Control File Autobackup at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/autobackup/2015_10_18/o1_mf_n_893396324_c25rrdt4_.bkp comment=NONE
Finished Control File Autobackup at 18-OCT-15

5) Backup pluggable database datafiles;

SQL> select CON_ID,FILE# from v$datafile;
CON_ID FILE#
---------- ----------
1 1
1 3
1 4
2 5
1 6
2 7
3 8
3 9
8 rows selected.

SQL> select con_id,name from v$containers;
CON_ID NAME
---------- ------------------------------
1 CDB$ROOT
2 PDB$SEED
3 PDB1

-> pdb1 database contain only two files 8 and 9;

RMAN> backup datafile 8,9;

Starting backup at 18-OCT-15
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1 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=00009 name=/u01/app/oracle/oradata/orcl/pdb1/sysaux01.dbf
input datafile file number=00008 name=/u01/app/oracle/oradata/orcl/pdb1/system01.dbf
channel ORA_DISK_1: starting piece 1 at 18-OCT-15
channel ORA_DISK_1: finished piece 1 at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/1BA9531D0DD53B0EE05348304B74C6C7/backupset/2015_10_18/o1_mf_nnndf_TAG20151018T055231_c25sl7wh_.bkp tag=TAG20151018T055231 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
Finished backup at 18-OCT-15
Starting Control File Autobackup at 18-OCT-15
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/autobackup/2015_10_18/o1_mf_n_893397166_c25slq4j_.bkp comment=NONE
Finished Control File Autobackup at 18-OCT-15

                                                      *******END********

No comments:

Post a Comment

work on autovacuum postgreSQL parameter

 In This blog, we are discussing the auto vacuum parameter on a small scale. we will understand the below parameters and will see how to mod...