Home » RDBMS Server » Backup & Recovery » Recover database while archivelogs are purged (Oracle 9.2.0.6.0 on Windows)
Recover database while archivelogs are purged [message #431203] Mon, 16 November 2009 03:33 Go to next message
chetanaZ
Messages: 132
Registered: October 2009
Location: UK
Senior Member
Hi,

In a Test environment I want to take weekly backup of whole database (rman backup)

However because of the space coonstraints we are unable to keep archivelogs generated time to time and would schedule a batch job to purge archive logs using following rman script

rman> delete archivelog all;


My question is how I can take backup of database in this case?

My backup script would be (roughly) like this

backup database
sql 'alter system archive log current';
backup archivelogs;


if I have archivelog purge schedule which purges archivelogs at every 2 hours
1) can i disable the schedule at 10:00
2) start the backup at 10:00
3) after backup finished at 10:30 again start the purge routine at 10:31
4)And if needed I can recover the database till 10:30 from the backup only?


Sorry if I am not clear from above

To make things clearer
10:01 arc01 is created
10:03 arc03 is created
10:05 arc05 is created
10:07 all logs are purged and purge routine is disabled now
10:07 backup starts and continies till 10:30
This backup archives current log and backups archivelogs available between 10:07 till 10:30

now the purge starts again at 10:30 as soon as backup finishes

next day i want to restore and recover database till 10:30 of the last day

Is that possible if I have only the archivelogs (10:07 - 10:30) in the backup sets?

Thanks and Regards,
Chetana

Re: Recover database while archivelogs are purged [message #431238 is a reply to message #431203] Mon, 16 November 2009 05:11 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
As long as you are doing the final switch of the current redo log and backing up the archivelogs, you should be OK restoring to 10:30 in your example.

You could actually simply your backup command to:

RMAN> backup database plus archivelog delete input;
Re: Recover database while archivelogs are purged [message #431249 is a reply to message #431203] Mon, 16 November 2009 05:33 Go to previous messageGo to next message
chetanaZ
Messages: 132
Registered: October 2009
Location: UK
Senior Member
Thanks Ebrian,

I got excatly what I want from your first statement

"As long as you are doing the final switch of the current redo log and backing up the archivelogs, you should be OK restoring to 10:30 in your example."

very much clear

However if I am not explicitly switching current redo log using
sql 'alter system archive log current'


then will the following command switch it implicitly before it backs up the archivelogs.?

RMAN> backup database plus archivelog delete input;


Also I have one more query in relation to this :

If the archivelogs are in the backup sets but not at archive_log_dest will 'SQL+ Recover' command restores it from the backup set or only RMAN can restore it while 'Recover Database' is issued?

I understand that SQL+ and RMAN recover commands differ here.

Thanks and Regards,
Chetana
Re: Recover database while archivelogs are purged [message #431252 is a reply to message #431249] Mon, 16 November 2009 05:38 Go to previous messageGo to next message
Michel Cadot
Messages: 68728
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Quote:
However if I am not explicitly switching current redo log using
sql 'alter system archive log current'

This statement first swicthes log file before archiving it.

Quote:
If the archivelogs are in the backup sets but not at archive_log_dest will 'SQL+ Recover' command restores it from the backup set or only RMAN can restore it while 'Recover Database' is issued?

SQL*Plus does not restore anything, only RMAN can do it (for a RMAN backup of course).

Regards
Michel
Re: Recover database while archivelogs are purged [message #431258 is a reply to message #431203] Mon, 16 November 2009 06:26 Go to previous messageGo to next message
chetanaZ
Messages: 132
Registered: October 2009
Location: UK
Senior Member
Thanks Michel,

There is some confusion on my side

I agree that that the following command will switch the log (and archives)
sql 'alter system archive log current'


My question was about following command
backup database plus archivelog delete input;


Will it also switch the log before backing it up?

Also thanks for confirming my understanding regarding 'SQL+ Recover'

Thanks and Regards,
Chetana
Re: Recover database while archivelogs are purged [message #431265 is a reply to message #431258] Mon, 16 November 2009 06:51 Go to previous messageGo to next message
Michel Cadot
Messages: 68728
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
From documentation, (Recovery Manager Reference, BACKUP page, sorry can't access OTN for the moment so can't give you the link):
Quote:
When you specify PLUS ARCHIVELOG, RMAN performs these steps:

1. Runs an ALTER SYSTEM ARCHIVE LOG CURRENT statement.
2. Runs the BACKUP ARCHIVELOG ALL command. Note that if backup optimization is enabled, then RMAN only backs up logs that have not yet been backed up.
3. Backs up the files specified in the BACKUP command.
4. Runs an ALTER SYSTEM ARCHIVE LOG CURRENT statement.
5. Backs up any remaining archived redo logs.


Regards
Michel
Re: Recover database while archivelogs are purged [message #431277 is a reply to message #431203] Mon, 16 November 2009 07:24 Go to previous message
chetanaZ
Messages: 132
Registered: October 2009
Location: UK
Senior Member
Many Thanks Michel

It's too clear for me now

Thanks and Regards,
Chetana
Previous Topic: Oracle Backup Views
Next Topic: Hot Backups
Goto Forum:
  


Current Time: Sun Dec 22 17:56:14 CST 2024