Solved

SQL VSS Writer, copy-only backups

Posted on 2014-10-15
7
419 Views
Last Modified: 2014-11-12
I am backing up a SQL database, in SQL 2014 (though if you know the answer pertaining to older versions of SQL, I'd be interested in hearing it), using a 3rd party product. This product utilizes the SQL VSS Writer to perform the backup. I have edited the registry, by creating the following key, with a value of 1.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SQLWriter\Settings\DisableLogShrink

This keeps the backup from truncating the logs. The question is, is there a setting that I can add that will cause all of the backups using the SQL Writer to do a copy-only backup?

The reason for this, I am doing snapshots of the database in AWS using a product called CPM. It just creates AWS snapshots, and is a management layer on top. I don't want these backups to register within SQL itself, so that I can perform a second backup from within SQL itself, as well as log backups with truncation. By setting the registry value above, my snapshots do not truncate the logs anymore, but each snapshot shows up as a full backup within SQL. If I can set the backups going through the SQL writer to be copy-only, then they will not show up as a full backup in SQL. And at that point, I can do a separate full backup within SQL itself that doesn't user the writer and subsequent log backups that provide more granular point-in-time recoveries that I can't get with the snapshots.
0
Comment
Question by:PMFM
  • 4
  • 2
7 Comments
 
LVL 20

Expert Comment

by:Marten Rune
Comment Utility
Here is the Microsoft link to the writer. Though I thing the 3'rd party Product needs to have this function implemented. It clearly states that the writer supports copy_only backups. But it needs to be requested from the requestor, i e the 3'rd party backup program.

I did google the CPM, but with no luck. So I don't Think I can help further.

You need to find documentation from the CPM, or ask their support if this function is implemented.

Regards Marten
0
 
LVL 39

Expert Comment

by:lcohan
Comment Utility
At the link below it is stated that indeed "SQL Writer supports: Copy-only backup"
http://msdn.microsoft.com/en-us/library/ms175536.aspx

"The backup type (full, copy, incremental) can be specified by a VSS-based backup application at the beginning of the backup session, using the IVssBackupComponents::SetBackupState."

http://blogs.technet.com/b/filecab/archive/2008/05/21/what-is-the-difference-between-vss-full-backup-and-vss-copy-backup-in-windows-server-2008.aspx


For older versions the link below explains how to "Copy-Only Backup.  It is sometimes necessary to take a backup that is intended for a special purpose, for example when you need to make a copy of a database for testing purposes.  This backup should not impact the overall backup and restore procedures for the database. Using the COPY_ONLY option specifies that the backup is done “out-of-band” and should not affect the normal sequence of backups. The SQL writer supports the “copy-only” backup type with SQL Server 2005 instances."

Basicaly "SQL Writer Metadata Document"  which is "an XML document created by a writer (the SQL writer in this case) using the IVssCreateWriterMetadata interface, and containing information about the writer's state and components." where "◦VSS_BS_COPY – supports “copy-only” backup option."

http://technet.microsoft.com/en-us/library/cc966520.aspx#_Backup_and_Restore_Options  Support
0
 

Author Comment

by:PMFM
Comment Utility
Thanks. I had found in the documentation that it supports it. As well as disabling truncation. What I can't find documented is a way to change the settings on the VSS writer itself. The CPM backup software support suggested a registry key to disable truncation for any backups that use the SQL Writer, whether CPM or another product. That worked perfectly, though I can't find it documented any place else. I was hoping to find the same type of solution for copy-only. The interface and options for the use of VSS in CPM is limited. So, my only chance at getting this will be through a configuration file or registry edit.
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 39

Expert Comment

by:lcohan
Comment Utility
That's exactly what the XML "SQL Writer Metadata Document" will do for you - right?

<<
Basicaly "SQL Writer Metadata Document"  which is "an XML document created by a writer (the SQL writer in this case) using the IVssCreateWriterMetadata interface, and containing information about the writer's state and components." where "◦VSS_BS_COPY – supports “copy-only” backup option."

http://technet.microsoft.com/en-us/library/cc966520.aspx#_Backup_and_Restore_Options  Support
>>
0
 

Author Comment

by:PMFM
Comment Utility
Right, but I can't find the location of this .xml file, and it sounds like it is possibly generated on the fly by the writer itself and any changes to parameters would have to be done when calling the sql writer. That may be completely incorrect - it's really just a semi-educated guess. The .xml file is not in the same location as the sqlwriter executable or any of the subfolders.
0
 
LVL 39

Expert Comment

by:lcohan
Comment Utility
You can do it via "IVssCreateWriterMetadata interface" http://msdn.microsoft.com/en-us/library/aa383589(v=vs.85).aspx
0
 
LVL 39

Accepted Solution

by:
lcohan earned 500 total points
Comment Utility
in 2014 you can do it via the "IVssBackupComponents interface"
"Applications obtain an instance of the IVssBackupComponents interface by calling CreateVssBackupComponents."

http://msdn.microsoft.com/en-us/library/aa382175(v=vs.85).aspx

you need to set
IVssBackupComponents::SetBackupState VSS_BACKUP_TYPE backupType as VSS_BT_COPY   = 5 - see links below for details:

http://msdn.microsoft.com/en-us/library/aa382833(VS.85).aspx
http://msdn.microsoft.com/en-us/library/aa384679(v=vs.85).aspx
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
Viewers will learn how the fundamental information of how to create a table.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now