In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces "how to use DBV". In daily operation, I believe many people have doubts about how to use DBV. Xiaobian consulted all kinds of materials and sorted out simple and easy operation methods. I hope to help you answer the doubts about "how to use DBV"! Next, please follow the small series to learn together!
I. Introduction
The main purpose of the dbverify tool is to examine the physical structure of the data file, including whether the data file is corrupt, whether there are logically bad blocks, and what type of data is contained in the data file.
II. Principle
DBV checks to ensure Oracle data files:
The data file has a valid block header
Each data block has a special "wrapper" identification block in the file. This "wrapper" is used to verify correctness.
Data (tables) and index blocks are internally consistent
Since 8.1.6: Internal consistency of multiblock types (e.g. rollback segment blocks)
III. DBV limitation
DBV can only detect if it can be 'ANALYZE TABLE.. VALIDATE STRUCTURE CASCADE'command detects blocks like index, table errors, etc.
This tool can only be used for data files. It cannot be used to validate archive files or control files.
You can use DBV to verify Automatic Storage Management (ASM) files.
However, the database must be open, select username already used
For example: dbv file=+DG1/ORCL/datafile/system01.dbf userid=system/sys
DBV checks username/password for ASM file management, which is impossible when the database is not open.
In most versions of UNIX, DBV is based on file extensions. DBV requires datafile to have an extension
If the bare device doesn't have an extension, you can create a link and then check dbv again.
For example: ln -s /dev/rdsk/mydevice /tmp/mydevice.dbf
For the original device, you should use the "END" parameter to avoid running the end of the file space.
For example: "dbv FILE=/dev/rdsk/r1.dbf END="
Find the END value with file#=5
select BYTES/8192 from v$datafile where FILE#=5;BYTES/8192----------5120
dbv file=/dev/rdsk/r1.dbf blocksize=8192 END=5120
DBV may fail to scan data files larger than 2GB while reporting "dbv-100." If you get dbv-100 error first check the file size.
DBV since 8.1.6 False errors are reported based on rollback segment blocks if migrated from Oracle 7. See Error: 1359160 and Note: 118008.1.
DBV only checks a block in isolation -it does not know if the block is part of an existing object or not.
DBV only checks the block; it doesn't know if the block is part of an existing object.
DBV is not available on SCO Unix, see also Bug:814249
DBV is backward compatible and not available for higher versions
IV. DBV Example
Verify files on ASM
Query Data File Path
select file_name from dba_data_Files;
dbv check files on ASM, note adding userid parameter
[oracle@rac2 ~]$ dbv file='+DATA/anqing/datafile/undotbs02.dbf' userid=sys/oracle
Verify normal datafile
Datafile validation without instance startup
In this case, db has not started, to enter the data file storage directory after running the command, otherwise it will report that the data file can not be found.
dbv file=undotbs01.dbf
DB open status, verify specified segment
You can obtain three fields: tablespace_id,header_file, header_block from sys_dba_segs table. They correspond to tsn, relfile,
block.select tablespace_id,header_file, header_block from sys_dba_segs where segment_name = 'TA';TABLESPACE_ID HEADER_FILE HEADER_BLOCK------------- ----------- ------------ 0 1 71513
Syntax: dbv USERID=username/password SEGMENT_ID=tsn.relfile.block
[oracle@rac2 ~]$ dbv segment_id=0.1.71513 userid=system/oracle
Note: This method requires that the database is open.
Verify Data Copy
Because dbv can verify a data file even when the instance is down, dbv can also verify copies of the data file. This copy refers to the data file copied by the COPY command of RMAN or the operating system command cp, not the backup set format generated by RMAN.
Compare copy of datafile by comparing the results of 2 dbvs
[oracle@node1 ~]$ dbv file='/oradata/orcl/test01.dbf' userid=sys/oracleDBVERIFY: Release 11.2.0.4.0 - Production on Wed Aug 17 15:15:52 2016Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.DBVERIFY - Verification starting: FILE = /oradata/orcl/test01.dbfDBVERIFY - Verification complete Total Pages Examined Total Pages Processed (Data) Total Pages Processed (Data): 261936Total Pages Failing (Data) Total Pages Failed (Data): 0Total Pages Processed (Index) Total Pages Processed (Index): 0Total Pages Failing (Index) Total Pages Processed (Other): 876Total Pages Processed (Seg) Total Pages Processed (Seg) : 3Total Pages Failing (Seg)Total Pages (Segments) Failed: 0Total Pages Empty Total Pages Empty : 392545Total Pages Marked Corrupt Total Pages Marked Corrupt : 0Total Pages Influx Total Pages Influx Total Pages Encrypted Total Pages Encrypted : 0Highest block SCN Highest block SCN : 117357549 (0.117357549) At this point, the study of "how to use DBV" is over. I hope to solve everyone's doubts. Theory and practice can better match to help everyone learn, go and try it! If you want to continue learning more relevant knowledge, please continue to pay attention to the website, Xiaobian will continue to strive to bring more practical articles for everyone!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.