locked
MDF and LDF files not removed after DELETED or DROP databases RRS feed

  • Question

  • Recently, we noticed many .mdf and .ldf files didn't get removed after DELETE databases on our SQL Server 2005/2008.

    1. Those databases have been removed successfully from their instances in last two years either via GUI (SSMS--Databases--Delete) or TSQL (DROP database 'UserDB');

    2. Those databases are not listed in existing instances if "select * from sys.databases or sys.master_files";

    3. Those .mdf and .ldf can be deleted from NTFS folders directly (they are not orphaned databases).

    4. Unfortunately, I am not able to re-produce it anymore.

    Any helps to this question would be appreciated.


    • Edited by Nasha Tuesday, July 17, 2012 5:15 PM
    Tuesday, July 17, 2012 5:08 PM

Answers

  • Hi Nasa,

    This can happen if database if offline at the time of deletion/dorp...In this case files are not removed from filesystem.


    - Chintak (My Blog)

    • Marked as answer by Nasha Tuesday, July 17, 2012 6:10 PM
    Tuesday, July 17, 2012 6:03 PM

All replies

  • Hi Nasa,

    This can happen if database if offline at the time of deletion/dorp...In this case files are not removed from filesystem.


    - Chintak (My Blog)

    • Marked as answer by Nasha Tuesday, July 17, 2012 6:10 PM
    Tuesday, July 17, 2012 6:03 PM
  • Hi Chintak,

    Great thanks for the knowledge transfer. Yes, that explained.  :-)


    Nasha

    Tuesday, July 17, 2012 6:10 PM