VMware

This Question is Possibly Answered

1 "correct" answer available (10 pts) 1 "helpful" answer available (6 pts)
9 Replies Last post: Sep 18, 2009 12:53 PM by proden20  

Snapshots with Oracle = Safe? posted: May 12, 2008 6:16 PM

Click to view grittyminder's profile Enthusiast 46 posts since
Dec 5, 2007
We recently completed virtualization of a few Oracle 10.x Windows servers. This is a huge deal--a few people did not want this project to be carried out.

Here is where things went wrong. We are (were?) backing up or VMs using scripted snapshots and disk exports (we have no SAN at this point). We didn't realize that snapshots do not play nicely with Oracle DBs (we did not notice anything unusual during the testing phase). A few days after deploying the backup scripts into production our main Oracle DB crashed while being snapshotted. Now there is a huge snapshot 'backlash'--snapshots are forbidden to be used with Oracle DBs.

At this point, I feel I need to give a bit of background information. One of the objectives with virtualization for us was to reduce the manual/attended portion of the backup job. The previous non-virtualized system backups went something like this: backup Oracle DB to tape, run DB batch job, backup Oracle DB to tape again. This entire process would be completed at midnight every night. With the introduction of virtualization we were hoping to eliminate the first Oracle tape backup and use snapshoting instead (if something goes wrong with the DB batch job we simply roll back the snapshot). However, thanks to the 'backlash' we are now carrying out a complete DB export prior to the DB batch job (the tape backup system was eliminated as part of the refresh), which takes much longer time-wise. 1AM to be exact.

Now for the question. Is there a way to safely use snapshots with an Oracle database that guarantees that data integrity will be maintained always? Is there a best practices document I can read? Also, if I am a risk-adverse manager, can you explain to me in simple and rational language why snapshotting would be a more desirable alternative to database exporting (the present mentaility: snapshots=fast, yet unfamiliar and risky. DB exports=slow, yet familiar and safe)?

Re: Snapshots with Oracle = Safe?

1. May 13, 2008 5:55 PM in response to: grittyminder
Click to view philvirt's profile Hot Shot 176 posts since
Oct 12, 2007

The answer is no.

Unfortunately, the database needs to be put in an altered state A.K.A. backup mode. Oracle needs to pause transactions while your doing your backups and you will need to send an SQL statement in order to do so. Oracle "Clients" send the necessary statements before executing the backup.

With the new version of Oracle 11g you can use VSS and create snapshots with some sort of SAN replication solution, however with VMware's snapshot as of now your out of luck. Sorry. I've been waiting for this myself, since I deal with mostly Oracle databases.

Regards,

Fil

Re: Snapshots with Oracle = Safe?

3. May 14, 2008 6:48 AM in response to: grittyminder
Click to view philvirt's profile Hot Shot 176 posts since
Oct 12, 2007

You could use a script to alter the database and put it in backup mode and then release it from backup mode after your snapshot. The hard part is the timing.

How would you automate the verification of your snapshot completing and then execute the script to remove the database from backup mode?

Unless you did this with some sort of scheduled process, but risky since the snapshot mechanism can't talk to your scripts...

Regards,

Fil

Re: Snapshots with Oracle = Safe?

4. May 15, 2008 5:20 AM in response to: philvirt
Click to view Gilmore's profile Lurker 1 posts since
May 13, 2008
Hi,

We are having the same problem. We have some VM with Oracle 10g and W2k3, and the problem is the backup. We are now using EsXpress and it seems to be really fantastic: we haven't found any problem when starting the restored databases, but we don't dare to put it in production because we haven't been able to run a "begin backup" command in the windows system before running the esxpress backup command and a "end backup" script when the backup have finished.

Do you know any way of running commands from the ESX server to the VM? Is it possible to do it through the vmware tools?

Of course there is an easy way to run a backup: Consider the VM as a PM and install a backup agent, like TSM or DP, and backup the database with these backup tools.

Thanks and regards,

G.

Re: Snapshots with Oracle = Safe?

6. Jul 29, 2008 12:05 PM in response to: grittyminder
Click to view Tom_Daytona's profile Lurker 3 posts since
Nov 9, 2007
We are having the same problems with oracle. I was suggested to do this.

In Device Manager, enable view hidden devices Disable Sync Driver under Non Plug and Play drivers. Reboot.

I have to wait til the morning to reboot our oracle server. but I am told it works

Re: Snapshots with Oracle = Safe?

7. Sep 1, 2009 5:42 AM in response to: Tom_Daytona
Click to view Rob Lisi's profile Novice 27 posts since
Nov 10, 2006
Tom did this work? Were you able to restore from a snapshot and Oracle was ok by disabling the sync driver?

Re: Snapshots with Oracle = Safe?

8. Sep 18, 2009 12:45 PM in response to: grittyminder
Click to view proden20's profile Hot Shot 145 posts since
Jan 29, 2008

I've been performing VCB backups on Oracle for years.

I run a "pre" scheduled task on Oracle:

10:50PM: Quiesce the database

11:00PM: VCB comes in and backs up the VM

12:00AM: Unquiesce the database

Works like a charm but you need to coordinate with the DBAs and watch your windows. I try to follow this model with any DB VM. The first time I tried without quiescing the database corrupted. Luckily we're in dev.

Dennis.

If you found this question to be correct or helpful, please remember to award points.

Dennis Procopio - VCP

Re: Snapshots with Oracle = Safe?

9. Sep 18, 2009 1:04 PM in response to: grittyminder
Click to view proden20's profile Hot Shot 145 posts since
Jan 29, 2008
Sorry, jumped the gun and didn't notice you didn't have shared storage or VCB. What about adding storage and cloning to it via script? See the attached document, module 6: "Importing and Exporting.." and take a look at vmkfstools.

VCB is the prescribed way to back up with snapshots. In training it was explained that snapshots were originally developed to allow VCB functionality. Any way you look at it, it could be convoluted or you could purchase a product.


Dennis Procopio - VCP

VMware Developer

SDKs, APIs, Videos, Learn and much more in the Developer community.

Learn More

Developer Sample Code

Increase your developer productivity with VMware API sample code.

Learn More

VMworld Sessions & Labs

Online access to the latest VMworld Sessions & Labs and online services.

Learn more

Purchase PSO Credits Online

Purchase credits to redeem training and consulting services online.

Buy Now

Community Hardware Software

View reported configurations or report your own.

Learn More

VMware vSphere

Come witness the next giant leap in virtualization.

Register Today

Communities