Thursday, March 22, 2012

Backup devices (named pipes)

I hope someone can at least point me in the right direction on this one.
I've written some procs and created appropriate tables to replicate logshipping without incurring the added expense of Enterprise, just for the GUI.
I'm now looking for ways to extend/enhance this functionality. Currently I use a commandline compression app (bzip2) to compress the tran log backup after it's been written to disk, and although it works, I was thinking it would be nice if I could capture the backup stream on the fly (before it get's written to disk) and compress it before writing to disk. I've found several products that do this, but almost no documentation on the actual process of capturing the backup output.
Through a little sleuthing, I was able to create a device with sp_addumpdevice using a named pipe, and a small .Net app that was to read from that pipe, but I'm running into a problem. For some reason, all I get is the header information, then SQL server seems to expect a response from me and if I don't respond within a certain timeframe (let alone that I have no idea what to send it) it closes the pipe and the backup operation fails with a device write error, listing OS error 232(pipe being closed) in the logs.
Any assistance that someone could provide would be greatly appreciated.
Thanks in advance for taking the time to read this gobbledy-gook!

You can write a VDI (Virtual Device Interface) application to get access to the backup data.

Named pipe backups have been deprecated since sql7, and are removed in sql2005.

You can download doc and samples for VDI here:

http://www.microsoft.com/downloads/details.aspx?FamilyID=416f8a51-65a3-4e8e-a4c8-adfe15e850fc&DisplayLang=en

|||Thanks very much for the quick reply Steve. Unfortunately, I won't be able to utilize sql2005 in a production environment for at least another year. We have many legacy systems that interface with SQL2000 via batch loads, DTS and a vagary of third party interfaces (Liant Relativity for example) and until testing is complete company wide, policy is that SQL2005 not be used.
That being the case, are there any resources relevant to this situation in SQL2000?
Also, I apologize if this is posted in the wrong forum, but as I wasn't able to find any SQL2000 forums, this seemed the most appropriate place to pose my question.
Thanks again for your help!
|||

You can use VDI since sql7, so that should do the trick for you.

The VDI has not changed since sql2000, so our newer 2005 spec is mostly just clarifications. Any VDI app written for sql2000 (or sql7) should work without changes on sql2000 or sql2005.

I strongly advise you against writing a named pipe backup application. The reason is that such an app will not be compatible with sql2005.

Of course you are free to pass the VDI stream on via your own named pipes if you really want to.

This forum is good for any sql questions.

Cheers,

No comments:

Post a Comment