Using DBV to investigate database block corruption

book

Article ID: 160683

calendar_today

Updated On:

Products

Data Loss Prevention Enforce

Issue/Introduction

While troubleshooting a database issue you come across evidence that leaves you to believe your datafiles may contain a block corruption. Use DBV to investigate.

Resolution

Relevant Versions: ALL

The Database Verify utility (dbv) can be used to inspect data files for signs of corruption.  To use the Database Verify utility, perform the following on the suspect database:

1) Create the following script in your favorite editor and save as "dbv_script.sql" to your favorite script location.  The first spool command should be modified to have the same path:

set heading off
set echo off
set feedback off
set pagesize 0
set linesize 200
set verify off
set space 0
set newpage 0
set scan off
spool c:\dbv_capture.bat
select 'dbv file='||file_name||' blocksize=8192 logfile='||file_name||'.dbvlog'
from dba_data_files;
Spool off

2) Log into SQLPLUS as sysdba

3) Run the dbv_script.sql by doing the following:

SQL> @dbv_script.sql

4) Exit SQLPLUS and get to the command prompt.

5) Navigate to the directory you specified for the spool output

6) At the prompt type:

For Windows:
dbv_capture.bat

For Linux / Unix:
./dbv_capture.bat

This may run for a while.  The larger the file that is being scanned, the longer it will take.
When the script is done, the command window will close.

7) Navigate to your oradata directory, where your datafiles (.dbfs) are kept.  

8) Review the log files.