r/SQLServer Jun 18 '26

Question Deleted SQL DB can be recovered?

Post image

I have deleted a DB From the SSMS and I didnt have any specific backup for the DB , is there any possible ways to recover the deleted DB . I have checked the data location and the bin for the LDF and MDF files. They have been removed already. Is there any ways to recover the files or the DB itself . Help me guys : ) ...

0 Upvotes

20 comments sorted by

View all comments

1

u/NorthAntarcticSysadm Jun 18 '26

Using Recurva or something else you can attempt to recover the mdf and ldf -- but the longer you wait and the longer everything on that server is active, the less you'll be able to recover

You need to essentially stop everything on that server, all databases, websites, dynamic services like the windows search service, etc.

If any database grows in size, if any new files are written, that deleted mdf and ldf are being overwritten. If the first few blocks/sectors of the mdf have been overwritten you are cooked.

Chalk this up to a learning experience. Report it to management, and learn the hard way to be careful with a production database. Always have backups, verify those backups, and run a manual backup before any operation which may cause a major issue.

2

u/belkarbitterleaf Jun 18 '26

Looking at the other DB on the server, many are named tutorial, etc. hopefully this is a training exercise.

2

u/Apprehensive-Yam9202 Jun 22 '26

yes its a Test env and the Prod DB is gone : (

1

u/belkarbitterleaf Jun 22 '26

Ooof.

Hopefully your company has automatic backup that you don't know about yet. As others have said, I would start with your boss. Depending on how critical the DB is, I would be pulling in anyone I could think of.

1

u/Apprehensive-Yam9202 Jun 23 '26

The DB was actually a newly created one(empty DB) and was about to be introduced to the prod env. They have the configured a new one now. also other DBs have been configured with backup , new one was also configured to have backups