Tag Archives: rman advisory

Identify the block Corruption using RMAN advisor

ORA-01578: ORACLE data block corrupted (file # 9, block # 62904)

RMAN validate command is used to identified the logical and physical corruption in the oracle database. You can also check ora-01578 error in alert log file. If any of your database block is corrupted you get message in alert log file.

Step1.
Check the alert log file it will give you the error as follows:

Error:
ORA-01578: ORACLE data block corrupted (file # 9, block # 62904)
ORA-01110: data file 9: 'E:\ORACLE\ORADATA\IC\ICTABLES05.DBF'

Step2.
For validate that any other block is corrupted except mentioned in the alert log file. You need to run the following command from the RMAN prompt. It will scan all datafiles and give you result in V$DATABASE_BLOCK_CORRUPTION view of Oracle.

C:\Users\sunny>rman
Recovery Manager: Release 12.1.0.1.0 - Production on Thu Apr 2 21:13:35 2015
Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.
RMAN> connect target sys
target database Password:
connected to target database: ORCL12C (DBID=704940817)
RMAN>BACKUP VALIDATE CHECK LOGICAL DATABASE FILESPERSET=10;

This command start checking all the datafiles in oracle database and give you the result in log file as well as you can check at last V$DATABASE_BLOCK_CORRUPTION view from SQL PLUS prompt.

select * from V$DATABASE_BLOCK_CORRUPTION;
FILE#  BLOCK#       BLOCKS   CORRUPTION_CHANGE#   CORRUPTION
---    ----------   -------  ------------------   ---------
4      491669       1            0                CORRUPT

Step 3:
Get file# and block# corruption from above command. you can get the object name and object_type which is having issue with following commands

select substrb(dbe.owner,1,15) DB_OWNER,
substrb(dbe.segment_name,1,30 ) OBJ_NAME,
substrb(dbe.partition_name,1,20 ) PART_NAME,
substrb(dbe.segment_type,1,9) TYPE_object,
substrb(dbe.tablespace_name,1,15) TS_NAME
from dba_extents dbe
where dbe.file_id = 4
and 491669 between dbe.block_id and dbe.block_id+dbe.blocks-1
/

DB_OWNER   OBJ_NAME       PART_NAME   TYPE_OBJECT    TS_NAME
--------   ---------------  ---------   -------- ---------
MANA       TAXINQUIRY_LOG               INDEX          USERS

Solution:
If you got OBJECT TYPE as INDEX. You can get the DDL of the index and drop it and create it again will solve the problem.

alter index index_name rebuild;

If OBJECT_TYPE as table then you try to recover with RMAN command and you can try to create copy of table to save data.

If no row return from upper query then follow the following link: https://smarttechways.com/2016/12/14/fractured-block-in-oracle

create table tablename_new as select * from table_name;

RMAN Advisory

You can check failure with RMAN Advisory, it will give you clear picture that you have available backup which can help to repair that block. Following command present in Oracle 11g.

1. List failure
2. Advise failure
For More Detail:
https://smarttechways.com/2013/05/25/rman-advisor-on-11g-feature-in-oracle/

List Failure: command show you the corrupted block information
Advise Failure: command give you the suggestion for recovery if any backup is available.

Example for RMAN Advisory commands:

RMAN> list failure;                                                             
using target database control file instead of recovery catalog
List of Database Failures
=========================  

Failure ID Priority Status Time Detected Summary
---------  -------- ------ ---- -------- --------
18822 HIGH OPEN 16-FEB-16 Datafile 2: 'E:\ORACLE\ORADATA\IC\SY
SAUX01.DBF' contains one or more corrupt blocks

RMAN> advise failure;                                                           
List of Database Failures
=========================                                                       
Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
18822      HIGH     OPEN      16-FEB-16     Datafile 2: 'E:\ORACLE\ORADATA\IC\SY
SAUX01.DBF' contains one or more corrupt blocks

analyzing automatic repair options; this may take some time
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=162 device type=DISK
analyzing automatic repair options complete

                                                                    
Mandatory Manual Actions
========================
1. No backup of block 77810 in file 2 was found. Drop and re-create the associated object (if possible), or use the DBMS_REPAIR package to repair the block corruption
2. Contact Oracle Support Services if the preceding recommendations cannot be us
ed, or if they do not fix the failures selected for repair                     
Optional Manual Actions
=======================
no manual actions available             

Automated Repair Options
========================
no automatic repair options available