DBVERIFY - Database file Verification Utility (7.3.2 - 10.2) [ID 35512.1]
一、目标
DBV checks Oracle datafiles to ensure that:
- The datafile has a valid header
- Each datablock in the file has a special "wrapper" which identifies the block - this "wrapper" is checked for correctness
- DATA (TABLE) and INDEX blocks are internally consistent
二、语法
Unix:
Any release: dbv FILE=filename [options]
("dbv help=y")
三、注意事项
For RAW devices you should use the END parameter to avoid running off the end of the Oracle file space.
eg: "dbv FILE=/dev/rdsk/r1.dbf END=
If you get the END value too high DBV can report the last page/s of the file as corrupt as these are beyond the end of the Oracle portion of the raw device.
You can find value for END from the V$DATAFILE view by dividing the BYTES value by the database block size.
Eg: To find out the END value to use for file#=5:
SVRMGRL> show parameter db_block_size
NAME TYPE VALUE
----------------------------------- ------- ------
db_block_size integer 2048
SVRMGRL> select BYTES/2048 from v$datafile where FILE#=5;
BYTES/2048
----------
5120
So the command would be:
dbv file=/dev/rdsk/r1.dbf blocksize=2048 END=5120
四、演示
oracle@test1[/oracle]$ dbv file='/dev/vgcpfdata/rlv_bosdata01' blocksize=16384
DBVERIFY: Release 10.2.0.4.0 - Production on Mon Mar 29 13:25:15 2010
Copyright (c) 1982, 2007, Oracle. All rights reserved.
DBVERIFY - Verification starting : FILE = /dev/vgcpfdata/rlv_bosdata01
Page 392961 is marked corrupt
Corrupt block relative dba: 0x0185ff01 (file 6, block 392961)
Completely zero block found during dbv:
......
Page 392976 is marked corrupt
Page 393215 is marked corrupt
Corrupt block relative dba: 0x0185ffff (file 6, block 393215)
Completely zero block found during dbv:
DBVERIFY - Verification complete
Total Pages Examined : 393215
Total Pages Processed (Data) : 12391
Total Pages Failing (Data) : 0
Total Pages Processed (Index): 1407
Total Pages Failing (Index): 0
Total Pages Processed (Other): 378589
Total Pages Processed (Seg) : 0
Total Pages Failing (Seg) : 0
Total Pages Empty : 573
Total Pages Marked Corrupt : 255
Total Pages Influx : 0
Highest block SCN : 3470761526 (2.3470761526)d
报错:Total Pages Marked Corrupt : 255
由于raw device需要指定end 参数,所以查询end参数=BYTES/16384=392960
oracle@testdb1:/oracle$ dbv file='/dev/vgcpfdata/rlv_bosdata10' blocksize=16384 end=392960
DBVERIFY: Release 10.2.0.4.0 - Production on Mon Mar 29 15:57:38 2010
Copyright (c) 1982, 2007, Oracle. All rights reserved.
DBVERIFY - Verification starting : FILE = /dev/vgcpfdata/rlv_bosdata10
DBVERIFY - Verification complete
Total Pages Examined : 392960
Total Pages Processed (Data) : 29953
Total Pages Failing (Data) : 0
Total Pages Processed (Index): 6177
Total Pages Failing (Index): 0
Total Pages Processed (Other): 5074
Total Pages Processed (Seg) : 0
Total Pages Failing (Seg) : 0
Total Pages Empty : 351756
Total Pages Marked Corrupt : 0
Total Pages Influx : 0
Highest block SCN : 3475882258 (2.3475882258)
参考文献:DBVERIFY - Database file Verification Utility (7.3.2 - 10.2) [ID 35512.1]
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9252210/viewspace-630900/ ,如需转载,请注明出处,否则将追究法律责任。