Oracle – Full Export of Corrupted Database

oracle

I have a datafile with a corrupted block. Unfortunately I don't have backup to repair with RMAN (BAD strategy, first the strategy delete the old backup and after make a new backup) Because this new corruption I can't make a new backup with RMAN..

What happen if I make a full export of the database? the export will fail as well? Can I filter for don't make the export of the data in that block?

Best Answer

By default the full scan on that table with a corrupt block will fail, but you can make the scans skip the corrupt blocks of an object:

DBMS_REPAIR.SKIP_CORRUPT_BLOCKS

This procedure enables or disables the skipping of corrupt blocks during index and table scans of the specified object.

DBMS_REPAIR.SKIP_CORRUPT_BLOCKS (
   schema_name  IN VARCHAR2,
   object_name  IN VARCHAR2,
   object_type  IN BINARY_INTEGER DEFAULT TABLE_OBJECT,
   flags        IN BINARY_INTEGER DEFAULT SKIP_FLAG);

In RMAN you can create a backup with corrupt blocks by specifying the allowed maximum amount of corrupt blocks:

SET

MAXCORRUPT FOR DATAFILE datafileSpec TO integer

Sets a limit on the number of previously undetected block corruptions that the database permits in a specified data file or group of data files. The default limit is zero, meaning that RMAN tolerates no corrupt blocks.

The SET MAXCORRUPT command specifies the total number of physical and logical corruptions permitted in a data file during a backup job. If the sum of physical and logical corruptions detected for a data file is no more than its MAXCORRUPT setting, then the BACKUP command completes. If more than MAXCORRUPT corrupt blocks exist, then RMAN terminates without creating output files.

But you should just fix the object with the corrupt block instead of ignoring it.