Serious Issue

  • Hi All

    Am having a serious problem...Am able to delete the mdf and ldf files of databases in my server even if they are online.Am using SQL Server 2005 Developer Edition.Can anyone tell a solution or reason for this issue....

    Thanks in Advance

  • Strange, Once you delete it , is the database still working?

    Did you check the file path of the DB to make sure that the file you are able to delete is the right MDF and LDF file.

    -Roy

  • Is the DB set to autoclose? Is it offline?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Databases not offline and ...if i delete mdf and ldf then am not able to access the database.but if i restore the database with a dump then mdf and ldf are recreated.

  • Is the DB set to autoclose?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • How to check whether the DB is in AUTOCLOSE or not and if so how to change that....

  • In SSMS you can navigate to the DB right-click -> properties -> Options. It is the top option.

    OR

    exec sp_dboption [dbname], 'autoclose'

  • Also you can uses the query command from SSMS

    ALTER DATABASE SET Auto_close on|off to set the database to autoclose on of off status

  • Am using SQL SERVER Developer Edition i didnt find any such AUTOCLOSE option in property window of DB.How can i check the present status of AUTOCLOSE?? Is there any TSQL Command to see that????

  • Ya i find that in OPTIONS ..It is presently FALSE.

  • Are you sure the SQL Server service is running when you are doing the deletes?

  • Thanks Dude it worked..

    Those DB having autoclose option False are not able to delete only those set to true got deleted.

  • Autoclose means that when the last connection is dropped from a DB, the DB is shut down cleanly, just as if the server had shut down. While the DB is closed, SQL keeps no file locks on the mdf and ldf files, as they're not in use.

    It's recommended that autoclose is off, due partially to the time it takes to reopen and bring active a DB. Especially if the DB gets bursts of activity mixed with periods of idleness.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 13 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic. Login to reply