Cannot Delete Backup File

SQL Virtual Restore: Rapidly mount live, fully functional databases direct from backups

Moderators: eddie davis, Colin Millerchip, fionag

Cannot Delete Backup File

Postby SloopJohnB » Wed Apr 25, 2012 9:01 pm

I created two virtual DBs off of one backup file (an encrypted sqb). I've deleted both DBs (via SSMS), as I am done with them, but now I cannot delete the sqb file it was based on from the file system. Whenver I attempt to delete it in Windows Explorer I get the message, "The action can't be completed because the file is open in HyperBack Control Service". How can get rid of the file?

Thanks in advance for your help.
SloopJohnB
 
Posts: 18
Joined: Sat Jul 22, 2006 1:19 am

Postby Matthew Flatt » Thu Apr 26, 2012 10:07 am

Hi SloopJohnB,

The backup file handle should be released by the HyperBac service around a minute after the last database that uses it has been dropped. Is the file still locked now?

If it is, the easiest thing to get it deleted would be to stop the HyperBac Control Service. Please ensure that you have no backups/SQL Virtual Restore/SQL Storage Compress databases running/online before you stop the service though as any access to those files would cause errors.

Hope this helps.

Thanks,
Matthew Flatt
Test Engineer, HyperBac
Matthew Flatt
 
Posts: 253
Joined: Tue Jan 15, 2008 4:45 pm

Postby festernd » Fri Jun 01, 2012 6:05 pm

I also have a related issue.
it appears for larger virtual DBs, when I restore over a previous one, hyperbak will only release it's hold after a restart of the entire server.
--for example: test_virtual then replace Test_virtual by either deleting or restoring with replace.

if I stop hyperbak, stop sql, restart hyperbak, restart sql around 50% of the time it will fail to recover the DB, or mark it as suspect. but a reboot doesn't have that issue.

Is there a way to make hyperbak give up its hold on files manually?
festernd
 
Posts: 3
Joined: Fri Oct 09, 2009 9:20 pm

Postby Matthew Flatt » Fri Jun 08, 2012 2:59 pm

Hi festernd,

With the HyperBac service stopped, all open handles to files HyperBac has been using should be closed.

Have you tried using ProcMon to see what has a handle open to the file and kill it?

You mention that for larger databases when replacing, which file is not being released? The backup file or the vmdf/vldf files?

Also, what version does it say if you open you Configuration Manager?

Thanks,
Matthew Flatt
Test Engineer, HyperBac
Matthew Flatt
 
Posts: 253
Joined: Tue Jan 15, 2008 4:45 pm

Postby festernd » Tue Jun 19, 2012 10:19 pm

The file not being released is the previous SQBs
Yes, with hyperbac stopped, all file handles are released...but:
Stopping HyperBac to force it to release old SQB files is not a solution, because when I stop hyperBac( stop sql server, stop hyperbac, start hyperbac, start sql) it frequently doesn't recover the database, or marks them suspect, as I previously stated.

Also, needing to restart hyperbac/ the entire server isn't a good solution.
I'd really like to know why hyperbac won't give up it's handles, and how to fix that.
festernd
 
Posts: 3
Joined: Fri Oct 09, 2009 9:20 pm

Postby Matthew Flatt » Wed Jun 20, 2012 10:49 am

Hi festernd.

What version does it say if you open your Configuration Manager?

Thanks,
Matthew Flatt
Test Engineer, HyperBac
Matthew Flatt
 
Posts: 253
Joined: Tue Jan 15, 2008 4:45 pm

Postby SloopJohnB » Wed Jun 20, 2012 3:41 pm

Mine says 5.5.1.10
SloopJohnB
 
Posts: 18
Joined: Sat Jul 22, 2006 1:19 am

Agree with festernd

Postby SloopJohnB » Wed Jun 20, 2012 3:47 pm

Also, I agree with festernd on having a solution other than "restart the service". Realistically, I don't bother with deleting an orphan sqb until the server is rebooted, since this is a production server, and I can't just randomly start/stop things on it. I've taken to keeping a side Excel document with the file names of all the orphaned files, and go about deleting them once the server has been rebooted (e.g., to apply security patches). This is far from an ideal solution, since I don't have endless disk drive space to keep useless backups around.
SloopJohnB
 
Posts: 18
Joined: Sat Jul 22, 2006 1:19 am

Postby festernd » Thu Jun 21, 2012 9:52 pm

same as Sloop,
hyperbak version 5.5.1.10 -- configuration manager doesn't seem to list virtual restore specifically.
festernd
 
Posts: 3
Joined: Fri Oct 09, 2009 9:20 pm

Postby Matthew Flatt » Tue Jun 26, 2012 10:16 am

Hi,

Would you be able to upgrade to version 5.6 of the HyperBac components at your earliest convenience?

You can download it from the product page.

This version contains enhanced index clean up and could solve your issue as active indexes can create locks on the various files in an SVR database.

Thanks,
Matthew Flatt
Test Engineer, HyperBac
Matthew Flatt
 
Posts: 253
Joined: Tue Jan 15, 2008 4:45 pm

Postby DLapointe » Mon Jul 09, 2012 5:11 pm

I'm having the same issue.

I am running HyperBac 5.6.1.1

I have an sqb file which was used for a virtual restore database. I dropped the database through SSMS - the vldf, vmdf and 2 vndf files dissappeared with the database drop. The sqb remained. I have tried to delete the file with a failure message stating that "It is being used by another preson or program". I have this problem with an sqb which has not been used in 3 weeks.
I should note that these are all for the same database - different backups of the same database being virtually restored into the same target database.

I have not had this issue for all of my Virtual Restores.

Any ideas?

Thanks
DLapointe
 
Posts: 1
Joined: Mon Jul 09, 2012 4:57 pm

Postby Matthew Flatt » Tue Jul 10, 2012 10:15 am

Hi DLapointe,

Can you please locate the file openstatus.dat from your HyperBac installation directory (%:\\Program Files (x86)\\Red Gate\\HyperBac\\bin) and send it to support@red-gate.com.

If you could include the link to this forum post and reference my name that would be great.

Thanks,
Matthew Flatt
Test Engineer, HyperBac
Matthew Flatt
 
Posts: 253
Joined: Tue Jan 15, 2008 4:45 pm

Postby jeff.stanlick » Thu Jul 26, 2012 2:29 pm

We've been having the same problem. We run processes that will drop an existing vdb, copy the production sqb down over top of it and then virtually restore the database for development purposes. These processes run every night. And it has been awesome.

However, on the 2 servers we upgraded to 5.6.1.1 (all of the rest are on 5.4.1.5), we get the file in use errors when trying to delete the old sqb file even though the database has been dropped from SQL Servers perspective. We added a step to our process to attempt to delete the files (vmdf and vldf too) and if it's locked to wait 30 seconds and try again. It runs this loop 3 times until it's successful. Only on the servers run 5.6.1.1, it never is. If we restart the HyperBac service (haven't had to restart SQL Server), we can then remove the old sqb and the restore of the new one works just fine. This is running SQL 2008 SP2 on Windows OS 2008.

-Jeff
jeff.stanlick
 
Posts: 6
Joined: Fri Aug 12, 2011 3:08 pm
Location: Milwaukee, WI USA

Postby JimCameron » Fri Sep 07, 2012 3:26 pm

Long Path Tool helped me in this situation. http://LongPathTool.com
JimCameron
 
Posts: 1
Joined: Fri Sep 07, 2012 3:21 pm

Cannot Delete File?

Postby Markovin » Fri Oct 05, 2012 11:29 am

I got the same problem as very annoying and with no explanation as the file names have no visible illegal characters and are not too long and not copied or deleted and found good stuff at http://pathtoodeep.com/ and also over here. Thanks
Markovin
 
Posts: 1
Joined: Fri Oct 05, 2012 11:26 am
Location: Dhaka Bangladesh

Next

Return to SQL Virtual Restore 2

Who is online

Users browsing this forum: No registered users and 1 guest