Writing About Our Experiences With Oracle Databases
Friday May 18th 2012

Latest Topics

Using current_scn for RMAN incremental ? Think again..

I am bloging about experience we had using rman incremental backup for syncing standby database. We had a standby [Read More]

Poll on Sql Plan Management

Dominic is conducting poll on SPM and Sql Profiles usage on his website. Link can be found here  I have been using SPM [Read More]

Oracle Direct connector for HDFS

Some time back oracle had announced Oracle Big Data appliance. Along with this Oracle released Big Data Connectors to [Read More]

ORA-7445 core dump [kokscold()+849] from EM 12c

The first problem reported by my EM 12c is an ORA-7445 error. After checking the alert log following is the exact [Read More]

Copying Oracle Scheduler jobs with Arguments

Oracle provides dbms_scheduler.copy_job function to copy oracle scheduler jobs which works great. But problem is that [Read More]

Physical Corruption: ORA-1578 PART-2

Recovering from physical corruption:

1. Using BMR when RMAN backups are available
When small set of blocks
are corrupted, Block Media Recovery (BMR) can be used as a recovery technique. The advantage of BMR is that it can be performed without taking the datafiles offline but the block undergoing BMR is not accessible to users. RMAN BLOCKRECOVER command is used for BMR.


1)How to identify and recover the corrupted blocks needing media recovery:
To find the corrupted blocks we can use v$database_block_corruption OR v$backup_corruption view
We can use RMAN to populate the he v$backup_corruption view, which will tell us the corruptedblocks are the datafile number on which they resides:

RMAN > backup validate database;

This command will check the datafiles for physical and logical corruption. If the backup validation discovers corrupt blocks,then RMAN updates the V$DATABASE_BLOCK_CORRUPTION and v$backup_corruption views.
Now Run :

SQL> select * from V$backup_corruption;

SQL> select * from V$database_block_corruption;

to find out the corrupted blocks.
It will give you the output like :

FILE# BLOCK BLOCKS CORRUPTION_CHANGE# MAR

15 215 1 0 YES

Now we have the list of corrupted blocks file#=15 and block#=215
We will use the following command to recover corrupted blocks:

RMAN > BLOCKRECOVER DATAFILE 15 BLOCK 215;
RMAN > BLOCKRECOVER CORRUPTION LIST;


The corrupted block will be recovered from last RMAN backup and RMAN will take care of applying archives to make the block current.


2. Using BMR when RMAN backups are not taken ?
If we have a OS level backup of corrupted datafile, it can be cataloged with RMAN to perform BMR.
Find the location of Backup of datafiles which have corruption in it.
Let us suppose the backup of corrupted datafile is at /u01/app/oracle/backup/data01.dbf

Now use the following command to catalog the backup as:
RMAN> catalog datafilecopy ‘/u01/app/oracle/backup/data01.dbf’;


Find the archive log:


RMAN will use the archive logs which are present in V$ARCHIVED_LOG, If the archivelogs are moved to some other location or they are aged out of controlfilethen they need to be cataloged as well:


RMAN> catalog archivelog ‘/u02/app/oracle/backup/archoracle_1_40.dbf’;

Once the datafiles and the required archive logs are cataloged, we can use the BMR as:


RMAN > BLOCKRECOVER datafile 15 block 215;

Restrictions on BLOCKRECOVER

1. The database needs to be in mounted or open stage.

2. Only complete media recovery of block is possible.

3. Only full backups of datafiles containing corrupted blocks can be used to perform block media recovery.

4. If the archivelogs are missing or not accessible, BMR will fail.

5. Header blocks cannot be recovered.

6. Database needs to be ARCHIVELOG mode for performing a BMR.


I will be discussing more on Recovery and data salvaging techniques under Corruption Part-3.

Share
Related Tags: ,

2 Comments for “Physical Corruption: ORA-1578 PART-2”

  • dadahong says:

    Hi, two commands inconsistent:
    RMAN > BLOCKRECOVER DATAFILE 15 BLOCK 215;
    RMAN > BLOCKRECOVER CORRUPTION LIST;

    I got syntax from other sources:
    RMAN> recover datafile 6 block 403;

    from 1Z0-053-Oracle Database 11g Administration II Exam Guide Exam(OCP), P611


Leave a Comment

*

Recent Comments

terkel had this to say

I still dont get it, so if someone get the ewallet.p12 cwallet.sso files and the connect string (simply by reading/copy Read the post

Amit had this to say

hi Bhushan, Em should be pretty easy. I will try to do it in my test setup and document it. cheers Amit Read the post

bhushan had this to say

Hey Amit, Any Document to Setup the Dataguard using EM12C? Any tips any suggestion? Regards Bhushan Read the post

More from category

Copying Oracle Scheduler jobs with Arguments

Oracle provides dbms_scheduler.copy_job function to copy oracle scheduler jobs which works great. But problem is that [Read More]

10gR2 Silent Install with 11gr2 CRS fails

I was trying to perform a 10.2 silent install with 11gR2 CRS. While doing pre-checks installer failed with following [Read More]

10.2 CRS startup issue

Today I faced a strange issue with CRS  post host reboot. CRS was not coming up and we could see following message in [Read More]

Performance Management Guide on AIX

While trying to find the amount of physical memory used by oracle process on AIX, I got reference of a document from [Read More]

Effect Of Multiple SHMMAX Settings

Last week I saw a warning message at database startup time saying: WARNING: EINVAL creating segment of size [Read More]

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 11 other subscribers

asd123