In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
DBV (DBVERIFY) is a command line tool provided by Oracle, which can check both physical and logical consistency of data files. However, this tool does not check the matching of index records and data records, which must be checked using the analyze validate structure command.
This tool has the following features:
Open the data file read-only, and the contents of the data file are not modified during the check.
You can check the data file online without shutting down the database.
You cannot check control files and log files, only data files.
This tool can check ASM files, but the database must have an Open status and a user needs to be specified through USERID, such as dbv file=+DG1/ORCL/datafile/system01.dbf userid=system/sys
In many UNIX platforms, DBV requires data files to have an extension, if there is no way to establish a link, then to the link method, and then operate on the link file, such as: ls-n / dev/rdsk/mydevice / tmp/mydevice.dbf
On some platforms, the DBV tool cannot check files that exceed 2GB. If you encounter an DBV-100 error, please check the file size first. MOS Bug 710888 describes this problem.
DBV only checks the correctness of the data block, but does not determine which object the data block belongs to.
It is recommended that you specify the END parameter for the slave device to avoid going beyond the range of the data file. For example: dbv FILE=/dev/rdsk/r1.dbf END=. The end value can be obtained by dividing the bytes field by the block size in the v$datafile view.
Parameter meaning default value FILE the data file name to check has no default value START check the first block of the starting block number data file END check the last block BLOCKSIZE block size of the last block number data file This value should be consistent with the DB_BLOCK_SIZE parameter value of the database. Default value 8192LOGFILE check result log file has no default value FEEDBAK shows progress 0PARFILE parameter filename has no default value USERID username, password has no default value SEGMENT_ID segment ID, parameter format has no default value
Examples of use:
[oracle@rhel6] $dbv file=/u01/app/oracle/oradata/test/users01.dbfDBVERIFY: Release 11.2.0.1.0-Production on Mon May 22 16:42:26 2017Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.DBVERIFY-Verification starting: FILE = / u01/app/oracle/oradata/test/users01.dbfDBVERIFY-Verification completeTotal Pages Examined: 155520Total Pages Processed (Data): 144530Total Pages Failing (Data): 0Total Pages Processed (Index): 52Total Pages Failing (Index): 0Total Pages Processed (Other): 1248Total Pages Processed (Seg): 0Total Pages Failing (Seg): 0Total Pages Empty: 9690Total Pages Marked Corrupt: 0Total Pages Influx: 0Total Pages Encrypted : 0Highest block SCN: 3559792 (0.3559792)
This tool reports using page as a unit, which has the same meaning as data block. From the above check result Total Pages Marked Corrupt: 0, you can see that there are no bad blocks in the file.
In addition to checking the data file, the tool also allows you to check individual Segment, where the parameter values are in the format
View the tsn,segfile,segblock property of the object:
Zx@TEST > select t.tspapers.headerwriting filereports.headerwriting block 2 from v$tablespace trecedence dbathing segments s 3 where s.segmentmentharmnamebooks T' 4 and t.namebooks s.tablespacerecording names; TS# HEADER_FILE HEADER_BLOCK- 4 4 45834
The feasible parameter value from the above query result is 4.4.45834. Check Segment:
[oracle@rhel6] $dbv userid=system/123456 segment_id=4.4.45834DBVERIFY: Release 11.2.0.1.0-Production on Mon May 22 20:58:33 2017Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.DBVERIFY-Verification starting: SEGMENT_ID = 4.4.45834DBVERIFY-Verification completeTotal Pages Examined: 8Total Pages Processed (Data): 5Total Pages Failing (Data): 0Total Pages Processed (Index): 0Total Pages Failing (Index): 0Total Pages Processed (Other): 2Total Pages Processed (Seg): 1Total Pages Failing (Seg): 0Total Pages Empty: 0Total Pages Marked Corrupt: 0Total Pages Influx: 0Total Pages Encrypted: 0Highest block SCN 3518579 (0.3518579)
The following artificially creates a bad block and checks it with dbv.
Create a test table
Zx@TEST > create table bbed (id number,name varchar2 (20)) tablespace users;Table created.zx@TEST > insert into bbed values (1 row created.zx@TEST > commit;Commit complete).
There are no bad blocks in the current data file
[oracle@rhel6] $dbv file=/u01/app/oracle/oradata/test/users01.dbfDBVERIFY: Release 11.2.0.1.0-Production on Mon May 22 21:03:40 2017Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.DBVERIFY-Verification starting: FILE = / u01/app/oracle/oradata/test/users01.dbfDBVERIFY-Verification completeTotal Pages Examined: 155520Total Pages Processed (Data): 66397Total Pages Failing (Data): 0Total Pages Processed (Index): 52Total Pages Failing (Index): 0Total Pages Processed (Other): 88898Total Pages Processed (Seg): 0Total Pages Failing (Seg): 0Total Pages Empty: 173Total Pages Marked Corrupt: 0Total Pages Influx: 0Total Pages Encrypted : 0Highest block SCN: 3764775 (0.3764775)
Get the storage information of the table in the file
Zx@TEST > set serveroutput onzx@TEST > declare rfno number; 2 rtype number; 3 ono number; 4 blkno number; 5 rowno number; 6 rid varchar2 (30); 7 begin 8 select rowid into rid from bbed; 9 dbms_rowid.rowid_info (ROWID_IN= > rid,RELATIVE_FNO= > rfno,BLOCK_NUMBER= > blkno,ROW_NUMBER= > rowno,ROWID_TYPE= > rtype,OBJECT_NUMBER= > ono); 10 dbms_output.put_line (rfno | |','| blkno | |', | rowno); 11 end; 12 / 4 45844 SQL procedure successfully completed.
Modify block information using bbed
[oracle@rhel6 bbed] $bbed parfile=bbed.parPassword: BBED: Release 2.0.0.0.0-Limited Production on Mon May 22 21:17:18 2017Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.*! For Oracle Internal Use only!! * BBED > set dba 4 DBA 0x0100b314 45844 BBED > find / c zhaoxu File: / u01/app/oracle/oradata/test/users01.dbf (4) Block: 45844 Offsets: 8182 to 8191 Dba:0x0100b314-- -- 7a68616f 78750106 5873 BBED > dump / v dba 4 45844 offset 8182 count 32 File: / u01/app/oracle/oradata/test/users01.dbf (4) Block: 45844 Offsets: 8182 to 8191 Dba:0x0100b314-- -7a68616f 78750106 5873 l zhaoxu..Xs BBED > modify 100 dba 4 Magi 45844 warning: contents of previous BIFILE will be lost. Proceed? (y File: / u01/app/oracle/oradata/test/users01.dbf (4) Block: 45844 Offsets: 8182 to 8191 Dba:0x0100b314---- 6468616f 78750106 5873 BBED > dump / v dba 4 dhaoxu..Xs BBED 45844 offset 8182 count 32 File: / u01/app/oracle/oradata/test/users01.dbf (4) Block: 45844 Offsets: 8182 to 8191 Dba:0x0100b314--- 6468616f 78750106 5873 l dhaoxu..Xs BBED > exit
Use dbv to check the file again
[oracle@rhel6 bbed] $dbv file=/u01/app/oracle/oradata/test/users01.dbfDBVERIFY: Release 11.2.0.1.0-Production on Mon May 22 21:18:46 2017Copyright (c) 1982, 2009, Oracle and/or its affiliates All rights reserved.DBVERIFY-Verification starting: FILE = / u01/app/oracle/oradata/test/users01.dbfPage 45844 is marked corruptCorrupt block relative dba: 0x0100b314 (file 4 Block 45844) Bad check value found during dbv: Data in bad block: type: 6 format: 2 rdba: 0x0100b314 last change scn: 0x1 flg: 0x04 spare1: 0x0 spare2: 0x0 spare3: 0x0 consistency value in tail: 0x73580601 check value in block header: 0x7c2d computed block checksum: 0x1eDBVERIFY-Verification completeTotal Pages Examined: 155520Total Pages Processed (Data): 66396Total Pages Failing (Data): 0Total Pages Processed (Index): 52Total Pages Failing (Index): 0Total Pages Processed (Other): 88898Total Pages Processed (Seg) : 0Total Pages Failing (Seg): 0Total Pages Empty: 173Total Pages Marked Corrupt: 1Total Pages Influx: 0Total Pages Encrypted: 0Highest block SCN: 3764775 (0.3764775)
Report a bad block, Total Pages Marked Corrupt: 1
Query the test table again:
Sys@TEST > select * from zx.bbed; ID NAME- 1 zhaoxu
The query is normal because the block is cached in buffer_cache and the block in the file is modified. The two blocks are now inconsistent. Empty the buffer cache and query the test table again.
Zx@TEST > alter system flush buffer_cache;System altered.zx@TEST > select * from bbed;select * from bbed * ERROR at line 1:ORA-01578: ORACLE data block corrupted (file # 4, block # 45844) ORA-01110: data file 4:'/ u01
The query reported an error ORA-01578.
To check the data files in the ASM file using dbv, you need to specify the userid parameter
[oracle@rac1] $dbv file=+DATA/orcl/datafile/users.259.925306091 userid=sys/123456DBVERIFY: Release 11.2.0.4.0-Production on Mon May 22 16:48:22 2017Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.DBVERIFY-Verification starting: FILE = + DATA/orcl/datafile/users.259.925306091DBVERIFY-Verification completeTotal Pages Examined: 640Total Pages Processed (Data): 16Total Pages Failing (Data): 0Total Pages Processed (Index): 2Total Pages Failing (Index): 0Total Pages Processed (Other): 593Total Pages Processed (Seg): 0Total Pages Failing (Seg): 0Total Pages Empty: 29Total Pages Marked Corrupt: 0Total Pages Influx: 0Total Pages Encrypted : 0Highest block SCN: 0 (0.0)
Reference: "lie Oracle RAC"
MOS documents: document ID 35512.1
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.