Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Many well-known backup utilities for Windows use the Volume Shadow Copy Service built in to newer versions of windows to create a point-in-time snapshot of the disk in order to safely back up open files.

But how well does this mechanism play with SQL Server? I know that an SQL Server VSS Writer exists to help backup systems interoperate with SQL Server, but not all backup systems know about SQL Server and take advantage the backup-related API that it provides.

So my question is, what about the programs that don't know anything about SQL Server?

They presumably get a point-in-time snapshot of the MDF and LDF files as they existed at one single instant. And presumably the SQL Server data format is robust enough that such a snapshot would be guaranteed to be consistent and usable.

Is that the way things work, or am I missing something? Are there "gotchas" about using such a backup mechanism, or would I be safe?

share|improve this question

4 Answers 4

up vote 6 down vote accepted

Short answer: they don't play very well together unless you've got SQL server configured appropriately (and even then I wouldn't recommend it).

There's a lot of information about VSS & MSSQL playing together here.

One word of warning though:

presumably the SQL Server data format is robust enough that such a snapshot would be guaranteed to be consistent and usable

That's a big assumption, and one that's not always safe to make unfortunately. That's why your MSSQL maintenance plans are essential to ensuring you can recover from disasters.

share|improve this answer

You never backup MDF and LDF files.

You run backups (plans, SQL, SMO, whatever) then backup these backup files.

Frankly, I don't get a fig what any vendor says about VSS. I also dislike any vendor that has a SQL Server plugin for backups. You use SQL Server native backups only

FYI: you also exclude MDFs and LDFs from virus scanning too.

share|improve this answer

If you don't have software that has a SQL "option" then:

Create SQL maintenance plans or scheduled Backup jobs for the databases, dump them to disk, then backup the server. Or when you dump them, dump them straight to your disk-to-disk backup location if you have one.

share|improve this answer

The main problem with VSS backup is caused by caching in sql server.

The current state on your disk does not always contain all database changes. Backupsoftware must be aware of this to ensure that sql server write all of it's caches before you take am snapshot.

Having that said: the safest method is still backuping up in sql management/with sql server tools.

And you should exclude all sql server data and backup files from virusscanners (.bak, .mdf, .ldf).

share|improve this answer
1  
The whole purpose of the VSS Requestor\Writer architecture is to ensure that the relying application (e.g. your Backup app) can instruct the owner (SQL Server\Exchange etc) to flush all cached data and open transactions, then flush the OS disk cache before making the snapshot. Whether it works well is another issue but the architecture does as much as it can to ensure the files are consistent. –  Helvick Sep 18 '10 at 16:05
1  
um, no. unless you've made a crazy configuration change, once a transaction is committed, it's on disk. there is nothing committed in cache that is not also committed on disk. –  longneck Nov 5 '12 at 20:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.