Zahir, March 23, 2011 - 8:46 pm UTC
Thanks very much , Tom.
Laura Sallwasser, June 29, 2011 - 3:45 pm UTC
Hello Tom:
The order provided in the post is:
1. switch logs files
2. archive log all
3. backup archivelogs
In my backups, RMAN automatically issues the command "alter system archive log current" prior to the "backup archivelog" command. If I add SQL command "archive log all" command before RMAN backs up the archived logs, is the effect (a consistent set of data) the same?
Thank you,
Laura Sallwasser
June 29, 2011 - 5:34 pm UTC
you need to make sure your backup set includes all of the datafiles AND all of the redo generated during the backup itself. if you have that - you have the set of files you need to make your backup consistent.
by doing the switching and archive log all - and then backing the archives up - AFTER backing up the datafiles - you will have all of the redo generated during the backup.
mfz, June 30, 2011 - 9:21 am UTC
<quote>
....
by doing the switching and archive log all - and then backing the archives up -
AFTER backing up the datafiles - you will have all of the redo generated during the backup.
</quote>
So , is there any differnece between script1 and script2 in terms of how logs are backed up.?
Script 1
--------
run{
sql 'alter system switch logfile';
sql 'alter system archive log current';
backup database plus archivelog ;
}
Script 2
---------
run{
backup database ;
sql 'alter system switch logfile';
sql 'alter system archive log current';
backup archivelog all ;
}
July 01, 2011 - 8:48 am UTC
yes there is. you want to backup database - then switch and archive (in order to get the redo generated during the backup backed up as well)
Alexander, July 01, 2011 - 9:19 am UTC
Tom, isn't that overkill?
Why can you not simply backup the database plus archivelogs (which as of 10g automatically did a log flush for you) and be done with it?
Also, I've had the discussion with other dbas before about the issue described in the 3) of the original question. Isn't the question more of how much data would be lost not how much time has elapsed. Meaning, if archivelogs are not being generated, that means little changes are happening in the database. So even in this hypothetical crash, you'd hardly lose anything. If the system is critical enough that that is unacceptable, you should be looking at Data Guard or something of that nature (as opposed to attempted to backup archivelogs off the machine every 30 seconds or whatever). Am I wrong to think this?
July 01, 2011 - 9:32 am UTC
they are asking about what is the right series of steps - what needs to happen is
backup
switch log
archive all
backup archive.
if the logical equivalent of that is not in your backups - you cannot restore your hot backup.
So
even in this hypothetical crash, you'd hardly lose anything.
you'd lose everything - because you cannot restore what you have. You need to have a hot backup PLUS all of the redo generated during that backup in order to restore anything.
Alexander, July 01, 2011 - 10:15 am UTC
What I don't understand is why doesn't backing up the database plus archivelogs accomplish backing up the redo generated during the backup. It does do the archivelogs after the datafiles does it not?
July 01, 2011 - 11:55 am UTC
depends on the tool being used. As long as the tool you are using does the switch and the archive log all - before backing up archives, you have what you need.
That is all I've been saying - you need
a) a hot backup
b) plus all redo generated during the backup
in order to have a consistent backup you can restore and recover with.
http://docs.oracle.com/docs/cd/E11882_01/backup.112/e10642/rcmbckba.htm#sthref836 if you use the " BACKUP ... PLUS ARCHIVELOG " commands - you get everything you need. You'll have a backup that can be restored.
Alexander, July 01, 2011 - 12:05 pm UTC
Ok, but above to mfz's reply you said
"yes there is. you want to backup database - then switch and archive (in order to get the redo generated during the backup backed up as well)"
In response to a script that had backup + archlogs.
This may sound like I'm being pedantic or argumentative, I hope it does not. I just want to be sure I understand it right so all my backups aren't worthless. Kind of important :)
July 01, 2011 - 12:19 pm UTC
with rman, the backup plus archivelog would get everything you need, correct.
mfz, July 05, 2011 - 2:47 pm UTC
I am sorry . I am confused as mentioned by Alexander in the earlier post .
As I understand from your response to my ( mfz) question, there is a difference between the backups procedures from script 1 and script 2 .
But that response seems contradictory to other responses for Alexendar's question .
The backups taken by both methods are restorable . Then what will backups generated by script2 will have that backups generated by script1 does not.
If the difference is redo during the backup , would not be archived as log switch happened prior to the backup command .
Sorry .. Not being clear .
July 05, 2011 - 4:29 pm UTC
just read the link provided above. Many of the rman commands do multiple things
According Question of Laura
Peyman, April 21, 2015 - 10:32 am UTC
Hi Tom,
I think you misunderstood the question of Laura. If one issues "BACKUP ARCHIVELOG ALL" the command "ALTER SYSTEM ARCHIVE LOG CURRENT" will be executed implicitly!!!! Please try it. Therefore you do not need to archive the Logs again, as it will be done always automatically.
However, this is not mentoined in the Documentation. One can find there only about the steps of "BACKUP ... PLUS ARCHIVELOG" that:
1. Runs the ALTER SYSTEM ARCHIVE LOG CURRENT statement.
2. Runs BACKUP ARCHIVELOG ALL .....
But that is not correct, because (as I wrote) the first step is allways included in the second one.
Thank you for your answer.