Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Tonekene
Starting Member
6 Posts |
Posted - 2014-09-04 : 12:42:51
|
hiis there an easy way to find out if I have mdf and ldf files that don't belong to any db?thanks |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2014-09-04 : 12:46:57
|
You can use Process Explorer (separate download) to determine if the file is in use. If it's not in use, you can delete it. You can also try deleting each file. It'll error if it's in use by the SQL Server service or anything else.Tara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2014-09-04 : 12:47:41
|
By the way, SQL Server cleans itself up if you drop a database that was not offline. If it was offline and you drop it, the files remain in place. If I am going to drop an offline database, I will bring it online first so that the file cleanup occurs.Tara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
|
|
Tonekene
Starting Member
6 Posts |
Posted - 2014-09-04 : 12:49:34
|
Thank you for a quick response. we do take dbs offline and then delete so we have this issue. |
|
|
Shanky
Yak Posting Veteran
84 Posts |
Posted - 2014-09-16 : 06:55:37
|
You can try copying it, if data and log file is being used it would give errorHope this helpsRegardsShankyhttp://social.technet.microsoft.com/wiki/contents/articles/24253.list-of-articles-by-shanky.aspx |
|
|
|
|
|