DBV——DBVerify

来源:互联网 发布:淘宝可以做免单活动吗 编辑:程序博客网 时间:2024/06/05 03:31

DBVERIFY is an external command-line utility that performs a physical data structure integrity check. It can be used on offline or online databases, as well on backup files. You use DBVERIFY primarily when you need to ensure that a backup database (or datafile) is valid before it is restored, or as a diagnostic aid when you have encountered data corruption problems.

Because DBVERIFY can be run against an offline database, integrity checks are significantly faster.

DBVERIFY checks are limited to cache-managed blocks (that is, data blocks). Because DBVERIFY is only for use with datafiles, it will not work against control files or redo logs.

dbv file=/home/u01/app/oracle/oradata/orcl/undotbs01.dbf feedback=1000               
 
DBVERIFY: Release 
10.2.0.1.0 - Production on Tue Apr 24 14:59:58 2007
 
Copyright (c) 
19822005, Oracle.  All rights reserved.
 
DBVERIFY 
- Verification starting : FILE = /home/u01/app/oracle/oradata/orcl/undotbs01.dbf
................................................................................
................................................................................
................................................................................
...
 
DBVERIFY 
- Verification complete
 
Total Pages Examined         : 
242560
Total Pages Processed (Data) : 
0
Total Pages Failing   (Data) : 
0
Total Pages Processed (Index): 
0
Total Pages Failing   (Index): 
0
Total Pages Processed (Other): 
242191
Total Pages Processed (Seg)  : 
0
Total Pages Failing   (Seg)  : 
0
Total Pages Empty            : 
369
Total Pages Marked Corrupt   : 
0
Total Pages Influx           : 
0
Highest block SCN            : 
532621567 (1.532621567)

Total Pages Examined         : --数据文件块的数量
Total Pages Processed (Data) : -- 块的验证数量
Total Pages Failing   (Data) : --数据块的效验失败数量
Total Pages Processed (Index): --索引块的验证数量
Total Pages Failing   (Index): --索引块的效验失败数量
Total Pages Processed (Other): --其他类型块的验证数量
Total Pages Empty            : --空块数量
Total Pages Marked Corrupt   : --cache header无效块的数量
Total Pages Influx           : --同时读和写的块的数量

官方文档:

Using DBVERIFY to Validate Disk Blocks of a Single Datafile

In this mode, DBVERIFY scans one or more disk blocks of a single datafile and performs page checks.

Note:

If the file you are verifying is an Automatic Storage Management (ASM) file, you must supply a USERID. This is because DBVERIFY needs to connect to an Oracle instance to access ASM files.

Syntax

The syntax for DBVERIFY when you want to validate disk blocks of a single datafile is as follows:

Description of dbverify.gif follows
Description of the illustration dbverify.gif

Parameters

Descriptions of the parameters are as follows:

Parameter Description USERID Specifies your username and password. This parameter is only necessary when the files being verified are ASM files. FILE The name of the database file to verify. START The starting block address to verify. Specify block addresses in Oracle blocks (as opposed to operating system blocks). If you do not specify START, DBVERIFY defaults to the first block in the file. END The ending block address to verify. If you do not specify END, DBVERIFY defaults to the last block in the file. BLOCKSIZE BLOCKSIZE is required only if the file to be verified does not have a block size of 2 KB. If the file does not have block size of 2 KB and you do not specify BLOCKSIZE, you will receive the error DBV-00103. LOGFILE Specifies the file to which logging information should be written. The default sends output to the terminal display. FEEDBACK Causes DBVERIFY to send a progress display to the terminal in the form of a single period (.) for n number of pages verified during the DBVERIFY run. If n = 0, there is no progress display. HELP Provides online help. PARFILE Specifies the name of the parameter file to use. You can store various values for DBVERIFY parameters in flat files. This enables you to customize parameter files to handle different types of datafiles and to perform specific types of integrity checks on datafiles.

Command-Line Interface

The following example shows a sample use of the command-line interface to this mode of DBVERIFY.

% dbv FILE=t_db1.dbf FEEDBACK=100

Sample DBVERIFY Output

The following is a sample verification of the file t_db1.dbf.The feedback parameter has been given the value 100 to display one period (.) for every 100 pages processed. A portion of the resulting output is also shown.

% dbv FILE=t_db1.dbf FEEDBACK=100...DBVERIFY - Verification starting : FILE = t_db1.dbf ................................................................................ DBVERIFY - Verification complete  Total Pages Examined         : 9216 Total Pages Processed (Data) : 2044 Total Pages Failing   (Data) : 0 Total Pages Processed (Index): 733 Total Pages Failing   (Index): 0 Total Pages Empty            : 5686 Total Pages Marked Corrupt   : 0 Total Pages Influx           : 0 

Notes:

  • Pages = Blocks

  • Total Pages Examined = number of blocks in the file

  • Total Pages Processed = number of blocks that were verified (formatted blocks)

  • Total Pages Failing (Data) = number of blocks that failed the data block checking routine

  • Total Pages Failing (Index) = number of blocks that failed the index block checking routine

  • Total Pages Marked Corrupt = number of blocks for which the cache header is invalid, thereby making it impossible for DBVERIFY to identify the block type

  • Total Pages Influx = number of blocks that are being read and written to at the same time. If the database is open when DBVERIFY is run, DBVERIFY reads blocks multiple times to get a consistent image. But because the database is open, there may be blocks that are being read and written to at the same time (INFLUX). DBVERIFY cannot get a consistent image of pages that are in flux.

Using DBVERIFY to Validate a Segment

In this mode, DBVERIFY enables you to specify a table segment or index segment for verification. It checks to make sure that a row chain pointer is within the segment being verified.

This mode requires that you specify a segment (data or index) to be validated. It also requires that you log on to the database with SYSDBA privileges, because information about the segment must be retrieved from the database.

During this mode, the segment is locked. If the specified segment is an index, the parent table is locked. Note that some indexes, such as IOTs, do not have parent tables.

Syntax

The syntax for DBVERIFY when you want to validate a segment is as follows:

Description of dbverify_seg.gif follows
Description of the illustration dbverify_seg.gif

Parameters

Descriptions of the parameters are as follows:

Parameter Description USERID Specifies your username and password. SEGMENT_ID Specifies the segment that you want to verify. It is composed of the tablespace ID number (tsn), segment header file number (segfile), and segment header block number (segblock). You can get this information from SYS_USER_SEGS. The relevant columns are TABLESPACE_ID, HEADER_FILE, and HEADER_BLOCK. You must have SYSDBA privileges to query SYS_USER_SEGS. LOGFILE Specifies the file to which logging information should be written. The default sends output to the terminal display. FEEDBACK Causes DBVERIFY to send a progress display to the terminal in the form of a single period (.) for n number of pages verified during the DBVERIFY run. If n = 0, there is no progress display. HELP Provides online help. PARFILE Specifies the name of the parameter file to use. You can store various values for DBVERIFY parameters in flat files. This enables you to customize parameter files to handle different types of datafiles and to perform specific types of integrity checks on datafiles.

Command-Line Interface

The following example shows a sample use of the command-line interface to this mode of DBVERIFY.

dbv USERID=username/password SEGMENT_ID=tsn.segfile.segblock

For example, you could enter the following (assuming user hr had SYSDBA privileges):

dbv USERID=hr/hr SEGMENT_ID=1.2.67

The output would look similar to the following:

DBVERIFY - Verification starting : SEGMENT_ID = 1.2.67  DBVERIFY - Verification complete Total Pages Examined         : 8Total Pages Processed (Data) : 0Total Pages Failing   (Data) : 0Total Pages Processed (Index): 1Total Pages Failing   (Index): 0Total Pages Processed (Other): 2Total Pages Processed (Seg)  : 1Total Pages Failing   (Seg)  : 0Total Pages Empty            : 4Total Pages Marked Corrupt   : 0Total Pages Influx           : 0Highest block SCN            : 7358 (0.7358)
原创粉丝点击