Query Regarding Rman Recovery [message #485830] |
Fri, 10 December 2010 06:42 |
chetanaZ
Messages: 132 Registered: October 2009 Location: UK
|
Senior Member |
|
|
Hi,
Following is my backup script
run{
allocate channel ch1 device type disk;
crosscheck archivelog all;
delete expired archivelog all;
backup database plus archivelog;
delete noprompt obsolete;
release channel ch1;
As I observed and understood the script when executed performs following steps
step 1: switches logfile - generates archivelog - backs it up in separate backup piece
step 2: backs up data files
step 3: backs up controlfile and spfile
step 4: switches logfile again - generates archivelog - backs up all archivelogs generated after step 1 till the recent one
During recovery after this backup, I observed that the backup or archivelog in step 1 above is not used at all
I was assuming the data in redo log is written to archivelogs (offline redo) but then why it is not used for the recovery afterwards?
Please refer following case :
insert into t values(1);
commit;
now the above data is written to redolog and may not be written to datafile
The backup starts, logfile is switched and the data is written to archivelog say db_1.arc
later backup of datafiles is generated and then again another archivelogs ae backed say db_2.arc, db_3.arc
after this the recovery uses only the backup of datafiles, db_2.arc, db_3.arc
So where is my transaction written to redo -insert into t values(1)?
I was expecting it to be in db_1.arc which is not used for recovery
However after recovery I found that the transcation is recovered all the time
Does it mean during step 1, the implicit log switch forces the data to be wriiten to datafile which is then backed up in step 2?
and since it is written to datafile, the archivelog or its' backup in step 1 isn't needed anymore?
I know my query may sound verbose or like an essay but I genuinely need advice on this
Thanks and Regards,
Chetanaz
|
|
|
Re: Query Regarding Rman Recovery [message #485831 is a reply to message #485830] |
Fri, 10 December 2010 06:49 |
John Watson
Messages: 8960 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
You are almost correct. The log switch does NOT force a write to te datafiles. Way back in relase 8.0, it did; but from release 8i onwards, a log switch does not force a checkpoint. But when RMAN backs up a datafile, it will force a checkpoint of the datafile: all dirty buffers for that file are written to the file before it is backed up. That is why you don;t need db_1.arc.
|
|
|
|