Results 1 to 6 of 6
  1. #1
    New Lounger
    Join Date
    Feb 2011
    Posts
    5
    Thanks
    3
    Thanked 0 Times in 0 Posts

    MSSQL - Delete a Database

    Can anyone tell me what happens when I delete a database in MSSQL? Are the MDF and LDF files removed properly, or just marked as deleted? To be secure should I detach the files and destroy them securely? Is there a better way to be sure?
    Thanks

  2. #2
    Star Lounger
    Join Date
    Sep 2002
    Location
    Hastings, Sussex, England
    Posts
    67
    Thanks
    0
    Thanked 1 Time in 1 Post

    Depends what you mean by 'secure'

    Microsoft says: When a database is deleted, the files and their data are deleted from the disk on the server. When a database is deleted, it is permanently removed and cannot be retrieved without using a previous backup.

    http://msdn.microsoft.com/en-us/library/ms189278.aspx

    There are, of course, utilities that can recover 'deleted' files, and the only way to be sure would be to overwrite the area on the disk(s) several times with rubbish.

    Look at the efforts the Government has taken to destroy the National Identity Register:

    http://www.computerweekly.com/Articl...-destroyed.htm

    Regards,

    Jules

  3. The Following User Says Thank You to JulesG For This Useful Post:

    Troika (2011-02-11)

  4. #3
    New Lounger
    Join Date
    Feb 2011
    Posts
    5
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Thanks, but my question is what does Microsoft mean? Talking about the recycle bin it says 'must explicitly delete the files from the Recycle Bin to make the deletion permanent'. There seem to be a lot of tools around suggesting they can recover even those files, or at least some of the content, subject to what is over written.

  5. #4
    Administrator
    Join Date
    Mar 2001
    Location
    St Louis, Missouri, USA
    Posts
    23,594
    Thanks
    5
    Thanked 1,059 Times in 928 Posts
    Database files are no different than any other file when it comes to how they are treated by the OS on deletion. While they may not be put in the recycle bin, the entries in the MFT are marked as deleted. Until the space is re-used the data is still there. Yes, there are programs that can recover this data until it is over written.

    Joe

  6. The Following User Says Thank You to JoeP517 For This Useful Post:

    Troika (2011-02-11)

  7. #5
    New Lounger
    Join Date
    Feb 2011
    Posts
    5
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Thanks - that confirms what I had guessed

  8. #6
    WS Lounge VIP
    Join Date
    Dec 2009
    Location
    Earth
    Posts
    8,203
    Thanks
    49
    Thanked 989 Times in 919 Posts
    I would overwrite the data with an update query, then drop the database.
    Log files are much harder as they are just sequential writes and you really need to overwrite the file space.
    The easiest method is to provide physical security for the server and erase the disks securely (with DBAN) once finished.
    Alternatively, use something like Eraser to overwrite the files.

    cheers, Paul
    Last edited by Paul T; 2011-02-12 at 11:53.

  9. The Following User Says Thank You to Paul T For This Useful Post:

    Troika (2011-02-14)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •