During this article we will discuss how to Exclude Tablespace from Backup and configure Exclude option using RMAN. Sometimes we may exclude one or more tablespace from our database RMAN backup or regular RMAN backup. Suppose a tablespace contains test data only or its data never changed in such cases, we may exclude this from our backup.
For this type of issue we can configure the exclude option to exclude the specified tablespace. Also we can generally skip or exclude the specified tablespace from backup database command. But only when the specified tablespace is in offline or read only mode. Follow the steps to configure the exclude option.
Exclude tablespace configuration :
Here we exclude a tablespace name PRASANTA.
[oracle@node-1 ~]$ rman target /
Recovery Manager: Release 19.0.0.0.0 - Production on Sun May 2 00:48:48 2021
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1595923691)
RMAN> configure exclude for tablespace PRASANTA;
using target database control file instead of recovery catalog
Tablespace PRASANTA will be excluded from future whole database backups
new RMAN configuration parameters are successfully stored
RMAN>
RMAN> show exclude;
RMAN configuration parameters for database with db_unique_name ORCL are:
CONFIGURE EXCLUDE FOR TABLESPACE 'PRASANTA';
RMAN>
Take full Database backup after a tablespace exclude configured :
RMAN> backup database;
Starting backup at 02-MAY-21
using channel ORA_DISK_1
file 5 is excluded from whole database backup
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00002 name=/u01/app/oracle/oradata/ORCL/tapas01.dbf
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=00007 name=/u01/app/oracle/oradata/ORCL/users01.dbf
channel ORA_DISK_1: starting piece 1 at 02-MAY-21
channel ORA_DISK_1: finished piece 1 at 02-MAY-21
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2021_05_02/o1_mf_nnndf_TAG20210502T013712_j8vf7kxv_.bkp tag=TAG20210502T013712 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:06
Finished backup at 02-MAY-21
Starting Control File and SPFILE Autobackup at 02-MAY-21
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/autobackup/2021_05_02/o1_mf_s_1071452300_j8vf9o32_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 02-MAY-21
RMAN>
Take full database backup using noexclude command :
Using below command you can take the whole database backup.
RMAN> backup database noexclude;
Starting backup at 02-MAY-21
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=471 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=00002 name=/u01/app/oracle/oradata/ORCL/tapas01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/ORCL/prasanta01.dbf
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=00007 name=/u01/app/oracle/oradata/ORCL/users01.dbf
channel ORA_DISK_1: starting piece 1 at 02-MAY-21
channel ORA_DISK_1: finished piece 1 at 02-MAY-21
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2021_05_02/o1_mf_nnndf_TAG20210502T005121_j8vbklp2_.bkp tag=TAG20210502T005121 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:06
Finished backup at 02-MAY-21
Starting Control File and SPFILE Autobackup at 02-MAY-21
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/autobackup/2021_05_02/o1_mf_s_1071449549_j8vbmp2b_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 02-MAY-21
RMAN>
You can take the exclude configured tablespace backup using below command :
RMAN> backup tablespace PRASANTA;
Starting backup at 02-MAY-21
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=00005 name=/u01/app/oracle/oradata/ORCL/prasanta01.dbf
channel ORA_DISK_1: starting piece 1 at 02-MAY-21
channel ORA_DISK_1: finished piece 1 at 02-MAY-21
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2021_05_02/o1_mf_nnndf_TAG20210502T005357_j8vbpfvn_.bkp tag=TAG20210502T005357 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 02-MAY-21
Starting Control File and SPFILE Autobackup at 02-MAY-21
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/autobackup/2021_05_02/o1_mf_s_1071449639_j8vbphmg_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 02-MAY-21
RMAN>
Disable the exclusion feature tablespace :
We can disable the exclusion feature tablespace PRASANTA using below command.
RMAN> configure exclude for tablespace PRASANTA clear;
Tablespace PRASANTA will be included in future whole database backups
old RMAN configuration parameters are successfully deleted
RMAN>
RMAN> show exclude;
RMAN configuration parameters for database with db_unique_name ORCL are:
RMAN configuration has no stored or default parameters
RMAN>
I hope my written content will helped you. Your suggestions/feedback are most welcome from orakldba.com.
Keep learning… Have a great day!!!
Please comment here for your any query related to above content. You can write to mail me through : orakldba@gmail.com.
“Good note” it’s helpful to backup of database
Thanks Manik for your valuable comment.