Thursday, August 27, 2009

DBV

dbv
The Database Verify utility (dbv) provides a mechanism to validate the structure of Oracle data files at the operating system level. It should be used on a regular basis to inspect data files for signs of corruption.

Although it can be used against open data files, the primary purpose of dbv is to verify the integrity of cold datafiles that would be used for a backup. The utility can only be used against datafiles however, not control files or archived redo logs.



dbv Command Line Options


File – The name of the Oracle datafile to verify. The file must be specified with full path name and file name including extension (.dbf).
Start – The block within the file to begin the verification. If none is specified, dbv will begin at the first block in the file. This parameter should be used when processing large files in which the entire file does not need scanning.
End – The last block in the data file to verify. If none is specified, dbv will process to the end of the file. This parameter should be used when processing large files in which the entire file does not need scanning.
Blocksize – The database blocksize of the file that needs verification. This must be set to the v$datafile.db_block_size value for the data file.
If the blocksize is not specified, it will default to 2K. If the blocksize for the datafile does not equal the blocksize specified, dbv will terminate and print an error message:
dbv-00103: Specified BLOCKSIZE (2048) differs from actual (8192)

Logfile – The name of the file to direct the dbv output. If none is specified, the output will be sent to the terminal. When scheduling a dbv-based shell script, it will be this file that needs to be checked for corruption errors.
Feedback – A progress meter that displays a dot for n pages examined in the file (FEEDBACK=10000). Use this to provide a status indicator when dbv is executed against large files. This is needed to indicate that the dbv process is actively processing a file. This option is obviously not needed when executing dbv through a scheduled shell script.
Parfile - A parameter file that can contain any of these options. The parfile should be created once and used with every dbv command.
Segment_ID – A parameter that will scan a segment regardless of the number of files it spans. The format is segment_id=tsn.segfile.segblock
Userid – Used only in combination with segment_id to specify the username/password for the database connection.



Executing dbv and Interpreting the Output
dbv can be executed by specifying the file name and blocksize of the datafile. All other parameters are optional.

$ dbv file=/data1/oracle/oradata/IMANYDME/Edge_app.dbf

DBVERIFY: Release 10.2.0.4.0 - Production on Thu Aug 27 17:44:36 2009

Copyright (c) 1982, 2007, Oracle. All rights reserved.

DBVERIFY - Verification starting : FILE = /data1/oracle/oradata/IMANYDME/Edge_app.dbf


Once executed, dbv provides the following output for each file it verifies:

DBVERIFY - Verification complete

Total Pages Examined : 695312

Total Pages Processed (Data) : 456902

Total Pages Failing (Data) : 0

Total Pages Processed (Index) : 211585

Total Pages Failing (Index) : 0

Total Pages Processed (Other) : 5796

Total Pages Processed (Seg) : 0

Total Pages Failing (Seg) : 0

Total Pages Empty : 21029

Total Pages Marked Corrupt : 0

Total Pages Influx : 0

Highest block SCN : 283596686 (2.283596686)



Alternative Block Checking Mechanisms
analyze table … validate structure – The analyze command can do things that dbv cannot and vice-versa. The analyze command can validate that tables and indexes are in sync with each other. However, the analyze command only processes an object up to the point of its high water mark (HWM), whereas dbv processes all blocks in a file. Block corruption can occur in blocks above the HWM.

The analyze command would have to be executed against an open database for each object in the database. dbv can work against offline files and is much faster since it is strictly at the file level. In addition, the analyze table command places an exclusive lock on the object being analyzed. Alternatively, dbv works outside of the database in “read only” mode against the datafiles and does not lock anything. Any errors encountered by the analyze table command are reported in the session trace file in the user dump destination directory.

No comments:

Post a Comment