Tuesday, June 12, 2012

Another useful case of using bbed

Well, there was one oracle db of version 10.2.0.5.1  without any backup. Suddenly, all members of all redo log files were lost. It was extrimely important to recover the database to operable state.

Possible variants for recover are:
1. Using one of the following parameters or its combination

_corrupted_rollback_segments
_allow_resetlogs_corruption
_allow_read_only_corruption

2. Using bbed

Let discuss about second variant.

I forgot to say there ware dozens of uncommitted transactions at the moment of crashing.

So,

a) Make copy of  the database remains to the safe place.

b) using bbed, write to the headers of each datafile the following (example of the system tablespace)

m /x 0000 dba 1,1 offset 138
m /x 0000 dba 1,1 offset 16
m /x 01 dba 1,1 offset 15

c) recreate controlfile using trace script with resetlogs option

d) recover database until cancel
cancel
alter database open resetlogs ;

e) at this point the database can open, but in my case there were lots of ora-00600 [2662] errors, for example

ORA-00600: internal error code, arguments: [2662], [291], [3742542507], [291], [3742542553], [30094534]

It testifyed the presense of data blocks in the database with scn higher then scn of resetlog operation. In this case convert 6th argument to DBA, access the block and correct right scn (change 5th to 3th) using bbed, for example

m /x 13 dba 8,65 offset 16382
m /x 9d dba 8,65 offset 16383
m /x 13 dba 8,65 offset 8
m /x 9d dba 8,65 offset 9

Repeat all steps again, starting with point (b)

f) And finally, the database was opened. Of couse, I had made backup of the data, using transportable tablespaces.

Today the db works without issues.

That's all