One
of the great new features of RMAN in Oracle 11g is the new tool named Data
Recovery  Advisor. This tool automates the diagnose of the data failure and
corruption, advises the recovery steps and performs automatic recovery of the
database failure.  This tool could be used from GUI as well as from CLI
.

  The Data
Recovery Advisor automatically diagnoses corruption or loss of persistent data
on disk, determines the appropriate repair options, and executes repairs at the
user’s request. This reduces the complexity of recovery process, thereby
reducing the Mean Time To Recover (MTTR).
            List
Failure
      
# lists the results of previously executed failure assessments. Revalidates   existing failures and closes them, if possible
.
          
          Advise
Failure  
# presents manual and automatic repair
options
           
           Repair
Failure
  
# automatically fix failures by running optimal repair option, suggested by
ADVISE FAILURE. Revalidates existing failures when completed
.
            
           Change
Failure
 #
enables you to change the status of failures.



Scenario based explanation


Step:1 Tablespace creation

create tablespace tbs1 datafile ‘/u01/app/oracle/product/11.2.0.3/oradata/prod/tbs1.dbf’
size 5m;
create tablespace tbs2 datafile ‘/u01/app/oracle/product/11.2.0.3/oradata/prod/tbs2.dbf’
size 5m;

 Step:2 creating table in the tablespace

create table tab1 tablespace tbs4 as select * from scott.emp;
create table tab2 tablespace tbs5 as select * from scott.emp;
commit;
alter system switch logfile;

 Step:3 checking block in the tablespace

select segment_name , header_file , header_block     
from dba_segments

where segment_name =
‘TAB1
‘;
Step:4 taking backup using rman

backup database plus archivelog;

Step:5 checking through DBV  tool

cd $ORACLE_BASE/oradata/prod
dbv file=tbs1.dbf  blocksize=8192

Step:6 corrupt the datafile

dd of=tbs1.dbf bs=8192 conv=notrunc
seek=130 <<
EOF

Step: 7 once again check using dbv Tool

dbv file=tbs1.dbf  blocksize=8192 

Step:8 remove the datafile in os
level

cd $ORACLE_BASE/oradata/prod/

rm tbs2.dbf

Step:9 flush the buffer
alter system flush buffer_cache;

Step:10 We are facing the issue here

select count(*) from tab1;

Step:11 shutdown database

Step:12 startup mount

Step:13 alter database datafile  7 offline;

Step:14 alter database open;

Setp:15 checking the corruption

 select * from v$database_block_corruption;
 select * from V$recover_file;

Step:15 list failure;

Step:16 advise failure all;

Step:17 repair failure preview;

Step:18 repair failure;

Step:19  select * from v$database_block_corruption;

Step:20 select * from tab1 and tab2;


      
Recommended Posts

Start typing and press Enter to search