SKIP DATAFILES DURING RMAN DATABASE BACKUP

SKIP DATAFILES DURING RMAN DATABASE BACKUP

I was taking backup of a database which got failed due to corrupted datafiles. Backup keep on failing for the whole database, even though one of the datafile is corrupted.

RMAN> backup as compressed backupset database;

Starting backup at 15-AUG-22
using channel ORA_DISK_1
RMAN-06169: could not read file header for datafile 23 error reason 4
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 08/15/2022 21:51:04
RMAN-06056: could not access datafile 23

After searching for the documentation to skip the particular datafile and take backup of remaining 95% of the data, i was able to get some options to skip a specific datafile which is either inaccessible or offline

  1. To skip a datafile which is inaccessible during backup
RMAN> backup as compressed backupset database skip inaccessible;

Starting backup at 15-AUG-22
using channel ORA_DISK_1
could not access datafile 23
skipping inaccessible file 23
RMAN-06060: warning: skipping datafile compromises tablespace PDBZX1:TEST recoverability
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00007 

2. To skip a datafile which is offline during backup

RMAN> backup as compressed backupset database skip offline;

Starting backup at 15-AUG-22
using channel ORA_DISK_1
skipping offline file 23
RMAN-06060: warning: skipping datafile compromises tablespace PDBZX1:TEST recoverability

3. To skip a datafile which is readonly during backup

RMAN> backup as compressed backupset database skip readonly;

Starting backup at 15-AUG-22
using channel ORA_DISK_1

To completely ignore a corrupted tablespace for all consecutive backups which is no longer required

RMAN> configure exclude for tablespace corrupt;

Tablespace CORRUPT will be excluded from future whole database backups
new RMAN configuration parameters are successfully stored

RMAN> backup as compressed backupset database skip offline;

Starting backup at 15-AUG-22
using channel ORA_DISK_1
skipping offline file 23

Leave a Reply

%d bloggers like this: