Database Reference
In-Depth Information
Validating Backup Pieces
Another interesting feature that could easily be implemented would be to check the backup
pieces created for consistency with the command
VALIDATE
.
VALIDATE
reads backup pieces and
verifies them block by block without restoring any files.
VALIDATE
CHECK
LOGICAL
performs more
thorough tests than
VALIDATE
alone.
When RMAN is started with the
MSGNO
option, each item (or line) it packs into a pipe message
is prefixed by the string “RMAN-
nnnnn
” (with the exception of the termination message
“Recovery Manager complete.”). Messages concerning backup pieces are prefixed by “RMAN-
08530”, as follows:
RV MSG
--- --------------------------------------------------------------------------
1
RMAN-08530
: piece handle=A16J2S5GD.BKP tag=TAG20071205T194829 comment=NONE
This feature could be used to extract the backup piece name and to run a
VALIDATE
command
on the backup set containing the backup piece. The backup set key may be retrieved from the
view
V$BACKUP_PIECE
.
SQL> SELECT recid, piece#, tag, status
FROM V$backup_piece
WHERE handle='A16J2S5GD.BKP';
RECID PIECE# TAG STATUS
----- ------ ------------------ ------
31 1 TAG20071205T194829 A
The column
RECID
contains the backup set key for the
VALIDATE
command.
$ rman target / msgno
Recovery Manager: Release 10.2.0.1.0 - Production on Wed Dec 5 19:39:27 2007
RMAN-06005: connected to target database: TEN (DBID=2870266532)
RMAN> validate backupset 31;
RMAN-06009: using target database control file instead of recovery catalog
RMAN-08030: allocated channel: ORA_DISK_1
RMAN-08500: channel ORA_DISK_1: sid=32 devtype=DISK
RMAN-08097: channel ORA_DISK_1: starting validation of archive log backupset
RMAN-08003: channel ORA_DISK_1: reading from backup piece A16J2S5GD.BKP
RMAN-08023: channel ORA_DISK_1: restored backup piece 1
RMAN-08511: piece handle=A16J2S5GD.BKP tag=TAG20071205T194829
RMAN-08182: channel ORA_DISK_1: validation complete, elapsed time: 00:00:07
If the backup set contains a corrupt backup piece, the
VALIDATE
command fails, but RMAN
does not write an error stack.
RMAN> VALIDATE BACKUPSET 31;
RMAN-12016: using channel ORA_DISK_1
RMAN-08097: channel ORA_DISK_1: starting validation of archive log backupset
RMAN-08003: channel ORA_DISK_1: reading from backup piece A16J2S5GD.BKP
RMAN-01005: ORA-19870: error reading backup piece A16J2S5GD.BKP
ORA-19587: error occurred reading 0 bytes at block number 1