April 07, 2012

Recover database & Determine status dafile

If you are in the middle of recovery database and if your concern only to make your database up again as soon as possible, after issuing command RECOVER DATABASE and applying the archive log one by one, as long as there is no datafile with fuzzy status the you can open your database again, here is the way to determine it

Please run this query:

alter session set nls_date_format = 'DD-MON-YYYY HH24:MI:SS';
set feedback on
set heading on
set pagesize 1000
set linesize 200
column checkpoint_change# format 999999999999999999999

select status, checkpoint_change#, fuzzy,
to_char(checkpoint_time, 'DD-MON-YYYY HH24:MI:SS') as checkpoint_time,
count(*)
from v$datafile_header
group by status, checkpoint_change#, fuzzy, checkpoint_time
order by status, checkpoint_change#, fuzzy, checkpoint_time;



select fuzzy,count(fuzzy) as Total_Fuzzy from v$datafile_header
group by fuzzy;

No comments:

Post a Comment