Solved

Detach database that has missing data and log file

Posted on 2009-04-08
3
839 Views
Last Modified: 2012-05-06
I was deleting some temporary created and detached databases and accidentally deleted database that is also temporary but not detached (I don't know why the deletion succeeded because it was used by the SQL server). The deletion was from network share and I don't have the files any more. Now I have reference to nonexistent database that I would like to delete and I can't do it from SQL server management studio.
Are the database files protected from deletion from SQL server itself or they simply can't be deleted because they are in use by the server and when no one used the database for a long time, it is possible to delete them?
0
Comment
Question by:Znasev
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 23

Expert Comment

by:adathelad
ID: 24104822
AFAIK, you can't delete the mdf/ldf files for a database that is still attached as SQL Server prevents it?? Was the SQL Server instance running at the time you deleted them? Perhaps it wasn't and so that may be why you was able to delete.
0
 

Author Comment

by:Znasev
ID: 24104851
Yes, the server was running. It was early in the morning, and nobody used it overnight and I guess that is why the system let me delete it. After deleting the files, I successfully connected to the server, and I saw that the database was actually not detached.
0
 

Accepted Solution

by:
Znasev earned 0 total points
ID: 24105235
I checked the server again later and the reference to missing database files is gone. I guess the server cleaned it up.
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

There are some very powerful Data Management Views (DMV's) introduced with SQL 2005. The two in particular that we are going to discuss are sys.dm_db_index_usage_stats and sys.dm_db_index_operational_stats.   Recently, I was involved in a discu…
I've encountered valid database schemas that do not have a primary key.  For example, I use LogParser from Microsoft to push IIS logs into a SQL database table for processing and analysis.  However, occasionally due to user error or a scheduled task…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question