Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Thursday, December 27, 2012 3:20 PM
Hi,
I wrongly erased a company database with shift+delete and when i trie to recover the database with file recovering tools it cant even find the file.
Like the Murphy Law says... that was the DB that wasnt included in the backup schedules :(
My steps to delete the file:
1 - stop sql service
2 - renamed mdf file
3 - start sql service
4 shift+deleted the file
This is a virtualized server in Hyper-V
The files are in a diferent partition of the system
Once i saw the error, i used two programs to try to recover the file, Filescanvenger( witch never had let me down ) and recuva.
The file doesnt apear in both of them witch is strange since that drive is only used for the DB's and those are not updated in a while.
Does the MSSQL Server service tries or write something in the disk when it cant find the DB files and make the file unrecoverable?
Any ideas for what happened or to recover the datbase ( i havent mutch hope in that ).
Sincerely,
AM
Thursday, December 27, 2012 7:46 PM ✅Answered | 1 vote
Hello,
Does the MSSQL Server service tries or write something in the disk when it cant find the DB files and make the file unrecoverable?
No, it does nothing of the sort. In fact, it's probably throwing errors in the engine errorlog that it can't startup a database because it can't find the files associated with it since the way the database was deleted is not supported.
My steps to delete the file: 1 - stop sql service 2 - renamed mdf file 3 - start sql service 4 shift+deleted the file
I understand that you wear many hats, but this is not the correct way to remove databases. Using the DROP DATABASE command or right-clicking in SSMS and choosing delete (same thing) will remove metadata information from the system catalogs and delete the files on the operating system level. I eluded to it above, but if you checked the errorlog my guess is there are multiple lines dealing with this database as it wasn't properly removed.
Any ideas for what happened or to recover the datbase ( i havent mutch hope in that ).
Chances are you won't get this back. Even if a file recovery tool were to bring the file back, I would be suspect of the data integrity. If you were to get this back through such a tool, running DBCC CHECKDB on it would be my first priority as the data might not be correct.
That is your only option other than to rip the drives out and attempt to have them professionaly checked which will be most expensive. Count this as a lesson learned.
-Sean
Sean Gallardy | Blog | Twitter
Thursday, December 27, 2012 3:40 PM | 1 vote
The mdf file is marked as deleted but as long as you have not written to that disk, the file recovery programs should work.
I would try another recovery program....
Dusty
Thursday, December 27, 2012 3:47 PM
The mdf file is marked as deleted but as long as you have not written to that disk, the file recovery programs should work.
I would try another recovery program....
Dusty
Thanks for the Reply, any sugestion for recovery programs?
Sincerely,
AM
Thursday, December 27, 2012 4:27 PM
Sorry, I do not have a recommendation. I would Bing search and look for the most popular ones that you have not tried yet.
Dusty
Friday, December 28, 2012 9:08 AM
Hello,
Does the MSSQL Server service tries or write something in the disk when it cant find the DB files and make the file unrecoverable?
No, it does nothing of the sort. In fact, it's probably throwing errors in the engine errorlog that it can't startup a database because it can't find the files associated with it since the way the database was deleted is not supported.
My steps to delete the file: 1 - stop sql service 2 - renamed mdf file 3 - start sql service 4 shift+deleted the file
I understand that you wear many hats, but this is not the correct way to remove databases. Using the DROP DATABASE command or right-clicking in SSMS and choosing delete (same thing) will remove metadata information from the system catalogs and delete the files on the operating system level. I eluded to it above, but if you checked the errorlog my guess is there are multiple lines dealing with this database as it wasn't properly removed.
Any ideas for what happened or to recover the datbase ( i havent mutch hope in that ).
Chances are you won't get this back. Even if a file recovery tool were to bring the file back, I would be suspect of the data integrity. If you were to get this back through such a tool, running DBCC CHECKDB on it would be my first priority as the data might not be correct.
That is your only option other than to rip the drives out and attempt to have them professionaly checked which will be most expensive. Count this as a lesson learned.
-Sean
Thanks for the imput.
Yes i know that i did it all wrong, unfortunatly i was eagar to release space, to shrink that VHD.
I think the MSSQL tried to recover the DB using the log file, is the only explanation to not show in the recovery programs :(
Thanks all for the imput.
Sincerely,
AM
Tuesday, January 15, 2013 6:32 AM
Database of MS SQL Server is stored in .MDF file format either on Server or local drive. MDF files get damaged due to slow running of SQL Server, virus codes, accidental deletion of files and other factors. With RecoveryFix for SQL database, you can retrieve user data such as triggers, views, tables, hyperlinks and stored procedures from corrupt MDF files. It recovers SQL database in its original text formatting.
Thanks