Physical consistency and logical consistency check (DBV, rman) DBV tool features: Read-only, can be checked online without modification, do not need to close the database. The control file and log file cannot be checked, but the data file can be checked. However, the database must be open, you must use USERID to specify the data file extension for users such as dbv file = + DG1/ORCL/datafile/system01.dbf userid = system/sys on many UNIX platforms. If there is no (bare device), you can create a link and perform operations on the linked file, for example, ln-s/dev/rdsk/mydevice/tmp/mydevice. dbf in some platforms, DBV tool cannot check files larger than 2 GB, if you encounter a DBV-100 error, please first check the file size, Metalink Bug 710888 has a description of this problem. You can directly enter dbv to obtain the help BLOCKSIZE, which must be consistent with the blocksize of the file to be checked. The default value is 8192SEGMENT_ID. You can specify the <tsn. segfile, segblock> Example 1. Check users01.dbf
[Oracle @ Rhel5 ~] $ Dbv file =/u01/oradata/10G101/users01.dbf blocksize = 8192 file enter the absolute path, otherwise the dbv-600 error DBVERIFY may be reported: release 10.2.0.5.0-Production on Mon Aug 5 23:34:28 2013 Copyright (c) 1982,200 7, Oracle. all rights reserved. DBVERIFY-Verification starting: FILE =/u01/oradata/10G101/system01.dbfPage 28618 is marked corrupt1_upt block relative dba: 0x00406fca (file 1, block 28618) Bad check value found during dbv: data in bad block: type: 6 format: 2 rdba: 0x00406fcalast change scn: 0x0000. 00029ab9 seq: 0x1 flg: 0x04spare1: 0x0 spare2: 0x0 spare3: 0x0consistency value in tail: 0x9ab90601check value in block header: 0xc694computed block checksum: 0x7400DBVERIFY-Verification completeTotal Pages Examined: 57600 Total Pages Processed (Data): 38088 Total Pages Failing (Data): 0 Total Pages Processed (Index): 7049 Total Pages Failing (Index ): 0 Total Pages Processed (Other): 1867 Total Pages Processed (Seg): 1 Total Pages Failing (Seg): 0 Total Pages Empty: 10595 Total Pages Marked failed upt: 1 Total Pages Influx: 0 Highest block SCN: 676674 (0.676674)
Example 2: Check the segment TEST to view the tsn, segfile, and segblock of the object.
SQL> select t.ts#,s.header_file,s.header_block from v$tablespace t,dba_segments s where s.segment_name='TEST and t.name=s.tablespace_name; TS# HEADER_FILE HEADER_BLOCK---------- ----------- ------------ 0 1 56377[oracle@Rhel5 10G101]$ dbv userid=system/password segment_id=0.1.56377DBVERIFY: Release 10.2.0.5.0 - Production on Mon Aug 5 23:03:54 2013Copyright (c) 1982, 2007, Oracle. All rights reserved.DBVERIFY - Verification starting : SEGMENT_ID = 0.1.56377DBVERIFY - Verification completeTotal Pages Examined : 2Total Pages Processed (Data) : 1Total Pages Failing (Data) : 0Total Pages Processed (Index): 0Total Pages Failing (Index): 0Total Pages Processed (Other): 0Total Pages Processed (Seg) : 1sTotal Pages Failing (Seg) : 0Total Pages Empty : 0Total Pages Marked Corrupt : 1Total Pages Influx : 0 Highest block SCN : 666485 (0.666485)
You can also use the RMAN tool to confirm the location.
RMAN> backup check logical validate datafile 1;
Result query:
SQL> select file#,block#,blocks from v$database_block_corruption; FILE# BLOCK# BLOCKS---------- ---------- ---------- 1 28618 1