Apparently Windows Server Backup has some support for backup of SQL Server databases:
Ability to recover applications. Windows Server Backup uses VSS functionality that is built into applications like Microsoft® SQL Server® to protect application data. [Source: TechNet]
In addition, people report that Windows Server Backup seems to trigger some sort of backup operation in SQL Server.
However, I fail to find (official) documentation on how exactly to backup SQL Server databases using Windows Server Backup.
- Do I just need to backup the
.mdf
? The.mdf
and the.ldf
? - Online or just offline?
- What's the official procedure for restoring SQL Server databases backed up this way?
- Is there anything special to consider when doing incremental/differential backups?
- Where is all of this documented?
(I know how to do backups with SQL Server Maintenance Plans, sqlmaint.exe
, T-SQL BACKUP and SQL Server Agent. I'm just interested in the alternative that Windows Server Backup (apparently?) offers.)
Windows Server Backup is not intended as a backup tool for SQL Server.
Quote from Windows Server Backup Step-by-Step Guide for Windows Server 2008 section: "Who should use Windows Server Backup?"
The section you quoted is basically saying, that when Windows Server Backup kicks in, it will trigger the VSS feature in Windows. SQL Server will be aware that a Volume Shadow Copy is occurring and with the aid of SQL Server Writer service, will ensure that a copy of the database files (*.mdf, *.ndf, *.ldf) can be performed.
The purpose of the SQL Server Writer service is defined as follows:
Quote from SQL Writer Service section: "Purpose"
So that is basically all that happens with the Windows Server Backup.
The backups created with Windows Server Backup while SQL Server is running should be consistent, but the transactions not yet written to disk are not in the Volume Shadow Copy. The database snapshot was taken while being ONLINE.
However the MSDN article Snapshot Backups states:
and additionally:
To answer your questions:
Answers:
Explained in real-life implementation
In our environment we have a similar situation where VMware is conducting a snapshot and the DBA's are conducting SQL Server dumps with Commvault. The backup history looks like this:
The VMware snapshot will create an entry in the MSDB database history tables with
IS_SNAPSHOT = 1
andFULL
for each VMware snapshot that is conducted (daily). The native (well Commvault using native) SQL Server backups are conducted using FULL, DIFF and TLOG backups. These backups are not marked as IS_SNAPSHOT and exist as additional FULL (once a week), DIFF (every other day) and LOG (hourly) entries in the backup tables in the msdb database.With this setup, we can perform either a restore to the snaphot date-time and then bring the database ONLINE, or we can perform an individual restore to any point-in-time using the "native" SQL Server backups.
You can't. Or at least you probably shouldn't. As far as SQL Server databases are concerned native backups are the supported method.
I think you may be misunderstanding what the TechNet article is saying. The comment you quoted doesn't indicate that you can use Windows Server backup for SQL Server databases. It is actually just highlighting that Windows Server backup utilizes the same Volume Shadow Copy Service that is used by SQL Server. More info: TechNet: SQL Writer Service
Sql backup not just copy data, it truncate the log also. You can find hundreds options in the man page thats will help you, such of compressing the backup file on the fly.
I remember that vss backup was used for copying a freezed Virtual Machine or to snapshotting a lun on a SAN in order to backup a static image, but the backup will be "crash consistent" just like power interruption and not really consistent.
Related
I think it uses a special backup type called "Snapshot Backup".
From the SQL Server 2008 documentation:
It is all very unclear to me. Especially if this truncates transaction logs or not.