Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

Differential backups rendered useless by backup device Expand / Collapse
Author
Message
Posted Wednesday, February 20, 2013 1:59 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, March 25, 2014 10:26 AM
Points: 6, Visits: 61
You could create an after-insert trigger on 'backupset' table in msdb database. Check for the condition is_snapshot=1 and run the full backup job.
This is a good idea. But luckily for me, something changed in the backup plan of the n/w admins and I didn't see those annoying snapshot entries anymore.
Post #1422293
Posted Wednesday, February 20, 2013 2:10 PM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Yesterday @ 3:30 PM
Points: 41,531, Visits: 34,448
rferreira.dba (2/20/2013)
Let me put this another way: Is there any valid reason for Microsoft not to fix this?


Because there's nothing broken here?
The kb article you referenced refers to a problem where an incorrect insert is made into the backup history tables reflecting a backup that did not happen, not the case where you really are taking valid backup of the database. The backup history tables do not drive valid restores, they're just a record of what backups happen. The issue you have is not related to that kb article.

In your case, you are taking two types of full backups and the differential that runs is correctly based on the latest full (whatever it may be). This isn't a bug, this is documented, normal behaviour
You can get into exactly the same mess with two scheduled of native backups, where one is taken off site and not available. A differential backup is always based on the latest non-copy only full backup

Is this possible? Is there an after_successful_snapshot trigger somewhere, or something similar that I can use?


As far as SQL is concerned, that's just a database backup run by a 3rd party product. No less valid or correct than a normal database backup. Can you hook into whatever is running the snapshot backups and have that run some SQL afterwards?

Options:
- Set the backup app to snapshot the machine but exclude the databases. Some tools can, some can't. If you have a good SQL backup strategy, as it sounds like you have, then there isn't a need to snapshot the databases as well.
- Set the backup app to do a 'copy only' snapshot. Probably won't be an option, haven't seen that as a setting in many tools.
- Change the backup strategy to be a mix of full and log backups. If you're not doing differentials then the additional full backups won't have any effect on restoring. Not the best option, probably the last option if nothing else is possible

p.s. This is why I always say that all SQL backups should be done the same way and that there should only be one method for the SQL backups. Native or 3rd party, not a mix of both.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1422298
Posted Wednesday, February 20, 2013 2:54 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, March 25, 2014 10:26 AM
Points: 6, Visits: 61
I agree it's not exactly a bug. But the fact remains that differentials are running based on a non-existent full backup (a backup that's part of a volume snapshot). It could've been avoided if the VSS writer recorded it as 'copy only'.
And I agree that there should be only one method of backup. But in my case we require both. Volume snapshot is the preferred restoration method, in case of a crash. SQL maintenance plans are our fallback option.
If we don't have access to the backup device to check it's options, it's either your third option or the option proposed by rferreira (full backup immediately after the snapshot).
Post #1422324
Posted Wednesday, February 20, 2013 3:07 PM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Yesterday @ 3:30 PM
Points: 41,531, Visits: 34,448
sqlskj4000 (2/20/2013)
I agree it's not exactly a bug. But the fact remains that differentials are running based on a non-existent full backup (a backup that's part of a volume snapshot). It could've been avoided if the VSS writer recorded it as 'copy only'.


Agreed, the problem there is that many of the tools that use the VSS writer to back up a SQL database don't have an option for the user to set copy only, and it is not (and cannot be) the default.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1422329
Posted Thursday, February 21, 2013 10:16 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Wednesday, April 16, 2014 8:46 AM
Points: 845, Visits: 2,331
Gail beat me to the "change to Full recovery model and do Log backups instead" option.

As far as your proposed "full after each snapshot" option, you can try looking at extended events, as well as seeing if Windows Task Scheduler can trigger off of the snapshot (then you use sqlcmd to run msdb.dbo.sp_start_job), but the brute-force way is to set up a job that polls every N minutes in about the right timerange, and compare the msdb list of snapshot backups to a stateful list of prior snapshot backups. When it sees a new one, kick off a full backup and record the new snapshot.

Personally, I'd have to say that Gail's options are the best - your Full backup after the snapshot may fail for a variety of reasons, leaving your every 4 hour Differential backups silently worthless.
Post #1422697
Posted Friday, January 03, 2014 4:14 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Friday, March 28, 2014 8:08 AM
Points: 19, Visits: 105
You should disable the SQL Server VSS Writer service. See this discussion.

Also for VMware snapshots it is possible to exclude specific writers by editing vmbackup.conf.
Post #1527442
Posted Monday, January 06, 2014 8:40 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, March 25, 2014 10:26 AM
Points: 6, Visits: 61
ShuNx239 (1/3/2014)
You should disable the SQL Server VSS Writer service.


That is what I eventually did.

11:29pm - net stop "SQL Server VSS Writer"
11:31pm - net start "SQL Server VSS Writer"

Post #1528127
Posted Monday, January 06, 2014 9:45 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: 2 days ago @ 11:40 PM
Points: 117, Visits: 715
sqlskj4000 (1/6/2014)
ShuNx239 (1/3/2014)
You should disable the SQL Server VSS Writer service.


That is what I eventually did.

11:29pm - net stop "SQL Server VSS Writer"
11:31pm - net start "SQL Server VSS Writer"



SAN replication has VSS support in Windows that is triggering the SQL Server VSS Writer at backup time. The VSS Writer is effectively creating a snapshot on the database and running a full backup which you probably see logged in msdb database. Try to implement full backups daily and take transaction log backups every 15 mins if possible. If you disable VSS writer you might see transactional integrity issues on the SAN copy. Please double check. If you are not worried about the SAN snapshots then it's good to disable the VSS writer.
Post #1528154
Posted Tuesday, January 07, 2014 3:53 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, April 02, 2014 3:04 PM
Points: 9, Visits: 109
In our case, our final solution was a bit involved, but for us it is robust and keeps everything we need:

1- We mirrored the database(s) into a mirror server.
2- We now take snapshots of the mirror server and leave the principal alone.
3- And of course, we do not do any backups of the mirror server, except the snapshots.

This way the principal is fine and dandy, has a mirror stand-by to fall back to, and we have the snapshots of the mirror to use during Disaster Recovery exercises. Works perfectly in our environment.

Thanks all,

Raphael
Post #1528711
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse