Methods for detecting bad blocks of Oracle databases _oracle

Source: Internet
Author: User

Methods for detecting bad blocks of Oracle databases:

1, use DBV (DB File Verify) tool;

2, use Rman (Recovery Manager) tool;

DBV (DB File Verify) Tool:

External command, physical media data structure integrity check;

It can only be used for data files (offline or online) and does not support block checking of control files and redo log files;

You can also verify the backup file (Rman Copy command backup or operating system CP command Backup);

Enter the letter, and then execute the following script:

D:\APP\ADMINISTRATOR\ORADATA\ORCL>DBV File=zl9mtlbase. DBF blocksize=8192;

RMAN (Recovery Manager) Tool:

Logical data structure integrity check;

When using Recovery Manager to scan for bad blocks and backups online, the database needs to run in Archive mode (archive log), otherwise it can only be done if the database is not open (mount);

Rman>backup Check logical validate datafile N;

The above command checks to see if the data file contains bad blocks and does not produce the actual backup output.

And when the actual database backup is performed using Recovery Manager, a bad block check is also performed.

Direct use of the Rman command: Backup validate check logical database;

It is more convenient to combine the v$database_block_corruption view.

1), Rman Target/nocatalog

2), rman> spool log to ' D:/dbbak/rmanlog.log ';---Specify output RMAN log file

Rman> Run {
Allocate channel D1 type disk;
Allocate channel D2 type disk;
Allocate channel D3 type disk;
Allocate channel D4 type disk;
Backup validate check logical database;

3), select * from V$database_block_corruption;

4) 、--If v$database_block_corruption contains rows Please run this query to find the objects that contains the corrupted B Locks

SELECT E.owner, E.segment_type, E.segment_name, E.partition_name, c.file#, Greatest (e.block_id, c.block#) Corr_start_ block#, least (e.block_id + e.blocks-1, c.block# + c.blocks-1) corr_end_block#, least (e.block_id + e.blocks-1, C.bloc k# + c.blocks-1)-Greatest (e.block_id, c.block#) + 1 blocks_corrupted, null description from Dba_extents E, v$database_ Block_corruption c WHERE e.file_id = c.file# and e.block_id <= c.block# + c.blocks-1 and e.block_id + e.blocks-1 &G t;= c.block# UNION SELECT s.owner, S.segment_type, S.segment_name, S.partition_name, c.file#, Header_block Corr_start_ block#, Header_block corr_end_block#, 1 blocks_corrupted, ' Segment header ' description from dba_segments s, V$DATABASE_BL Ock_corruption c WHERE s.header_file = c.file# and s.header_block between c.block# and c.block# + c.blocks-1 UNION Selec T null owner, NULL segment_type, NULL segment_name, null Partition_name, c.file#, Greatest (f.block_id, c.block#) Corr_star t_block#, least (f.block_id + F.BLOcks-1, c.block# + c.blocks-1) corr_end_block#, least (f.block_id + f.blocks-1, c.block# + c.blocks-1)-Greatest (f block_id, c.block#) + 1 blocks_corrupted, ' free blocks ' description from Dba_free_space F, v$database_block_corruption c W Here f.file_id = c.file# and f.block_id <= c.block# + c.blocks-1 and f.block_id + f.blocks-1 >= c.block# order b  Y file#, corr_start_block#;

5),

SELECT Tablespace_name, Segment_type, owner, segment_name from
dba_extents
WHERE file_id = &fileid
and &blockid between block_id and block_id + blocks-1;

Quick identification in alarm log:

When you encounter a bad block problem, the database's unusual performance is usually:

Report ORA-01578 error.

Report ORA-1110 error.

Report ORA-00600 error. Where the first parameter is 2000-8000,cache layer 2000–4000,transaction layer 4000–6000,data 6000-8000.

The corrupt block dba:0x160c5958 appears in the trace file. Found Failed to parse object.

Background processes, such as DBWR,LGWR, appear for a long time abnormally waiting, such as LGWR wait for redo copy.

The above is a small set to introduce the detection of Oracle Database bad block method, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.