How to Use RMAN to identify corrupted objects in the database

Source: Internet
Author: User
How to Use RMAN to identify corrupted segments in the database. Solution: Step 1: identify bad blocks and execute the following RMAN command so that all bad block information is recorded in v $ databas

How to Use RMAN to identify corrupted segments in the database. Solution: Step 1: identify bad blocks and execute the following RMAN command so that all bad block information is recorded in v $ databas

How to Use RMAN to identify corrupted segments in the database.

Solution:

Step 1: identify bad Blocks

Run the following RMAN command to record all bad block information in the v $ database_block_partition uption View:

RMAN> backup validate check logical database;

Note:

This command only checks the Bad blocks of the database and does not actually perform backup. The backup clause can be omitted from 11 GB and the "validate check logical database" command can be used directly ".

If the command fails due to a missing file, you can add the 'skip INACCESSIBLE 'clause to avoid this problem.

To speed up the check, you can set PARALLELISM to specify multiple channels:

RMAN> configure device type disk parallelism 4;
RMAN> backup validate check logical database;

OR

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;
}

Output

Bad block information is recorded in view V $ database_block_partition uption. 11g RMAN will generate a trace file to describe the bad block information in detail:

Rman validate screen output:

File Status Marked upt Empty Blocks Examined High SCN
-------------------------------------------------------------
6 failures 0 501 640 1950088
File Name:/Oracle/dbs/users. dbf
Block Type Blocks Failing Blocks Processed
----------------------------------------
Data 9 9 9
Index 0 0
Other 0 130

Validate found one or more than upt blocks
See trace file/oracle/log/diag/rdbms/orcl/trace/orcl_ora_282.16.trc for details
Finished validate

The Trace file outputs bad block information. This example describes two bad blocks, one physical bad block (file 6 block 9) and one logical bad block (file 6 block 10 ):


Corrupt block relative dba: 0x01000009 (file 4, block 9)
Bad check value found during validation
Data in bad block:
Type: 16 format: 2 rdba: 0x01000009
Last change scn: 0x0000.00000000 seq: 0xff flg: 0x04
Spare1: 0x0 spare2: 0x0 spare3: 0x0
Consistency value in tail: 0x000010ff
Check value in block header: 0xb4e0
Computed block checksum: 0xa800
Reread of blocknum = 9, file =/oracle/dbs/users. dbf found same encrypt upt data

Block Checking: DBA = 25165834, Block Type = KTB-managed data block
Data header at 0x2b2deb49e07c
Kdbchk: fsbo (144) wrong, (hsz 78)
Error backing up file 6, block 10: logical upload uption

Bad block information is recorded in view V $ database_block_partition uption:

SQL> select * from V $ DATABASE_BLOCK_CORRUPTION;

FILE # BLOCK # BLOCKS upload uption_change # upload uptio
------------------------------------------------------------------------
6 10 1 8183236781662 LOGICAL
6 42 1 0 FRACTURED
6 34 2 0 CHECKSUM
6 50 1 8183236781952 LOGICAL
6 26 4 0 FRACTURED

5 rows selected.

Note:
• The check logical option checks both physical and LOGICAL Bad blocks.
• The alert Log updates the following information when a logical bad block is found:

Error backing up file , Block : Logical upload uption

A trace file is generated at 11 GB to describe the bad block information.
• The alert Log also updates the following information when a physical bad block is found:

Corrupt block relative dba: 0x01000009 (file 4, block 9)
Bad check value found during validation
Data in bad block:
Type: 16 format: 2 rdba: 0x01000009
Last change scn: 0x0000.00000000 seq: 0xff flg: 0x04
Spare1: 0x0 spare2: 0x0 spare3: 0x0
Consistency value in tail: 0x000010ff
Check value in block header: 0xb4e0
Computed block checksum: 0xa800
Reread of blocknum = 9, file =/oracle/dbs/users. dbf found same encrypt upt data
• Check a single data file or a specific data file by running the "check logical validate datafile 1, 2" command ".
• To monitor the running Progress of the VALIDATE command, run the following query:

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.