All in Oracle database.

Monday, August 17, 2009

How to use dbverify utility in Oracle database 11g.

August 17, 2009
1. Use dbv to verify a datafile.
[oracle@sinh1 sindb1]$ dbv file=/u01/oracle/oradata/sindb1/system01.dbf feedback=1000

DBVERIFY: Release 11.1.0.6.0 - Production on Mon Aug 17 09:32:58 2009

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

DBVERIFY - Verification starting : FILE = /u01/oracle/oradata/sindb1/system01.dbf
....................................................

DBVERIFY - Verification complete

Total Pages Examined         : 51200
Total Pages Processed (Data) : 13494
Total Pages Failing   (Data) : 0
Total Pages Processed (Index): 3992
Total Pages Failing   (Index): 0
Total Pages Processed (Other): 2380
Total Pages Processed (Seg)  : 0
Total Pages Failing   (Seg)  : 0
Total Pages Empty            : 31334
Total Pages Marked Corrupt   : 0
Total Pages Influx           : 0
Total Pages Encrypted        : 0
Highest block SCN            : 251706 (0.251706)
 
  Note: If you don't give a full path name of the file to be verified, dbv will encounter
  the following fatal error:
************************************************************************
[oracle@sinh1 sindb1]$ dbv FILE=system01.dbf

DBVERIFY: Release 11.1.0.6.0 - Production on Mon Aug 17 09:28:31 2009

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


DBV-00600: Fatal Error - [21] [2] [0] [0]
*************************************************************************

2. Use dbv to verify a segment.
2.1. Find the tablespace ID number (tsn), segment header file number (segfile), and segment header block number (segblock)
     of the segment. Using the following SQL:
SILVER@sindb1>  SELECT T.TS#,
            S.RELATIVE_FNO,
            S.HEADER_BLOCK
     FROM DBA_SEGMENTS S, V$TABLESPACE T
     WHERE S.OWNER='SILVER' AND S.SEGMENT_TYPE='TABLE'
       AND S.SEGMENT_NAME='TEST' AND T.NAME=S.TABLESPACE_NAME;  2    3    4    5    6

       TS# RELATIVE_FNO HEADER_BLOCK
---------- ------------ ------------
         4            4          275

SILVER@sindb1>
    

2.2. Execute dbv to verify the segment.
[oracle@sinh1 sindb1]$ dbv userid=silver/oracle segment_id=4.4.275 FEEDBACK=1000

DBVERIFY: Release 11.1.0.6.0 - Production on Mon Aug 17 09:40:19 2009

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

DBVERIFY - Verification starting : SEGMENT_ID = 4.4.275
.

DBVERIFY - Verification complete

Total Pages Examined         : 256
Total Pages Processed (Data) : 155
Total Pages Failing   (Data) : 0
Total Pages Processed (Index): 0
Total Pages Failing   (Index): 0
Total Pages Processed (Other): 11
Total Pages Processed (Seg)  : 1
Total Pages Failing   (Seg)  : 0
Total Pages Empty            : 89
Total Pages Marked Corrupt   : 0
Total Pages Influx           : 0
Total Pages Encrypted        : 0
Highest block SCN            : 251928 (0.251928)
[oracle@sinh1 sindb1]$
    

No comments:

Post a Comment