You are here

RMAN Backup validate

Prüfen ob RMAN Sicherung Korrekt ist, es wird ein Recovery Szenario simuliert ohne das die Sicherung zurückgespielt wird.

  

Zur Info:
-- Kann in online Status durchgeführt werde (also ohne DownTime).
-- Man kann beim „validate“ sehen wie lange er brauchen würde bis er die Daten holt.
-- Bei 9i ist es „validate“ bei 10g ist es „recover database [db] test;“ aufruf.

 


- Date Format setzen

SQL>
alter SESSION SET nls_date_format = 'DD.MM.YYYY HH24:MI:SS';

Session altered.
 
Oder:
 
defx05f2@oracle[ASB4001T]: export NLS_DATE_FORMAT='DD.MM.YYYY HH24:MI:SS'
defx05f2@oracle[ASB4001T]: id
uid=59074(oracle) gid=1167(dba)
 
defx05f2@oracle[ASB4001T]: set |grep -i nls
NLS_DATE_FORMAT='DD.MM.YYYY HH24:MI:SS'
NLS_LANG=american
 
defx05f2@oracle[ASB4001T]: rman target /
connected to target database: ASB4001T (DBID=451296572)
 
 
 

-    Prüfen ob die Daten in RMAN vorhanden sind.
RMAN> list backup;

List of Backup Sets
===================
………
……
BS Key Type LV Size Device Type Elapsed Time Completion Time 
------- ---- -- ---------- ----------- ------------ --------------
89 Full 515M DISK 00:01:00 03.07.2008 15:04:22
 BP Key: 89 Status: AVAILABLE Tag: TAG20080703T150321
 Piece Name: /var/opt/data/oracle/ASB4001T/data1/backup/ASB4001T_90_20080703
 List of Datafiles in backup set 89
 File LV Type Ckp SCN Ckp Time Name
 ---- -- ---- ---------- ------------------- ----
 1 Full 1232545 03.07.2008 15:03:23 /var/opt/data/oracle/ASB4001T/data1/ASB4001T_SYSTEM_001.dbf
 2 Full 1232545 03.07.2008 15:03:23 /var/opt/data/oracle/ASB4001T/data1/ASB4001T_RBS_001.dbf
 3 Full 1232545 03.07.2008 15:03:23 /var/opt/data/oracle/ASB4001T/data1/ASB4001T_TOOLS_001.dbf
 4 Full 1232545 03.07.2008 15:03:23 /var/opt/data/oracle/ASB4001T/data1/ASB4001T_SCC_001.dbf
BS Key Size Device Type Elapsed Time Completion Time 
------- ---------- ----------- ------------ -------------------
90 2K DISK 00:00:01 03.07.2008 15:04:30
 BP Key: 90 Status: AVAILABLE Tag: TAG20080703T150429
 Piece Name: /var/opt/data/oracle/ASB4001T/data1/backup/ASB4001T_91_20080703
 List of Archived Logs in backup set 90
 Thrd Seq Low SCN Low Time Next SCN Next Time
 ---- ------- ---------- ------------------- ---------- ---------
 1 2 1232543 03.07.2008 15:03:17 1232570 03.07.2008 15:04:28
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
91 Full 8M DISK 00:00:02 03.07.2008 15:04:34
 BP Key: 91 Status: AVAILABLE Tag: 
 Piece Name: /var/opt/data/oracle/ASB4001T/data1/backup/ctrl_c-451296572-20080703-02.ctl
 SPFILE Included: Modification time: 09.05.2008 11:52:12
 ………
 
oder:
 
RMAN> list backup of database ;
List of Backup Sets
===================
………
……
BS Key Type LV Size Device Type Elapsed Time Completion Time 
------- ---- -- ---------- ----------- ------------ -------------------
89 Full 515M DISK 00:01:00 03.07.2008 15:04:22
 BP Key: 89 Status: AVAILABLE Tag: TAG20080703T150321
 Piece Name: /var/opt/data/oracle/ASB4001T/data1/backup/ASB4001T_90_20080703
 List of Datafiles in backup set 89
 File LV Type Ckp SCN Ckp Time Name
 ---- -- ---- ---------- ------------------- ----
 1 Full 1232545 03.07.2008 15:03:23 /var/opt/data/oracle/ASB4001T/data1/ASB4001T_SYSTEM_001.dbf
 2 Full 1232545 03.07.2008 15:03:23 /var/opt/data/oracle/ASB4001T/data1/ASB4001T_RBS_001.dbf
 3 Full 1232545 03.07.2008 15:03:23 /var/opt/data/oracle/ASB4001T/data1/ASB4001T_TOOLS_001.dbf
 4 Full 1232545 03.07.2008 15:03:23 /var/opt/data/oracle/ASB4001T/data1/ASB4001T_SCC_001.dbf
……
 
 
 

-      Selectieren des “Point in Time” Recovery, “F” = Full Sicherung

RMAN> LIST BACKUP SUMMARY;
List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Tag
------- -- -- - ----------- ------------------- ------- ------ ---
88 B A A DISK 03.07.2008 15:03:20 1 1 TAG20080703T150318
89 B F A DISK 03.07.2008 15:04:22 1 1 TAG20080703T150321
90 B A A DISK 03.07.2008 15:04:30 1 1 TAG20080703T150429
91 B F A DISK 03.07.2008 15:04:34 1 1 
 
 
 

-     Der Aufruf bei 9i ist „validate“ und bei 10g „recover database [db] test;“ .
RMAN> run {

2> set until time "TO_DATE('
03.07.2008 15:04:22','DD.MM.YYYY HH24:MI:SS')";
3> restore validate database;

4> }

executing command: SET until clause
Starting restore at 04.07.2008 14:15:41
using channel ORA_DISK_1
channel ORA_DISK_1: starting validation of datafile backupset
channel ORA_DISK_1: restored backup piece 1
piece handle=/var/opt/data/oracle/ASB4001T/data1/backup/ASB4001T_90_20080703 tag=TAG20080703T150321 params=NULL
channel ORA_DISK_1: validation complete
Finished restore at 04.07.2008 14:16:08

 
 

 

 AUS DER ORACLE DOKU.

Validating the Restore of a Backup

Check that you are able to restore the backups that you created without actually restoring them. Run the RESTORE ... VALIDATE command as follows:

You should see output similar to the following:

RMAN> RESTORE DATABASE VALIDATE;
Starting restore at 07-DEC-01
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=9 devtype=DISK
channel ORA_DISK_1: starting validation of datafile backupset
channel ORA_DISK_1: restored backup piece 1
piece handle=/oracle/dbs/07db39tr_1_1 tag=TAG20011012T191001 params=NULL
channel ORA_DISK_1: validation complete
Finished restore at 07-DEC-01
 

If there are no error messages, then RMAN confirms that the database backup can be restored. When there is an error, RMAN always displays an error banner and provides messages indicating the nature of the error. For example, if you attempt to restore the database when some backups do not exist, then RMAN displays an error stack such as the following:

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 12/07/2001 17:28:24
RMAN-06026: some targets not found - aborting restore
RMAN-06023: no backup or copy of datafile 8 found to restore
RMAN-06023: no backup or copy of datafile 7 found to restore
 

 

 

INFO:

Tests and Integrity Checks for Backups
You can use the BACKUP VALIDATE and RESTORE VALIDATE commands to test backup and restore operations
RMAN> backup validate database;
RMAN> backup validate database archivelog all;

RMAN> restore validate database;
RMAN> restore validate database archivelog all;

Detecting Physical and Logical Block Corruption
At the end of a backup, RMAN stores the corruption information in the recovery catalog and control file. Access this data using the V$DATABASE_BLOCK_CORRUPTION view.

 

Zum Beispiel:

RMAN> run {
2> restore validate database;
3> }
Starting restore at 17.03.2009 10:54:12
using channel ORA_SBT_TAPE_1
using channel ORA_SBT_TAPE_2
using channel ORA_DISK_1
channel ORA_SBT_TAPE_1: starting validation of datafile backupset
channel ORA_SBT_TAPE_2: starting validation of datafile backupset
channel ORA_SBT_TAPE_1: reading from backup piece /SCCD001P/DBF/6_06k9onq2_1_1_20090312
channel ORA_SBT_TAPE_2: reading from backup piece /SCCD001P/DBF/7_07k9onq2_1_1_20090312
channel ORA_SBT_TAPE_1: restored backup piece 1
piece handle=/SCCD001P/DBF/6_06k9onq2_1_1_20090312 tag=TAG20090312T201042
channel ORA_SBT_TAPE_1: validation complete, elapsed time: 00:07:25
channel ORA_SBT_TAPE_2: restored backup piece 1
piece handle=/SCCD001P/DBF/7_07k9onq2_1_1_20090312 tag=TAG20090312T201042
channel ORA_SBT_TAPE_2: validation complete, elapsed time: 00:07:51
Finished restore at 17.03.2009 11:02:08