RE: VMWARE Snapshots to backup Oracle

  • From: D'Hooge Freek <Freek.DHooge@xxxxxxxxx>
  • To: "Mark.Bobak@xxxxxxxxxxxx" <Mark.Bobak@xxxxxxxxxxxx>, "big.dave.roberts@xxxxxxxxxxxxxx" <big.dave.roberts@xxxxxxxxxxxxxx>, oracle-l <oracle-l@xxxxxxxxxxxxx>
  • Date: Wed, 7 Jul 2010 08:59:26 +0200

Your explanation is true for conventional manual (non rman) backups.
However, when using vmware snapshots to take a backup, you can always only 
recover to the point of the last backup as all later archived redo logs will be 
lost when putting back the snapshot.

The problem with using vmware to create a consistent db backup is that you 
actually require 2 snapshots: one of the database files while in backup mode, 
and one of the archivelogs after the database has been put out of backup mode 
(and the current redolog has been archived).
But you can't combine them into one image.

The only thing I can think of is that you create 2 snapshots and when doing a 
restore, you clone the snapshots into a new guest. Then you need to copy over 
the files from the clone guest to the original. This way you would also be able 
to recover to a later point then the backup as the archived redo logs (and 
online redo logs) are not overwritten in the original guest.
However in practice I would not recommend such a method as there is a high 
change for error during the restore.

I just thought of another method, but I'm not sure it will work.
I thought that you can create "independent" disks in vmware that are not 
affected by snapshots.
If so, then you can create your controlfiles, online redologs and archived redo 
logs on such disks and during the rollback to the snapshot they will not be 
overwritten.
However, you will not have a backup of your archived redologs, nor of your 
controlfiles.


Regards,
 
Freek D'Hooge
Uptime
Oracle Database Administrator
email: freek.dhooge@xxxxxxxxx
tel +32(0)3 451 23 82
http://www.uptime.be
disclaimer: www.uptime.be/disclaimer
-----Original Message-----
From: oracle-l-bounce@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx] On 
Behalf Of Bobak, Mark
Sent: woensdag 7 juli 2010 4:28
To: big.dave.roberts@xxxxxxxxxxxxxx; oracle-l
Subject: RE: VMWARE Snapshots to backup Oracle

Hi Dave,

This is no different than any other hot backup.  You put database into backup 
mode, and copy off the datafiles, exit backup mode.  Then, you can use 'alter 
database backup controlfile....' to take a logical or physical backup of the 
controlfile.  But, do *not* backup the online redo logs.

Suppose you take a hot backup (snapshot or otherwise) with tablespaces all in 
backup mode, at 12:00pm.  Suppose you *did* take a backup of the online redo as 
part of that backup/snapshot.  Now, at 2:00pm, your database crashes.  So, what 
happens?  You restore all files from the snapshot, *including* the online redo. 
 Now, remember, that online redo is from 12:00pm.  You want to recover to 
2:00pm, when the crash occurred.  So, you have your archivelog backups.  So, 
you put database into recovery mode (recover database), and start applying 
logs.  Now, suppose the last archivelog you apply is from 1:55pm.  Where are 
the last remaining transactions from 1:55pm till 2:00pm?  They're in the online 
redo!  But, you've overwritten it, with the data from 12:00p, which is useless, 
and, by the way, was already archived off, shortly after 12:00pm, and has been 
applied to the database.  So, now you're stuck.  You lost the data from the 
current online redo when you did the restore, and your
  online redo is from 12:00pm (backup time), which is useless to you.  So, your 
only option is to do an incomplete recovery, open resetlogs, and explain to 
your boss why you lost all the transactions from 1:55pm-2:00pm.

Now, you could argue that, in the above circumstance, you simply don't restore 
the online redo, and you'll be fine.  That's true, (assuming that the snapshot 
technology you're using will allow for you to specify which files do and don't 
get restored), but, tell me, why backup the on-line redo in the first place?  
Show me a valid recovery scenario, from a hot backup, that requires a copy of 
the on-line redo to be in the backup set.  I'm not aware of any such scenario.  
Can you think of one?

Cold backups are a bit different.  I always argue against backing up online 
redo with cold backup either.  People always argue that the online redo is 
required if the database was not consistent (i.e. cleanly shutdown) when backup 
was done.  And, I'd argue that if that's how you're doing cold backups, you're 
doing it wrong.  (Though, I think I'd first wonder why the heck you're doing 
cold backups in the first place!)

The only valid scenario that I can think of, where you *want* to include the 
online redo, is if you want a *restartable* snapshot, rather than a 
*recoverable* snapshot.  Keep in mind, that restartable snapshot can only be 
used to restore the database to the point in time when the snapshot was taken.  
It's not recoverable, and cannot be rolled forward to a point in time.

Hope that helps,

-Mark
________________________________________
From: oracle-l-bounce@xxxxxxxxxxxxx [oracle-l-bounce@xxxxxxxxxxxxx] On Behalf 
Of David Roberts [big.dave.roberts@xxxxxxxxxxxxxx]
Sent: Tuesday, July 06, 2010 21:36
To: oracle-l
Subject: Re: VMWARE Snapshots to backup Oracle

"Danger, Will Robinson, Danger"

Why would enabling backup mode, mean that backups of online redo logs
are not required?

If you do a snapshot of the database while online, by implication the
backup will only be useful after recovery, and the redo logs would be
vital to guarantee the recovery?

Perhaps, I've missed something, please correct me if I'm wrong.


Dave

On Tue, Jul 6, 2010 at 5:24 PM, Bobak, Mark <Mark.Bobak@xxxxxxxxxxxx> wrote:
> Right.  If you do begin backup/end backup, you should *not* snapshot online
> redo, and you get a recoverable snapshot.  If you do *not* do begin/end
> backup, you *should* snapshot the online redo logs, and you get restartable
> snapshot.
>
>
>
> Hope that helps,
>
>
>
> -Mark
>
>
>
> From: oracle-l-bounce@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx]
> On Behalf Of Andrew Kerber
> Sent: Tuesday, July 06, 2010 12:19 PM
> To: post.ethan@xxxxxxxxx
> Cc: oracle-l
> Subject: Re: VMWARE Snapshots to backup Oracle
>
>
>
> I am not using it, but I understand that it works as long as you use the
> alter database begin backup command prior to taking the snapshot (and the
> alter database end backup command after taking it).
>
> On Tue, Jul 6, 2010 at 10:18 AM, Ethan Post <post.ethan@xxxxxxxxx> wrote:
>
> Anyone using snapshots to backup Oracle? Does it work? Anything I need to
> know?
>
>
> --
> Andrew W. Kerber
>
> 'If at first you dont succeed, dont take up skydiving.'
--
//www.freelists.org/webpage/oracle-l




--
//www.freelists.org/webpage/oracle-l


--
//www.freelists.org/webpage/oracle-l


Other related posts: