Rman validate is a really nice way to check for block corruptions (both physical and logical). It has a nicer syntax than dbv (slightly) though it will give much the same output.
The main plus point of it is that if it finds and corruption they are recorded in a view you can query - dbv does not do this (that view being v$database_block_corruption)
The other thing is that it can do the operation in parallel (though i guess you could have multiple dbv sessions running) - but that is more fiddly to set up.
Anyway now that we've established that rman is the best way to check lets demo how to do it in parallel
Oh - and by the way you dont need to be using rman in any way for your backups to be able to use this feature (though to be honest if you aren't using rman you are probably stuck in the 1990's)
So lets create a connection and run the validate in parallel - the channels allocation is only necessary to run this in parallel - if you dont allocate any you just get the default of 1. In the case below the check found no corrupt blocks (which was a result as we though some nologging operation had happened that we had to recover through).
The parallel performance was slightly quicker overall for us but is suspect there was some sort of i/o bottleneck slowing it down. With more files and more i/o paths i'm sure that parallel would be much quicker than serial.
[oracle@server]:DB:/oracle/home/oracle# rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Mon Jan 20 14:10:18 2014
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: DB (DBID=12345678)
RMAN> RUN
{
ALLOCATE CHANNEL c1 DEVICE TYPE DISK;
ALLOCATE CHANNEL c2 DEVICE TYPE DISK;
ALLOCATE CHANNEL c3 DEVICE TYPE DISK;
ALLOCATE CHANNEL c4 DEVICE TYPE DISK;
validate check logical tablespace DB;
}2> 3> 4> 5> 6> 7> 8>
using target database control file instead of recovery catalog
allocated channel: c1
channel c1: SID=69 device type=DISK
allocated channel: c2
channel c2: SID=390 device type=DISK
allocated channel: c3
channel c3: SID=581 device type=DISK
allocated channel: c4
channel c4: SID=1158 device type=DISK
Starting validate at 20-JAN-14
channel c1: starting validation of datafile
channel c1: specifying datafile(s) for validation
input datafile file number=00068 name=/oracle/common/oradata/DB/DB/datafile/DB/DB_02.dbf
input datafile file number=00072 name=/oracle/common/oradata/DB/DB/datafile/DB/DB_09.dbf
input datafile file number=00076 name=/oracle/common/oradata/DB/DB/datafile/DB/DB_07.dbf
channel c2: starting validation of datafile
channel c2: specifying datafile(s) for validation
input datafile file number=00069 name=/oracle/common/oradata/DB/DB/datafile/DB/DB_03.dbf
input datafile file number=00073 name=/oracle/common/oradata/DB/DB/datafile/DB/DB_01.dbf
input datafile file number=00067 name=/oracle/common/oradata/DB/DB/datafile/DB/DB_10.dbf
channel c3: starting validation of datafile
channel c3: specifying datafile(s) for validation
input datafile file number=00070 name=/oracle/common/oradata/DB/DB/datafile/DB/DB_06.dbf
input datafile file number=00074 name=/oracle/common/oradata/DB/DB/datafile/DB/DB_04.dbf
channel c4: starting validation of datafile
channel c4: specifying datafile(s) for validation
input datafile file number=00071 name=/oracle/common/oradata/DB/DB/datafile/DB/DB_08.dbf
input datafile file number=00075 name=/oracle/common/oradata/DB/DB/datafile/DB/DB_05.dbf
channel c4: validation complete, elapsed time: 00:32:36
List of Datafiles
=================
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
71 OK 0 9 4194176 8948917695094
File Name: /oracle/common/oradata/DB/DB/datafile/DB/DB_08.dbf
Block Type Blocks Failing Blocks Processed
---------- -------------- ----------------
Data 0 2088578
Index 0 1623642
Other 0 481947
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
75 OK 0 1 4194176 8948917681106
File Name: /oracle/common/oradata/DB/DB/datafile/DB/DB_05.dbf
Block Type Blocks Failing Blocks Processed
---------- -------------- ----------------
Data 0 2042738
Index 0 1684783
Other 0 466654
channel c3: validation complete, elapsed time: 00:35:18
List of Datafiles
=================
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
70 OK 0 11 4194176 8948917695094
File Name: /oracle/common/oradata/DB/DB/datafile/DB/DB_06.dbf
Block Type Blocks Failing Blocks Processed
---------- -------------- ----------------
Data 0 2045522
Index 0 1663180
Other 0 485463
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
74 OK 0 9 4194176 8948917695094
File Name: /oracle/common/oradata/DB/DB/datafile/DB/DB_04.dbf
Block Type Blocks Failing Blocks Processed
---------- -------------- ----------------
Data 0 2051741
Index 0 1666095
Other 0 476331
channel c2: validation complete, elapsed time: 00:42:28
List of Datafiles
=================
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
67 OK 0 1833989 3481600 8948917542931
File Name: /oracle/common/oradata/DB/DB/datafile/DB/DB_10.dbf
Block Type Blocks Failing Blocks Processed
---------- -------------- ----------------
Data 0 745354
Index 0 426359
Other 0 475898
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
69 OK 0 1 4194176 8948917694442
File Name: /oracle/common/oradata/DB/DB/datafile/DB/DB_03.dbf
Block Type Blocks Failing Blocks Processed
---------- -------------- ----------------
Data 0 2040317
Index 0 1685076
Other 0 468782
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
73 OK 0 133 4194176 8948917681102
File Name: /oracle/common/oradata/DB/DB/datafile/DB/DB_01.dbf
Block Type Blocks Failing Blocks Processed
---------- -------------- ----------------
Data 0 2047711
Index 0 1667802
Other 0 478530
channel c1: validation complete, elapsed time: 00:45:28
List of Datafiles
=================
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
68 OK 0 5 4194176 8948917695094
File Name: /oracle/common/oradata/DB/DB/datafile/DB/DB_02.dbf
Block Type Blocks Failing Blocks Processed
---------- -------------- ----------------
Data 0 2057955
Index 0 1664210
Other 0 472006
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
72 OK 0 1 4194176 8948917681102
File Name: /oracle/common/oradata/DB/DB/datafile/DB/DB_09.dbf
Block Type Blocks Failing Blocks Processed
---------- -------------- ----------------
Data 0 2095495
Index 0 1628367
Other 0 470313
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
76 OK 0 1 4194176 8948917587110
File Name: /oracle/common/oradata/DB/DB/datafile/DB/DB_07.dbf
Block Type Blocks Failing Blocks Processed
---------- -------------- ----------------
Data 0 2038312
Index 0 1687496
Other 0 468367
Finished validate at 20-JAN-14
released channel: c1
released channel: c2
released channel: c3
released channel: c4
RMAN>
Comments
Post a Comment