[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 652
  • Last Modified:

SQL VSS Writer, copy-only backups

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
PMFM
Asked:
PMFM
  • 4
  • 2
1 Solution
 
Marten RuneSQL Expert/Infrastructure ArchitectCommented:
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
 
lcohanDatabase AnalystCommented:
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
 
PMFMAuthor Commented:
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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
lcohanDatabase AnalystCommented:
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
 
PMFMAuthor Commented:
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
 
lcohanDatabase AnalystCommented:
You can do it via "IVssCreateWriterMetadata interface" http://msdn.microsoft.com/en-us/library/aa383589(v=vs.85).aspx
0
 
lcohanDatabase AnalystCommented:
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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now