From today’s post, I am going to remind you all about those colleges day when we used to learn about the validation in programming languages. In daily life are aware of validation. In the database world, it is little different. Let’s have look at the types of validation in general terms.

 

 

Some of the types of data validation include:

  • Code validation
  • Data type validation
  • Data range validation
  • Constraint validation
  • Structured validation

Now come to our world, As we have gone through about validation. Look at for the purpose of VALIDATE.

Purpose

Use the VALIDATE command to check for corrupt blocks and missing files, or to determine whether a backup set can be restored.

 

Step 1: The below command just gives the report of backups that are used to do the  restore and recover :

RMAN> run
{
set until time "to_date('2014-22-10:9:00:00','yyyy-dd-mm:hh24:mi:ss')";
restore database preview;
}

2> 3> 4> 5>

executing command: SET until clause

using target database control file instead of recovery catalog

Starting restore at 22-OCT-14

allocated channel: ORA_DISK_1

channel ORA_DISK_1: sid=4 devtype=DISK

List of Backup Sets

===================
BS Key Type LV Size Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

3457 Full 3.41G DISK 00:11:40 22-OCT-14

BP Key: 3457 Status: AVAILABLE Compressed: YES Tag: WHOLE_DATABASE_OPEN

Piece Name: /u03/rman/db_797315408_3460_p1

List of Datafiles in backup set 3457

File LV Type Ckp SCN Ckp Time Name

---- -- ---- ---------- --------- ----

1 Full 135540931 22-OCT-14 /u01/oracle/oradata/prod/system01.dbf

2 Full 135540931 22-OCT-14 /u01/oracle/oradata/prod/undotbs01.dbf

3 Full 135540931 22-OCT-14 /u01/oracle/oradata/prod/sysaux01.dbf

4 Full 135540931 22-OCT-14 /u01/oracle/oradata/prod/users01.dbf

5 Full 135540931 22-OCT-14 /u01/oracle/oradata/prod/prodtbs

6 Full 135540931 22-OCT-14 /u01/oracle/oradata/prod/prod_data_space.dbf

using channel ORA_DISK_1

List of Archived Log Copies

Key Thrd Seq S Low Time Name

------- ---- ------- - --------- ----

48185 1 48301 A 22-OCT-14 /u03/arch/1_48301_738779061.dbf

48186 1 48302 A 22-OCT-14 /u03/arch/1_48302_738779061.dbf

48187 1 48303 A 22-OCT-14 /u03/arch/1_48303_738779061.dbf

48188 1 48304 A 22-OCT-14 /u03/arch/1_48304_738779061.dbf

48189 1 48305 A 22-OCT-14 /u03/arch/1_48305_738779061.dbf

48190 1 48306 A 22-OCT-14 /u03/arch/1_48306_738779061.dbf

48191 1 48307 A 22-OCT-14 /u03/arch/1_48307_738779061.dbf

48192 1 48308 A 22-OCT-14 /u03/arch/1_48308_738779061.dbf

48193 1 48309 A 22-OCT-14 /u03/arch/1_48309_738779061.dbf

48194 1 48310 A 22-OCT-14 /u03/arch/1_48310_738779061.dbf

48195 1 48311 A 22-OCT-14 /u03/arch/1_48311_738779061.dbf

48196 1 48312 A 22-OCT-14 /u03/arch/1_48312_738779061.dbf

48197 1 48313 A 22-OCT-14 /u03/arch/1_48313_738779061.dbf

48198 1 48314 A 22-OCT-14 /u03/arch/1_48314_738779061.dbf

48199 1 48315 A 22-OCT-14 /u03/arch/1_48315_738779061.dbf

48200 1 48316 A 22-OCT-14 /u03/arch/1_48316_738779061.dbf

48201 1 48317 A 22-OCT-14 /u03/arch/1_48317_738779061.dbf

Media recovery start SCN is 135540931

Recovery must be done beyond SCN 135540931 to clear data files fuzziness

Finished restore at 22-OCT-14

Step 2: Then run the below command to check the backup pieces are good :

The below command will read the backup pieces/Copies which has datafiles and if finds any error it will report at the RMAN prompt.

 

RMAN> run

{
allocate channel c1 type disk;

set until time "to_date('2014-22-10:9:00:00','yyyy-dd-mm:hh24:mi:ss')";

restore database validate;

} 2> 3> 4> 5> 6>

released channel: ORA_DISK_1

allocated channel: c1

channel c1: sid=4 devtype=DISK

executing command: SET until clause

Starting restore at 22-OCT-14

channel c1: starting validation of datafile backupset

channel c1: reading from backup piece /u02/rman/db_797315408_3460_p1

Step 3: Check the archivelogs needed for recovery

Replace the xxx, yyy with the start and end archivelog sequence reported by restore database preview command ran in the step 1.

RMAN> run

2> {
allocate channel c1 type disk;
restore archivelog from sequence 48301 until sequence 48317 validate;
}

3> 4> 5>

allocated channel: c1

channel c1: sid=4 devtype=DISK

Starting restore at 22-OCT-14

channel c1: scanning archive log /u02/arch/1_48301_738779061.dbf

channel c1: scanning archive log /u02/arch/1_48302_738779061.dbf

channel c1: scanning archive log /u02/arch/1_48303_738779061.dbf

channel c1: scanning archive log /u02/arch/1_48304_738779061.dbf

channel c1: scanning archive log /u02/arch/1_48305_738779061.dbf

channel c1: scanning archive log /u02/arch/1_48306_738779061.dbf

channel c1: scanning archive log /u02/arch/1_48307_738779061.dbf

channel c1: scanning archive log /u02/arch/1_48308_738779061.dbf

channel c1: scanning archive log /u02/arch/1_48309_738779061.dbf

channel c1: scanning archive log /u02/arch/1_48310_738779061.dbf

channel c1: scanning archive log /u02/arch/1_48311_738779061.dbf

channel c1: scanning archive log /u02/arch/1_48312_738779061.dbf

channel c1: scanning archive log /u02/arch/1_48313_738779061.dbf

channel c1: scanning archive log /u02/arch/1_48314_738779061.dbf

channel c1: scanning archive log /u02/arch/1_48315_738779061.dbf

channel c1: scanning archive log /u02/arch/1_48316_738779061.dbf

channel c1: scanning archive log /u02/arch/1_48317_738779061.dbf

Finished restore at 22-OCT-14

released channel: c1

RMAN>

Thanks to all readers for reading our post.

Thank you for giving your valuable time to read the above information.

If you want to be updated with all our articles send us the Invitation or Follow us:

Skant Gupta’s LinkedIn: www.linkedin.com/in/skantali/

Joel Perez’s LinkedIn: Joel Perez’s Profile

Anuradha’s LinkedIn: Anuradha’s Profile

LinkedIn Group: Oracle Cloud DBAAS

Facebook Page: OracleHelp

About The Author

Comments

  1. Pingback: Rman Validate - Detect And Repair Corruption In An Oracle ... - Oracle-Base

  2. Pingback: Rman Validate Backup – TricksDream

  3. Pingback: Rman Validate Backup - SecuredGuide

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.