Database can't be accessed ...- OFFLINE

  • Hi All ,

    I was having issue with one of my databases in SQL EXPRESS. It is offline this morning …it said “Database 'MyDB' cannot be opened due to inaccessible files or insufficient memory or disk space. See the SQL Server errorlog for details.”

    When I checked the error log ..it only said “FCB::Open failed: Could not open file D:\Databases\MyDB_Data.mdf for file number 1. OS error: 32(failed to retrieve text for this error. Reason: 15100).

    I did alter database offline and and online ..it works for me( I can access the database again but I need to find the cause of this issue )

    I checked the max memory setting is still by default .. not limited for SQL ..it could be the cause ?

    Any idea about this?

    Much appreciate !!

  • I guess the mdf file was not accessible at that point.

    Please check system events for any storage issue.

  • Thanks for the reply 🙂 That's kind of you

    hmm I checked D:\ it is 8 GB free of 10 GB and E:\ is 7 GB free of 25 GB .

    so I presume nothing wrong with system storage ...

    How do I check SYSTEM EVENTS ?

    Thank you 🙂

  • At the time SQL started and tried to open the file, it was being accessed by another process, probably a mis-configured antivirus. Hence it couldn't open the database.

    OS error 32 = "File in use by another process"

    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
  • Thanks for the reply , really appreciate it and sorry for my late response ..

    Actually the database AUTOCLOSE setting is TRUE. Would it be the cause ?

    Cheers,

  • Yes, that's one of the most BAD practices. Never set AUTOCLOSE to TRUE.

    With Thanks,

    Satnam

  • WhiteLotus (4/16/2015)


    Actually the database AUTOCLOSE setting is TRUE. Would it be the cause ?

    Not a direct cause, no. But if you have a mis-configured antivirus or some other process that, for whatever reason, tries to read the SQL data files, autoclose increases the chance of something going wrong as SQL repeatedly closes and opens the database based on usage.

    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
  • I see. Thanks for the explanation . I will change the autoclose option soon !

    Have a nice weekend 🙂

  • In case you didn't get the hint :-), you need to check the config of the anti-virus. There are plenty of articles (including a kb article from Microsoft) that details how an antivirus should be set up on a SQL Server machine.

    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
  • Excellent . Thank you !

Viewing 10 posts - 1 through 9 (of 9 total)

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