Red Gate forums :: View topic - Cannot Delete Backup File
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Virtual Restore 2
SQL Virtual Restore 2 forum

Cannot Delete Backup File

Search in SQL Virtual Restore 2 forum
Post new topic   Reply to topic
Jump to:  
Go to page 1, 2  Next
Author Message
SloopJohnB



Joined: 22 Jul 2006
Posts: 18

PostPosted: Wed Apr 25, 2012 9:01 pm    Post subject: Cannot Delete Backup File Reply with quote

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.
Back to top
View user's profile Send private message
Matthew Flatt



Joined: 15 Jan 2008
Posts: 253

PostPosted: Thu Apr 26, 2012 10:07 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
festernd



Joined: 09 Oct 2009
Posts: 3

PostPosted: Fri Jun 01, 2012 6:05 pm    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
Matthew Flatt



Joined: 15 Jan 2008
Posts: 253

PostPosted: Fri Jun 08, 2012 2:59 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
festernd



Joined: 09 Oct 2009
Posts: 3

PostPosted: Tue Jun 19, 2012 10:19 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Matthew Flatt



Joined: 15 Jan 2008
Posts: 253

PostPosted: Wed Jun 20, 2012 10:49 am    Post subject: Reply with quote

Hi festernd.

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

Thanks,
_________________
Matthew Flatt
Test Engineer, HyperBac
Back to top
View user's profile Send private message
SloopJohnB



Joined: 22 Jul 2006
Posts: 18

PostPosted: Wed Jun 20, 2012 3:41 pm    Post subject: Reply with quote

Mine says 5.5.1.10
Back to top
View user's profile Send private message
SloopJohnB



Joined: 22 Jul 2006
Posts: 18

PostPosted: Wed Jun 20, 2012 3:47 pm    Post subject: Agree with festernd Reply with quote

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.
Back to top
View user's profile Send private message
festernd



Joined: 09 Oct 2009
Posts: 3

PostPosted: Thu Jun 21, 2012 9:52 pm    Post subject: Reply with quote

same as Sloop,
hyperbak version 5.5.1.10 -- configuration manager doesn't seem to list virtual restore specifically.
Back to top
View user's profile Send private message
Matthew Flatt



Joined: 15 Jan 2008
Posts: 253

PostPosted: Tue Jun 26, 2012 10:16 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
DLapointe



Joined: 09 Jul 2012
Posts: 1

PostPosted: Mon Jul 09, 2012 5:11 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Matthew Flatt



Joined: 15 Jan 2008
Posts: 253

PostPosted: Tue Jul 10, 2012 10:15 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
jeff.stanlick



Joined: 12 Aug 2011
Posts: 6
Location: Milwaukee, WI USA

PostPosted: Thu Jul 26, 2012 2:29 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
JimCameron



Joined: 07 Sep 2012
Posts: 1

PostPosted: Fri Sep 07, 2012 3:26 pm    Post subject: Reply with quote

Long Path Tool helped me in this situation. http://LongPathTool.com
Back to top
View user's profile Send private message
Markovin



Joined: 05 Oct 2012
Posts: 1
Location: Dhaka Bangladesh

PostPosted: Fri Oct 05, 2012 11:29 am    Post subject: Cannot Delete File? Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Go to page 1, 2  Next
Page 1 of 2

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group