dbv checks database files in batches

dbv checks database files in batches

1. Usage of dbv

DBVERIFY(DBV): A tool that can only be used to check mirror copies of Oracle data files or rman backups. It cannot verify redo log files and control files, archive logs , and rman backup sets. It is used to check whether the data file is damaged, whether there are logical bad blocks and what type of data is contained in the data file. Data files can be ONLINE or OFFLINE.

C:\>dbv help=y

DBVERIFY: Release 12.2.0.1.0 - Production on 星期四 6月 15 08:32:17 2023

Copyright (c) 1982, 2017, Oracle and/or its affiliates.  All rights reserved.

关键字      说明                    (默认值)
----------------------------------------------------
FILE        要验证的文件                 (无)
START       起始块                    (文件的第一个块)
END         结束块                      (文件的最后一个块)
BLOCKSIZE   逻辑块大小             (8192)
LOGFILE     输出日志                     (无)
FEEDBACK    显示进度               (0)
PARFILE     参数文件                 (无)
USERID      用户名/口令              (无)
SEGMENT_ID  段 ID (tsn.relfile.block) (无)
HIGH_SCN    要验证的最高块 SCN    (无)
            (scn_wrap.scn_base 或 scn)

The result after checking SYSAUX01.DBF:

D:\dbvcheck>more dbv_SYSAUX01.DBF.log

DBVERIFY: Release 12.2.0.1.0 - Production on 星期四 6月 15 08:25:33 2023

Copyright (c) 1982, 2017, Oracle and/or its affiliates.  All rights reserved.


DBVERIFY - 开始验证: FILE = C:\APP\VIRTUAL\ORADATA\SYSAUX01.DBF

DBVERIFY - 验证完成

检查的页总数: 199680
处理的页总数 (数据): 58313
失败的页总数 (数据): 0
处理的页总数 (索引): 74061
失败的页总数 (索引): 0
处理的总页数 (Lob)  : 25976
失败的总页数 (Lob)  : 0
处理的页总数 (其他): 21674
处理的总页数 (段)  : 0
失败的总页数 (段)  : 0
空的页总数: 19656
标记为损坏的总页数: 0
流入的页总数: 0
加密的总页数        : 0
最高块 SCN            : 13059563885451 (3040.2863305611)

2. Batch check all data files

The checked log results are placed in the d:\dbvcheck directory

select 'dbv file = ' || name || ' blocksize=8192 logfile=d:\dbvcheck\dbv_' ||
       to_char(sysdate, 'yyyymmdd') || '_' ||
       substr(name, instr(name, '\', -1, 1) + 1) || '.log'
  from v$datafile t ;

substr(name, instr(name, '', -1, 1) + 1)
is to obtain the data file name, excluding the path

SQL results can be made into a batch file to fully check all data files in the database.

Guess you like

Origin blog.csdn.net/qq_39065491/article/details/131220102