unable to get DB online

  • i had changed the path of NDF files and when i set DB online its showing error

    Msg 945, Level 14, State 2, Line 2

    Database '365_AppNexus_ODS' cannot be opened due to inaccessible files or insufficient memory or disk space. See the SQL Server errorlog for details.

    Msg 5069, Level 16, State 1, Line 2

    ALTER DATABASE statement failed.

    in Error log :

    FileMgr::StartSecondaryDataFiles: Operating system error 2(The system cannot find the file specified.) occurred while creating or opening file 'D:\Program Files\Microsoft SQL Server\MSSQL10_50.IDESK\MSSQL\DATA\365_Appnexus_ODS_FG1'. Diagnose and correct the operating system error, and retry the operation.

    when i check the folder its having read only permission and unable to change the permission (no access privileges)

    how can i get the DB online ??

  • Dear Santosh,

    As the error suggest you have to give read/Write permission to the SQL on the Folder havnig ndf file. Alternatively you can try and move the ndf file to a location where you have rest of your SQL Data and LOG files stored.

    Regards

    Shafat Husain

    Regards,
    Shafat Husain
    🙂
    And Your Lord Never Forgets...!! (64:19 -- Quran)

  • Thanks Husain

    if i change to default folder does it work ??

    which also have read only access to the folder

  • It will work provided you are able to access the databases stored in that folder.

    Also i would first try and give Read/Write Permission on the Existing folder where you have you ndf file stored and consider moving the file as a last resort.

    Hope it helps.

    Regards

    Shafat Husain

    Regards,
    Shafat Husain
    🙂
    And Your Lord Never Forgets...!! (64:19 -- Quran)

  • It's not permissions (that would be an OS error 5)

    From the error posted:

    FileMgr::StartSecondaryDataFiles: Operating system error 2(The system cannot find the file specified.) occurred while creating or opening file 'D:\Program Files\Microsoft SQL Server\MSSQL10_50.IDESK\MSSQL\DATA\365_Appnexus_ODS_FG1'.

    It looks like when the ALTER DATABASE was run to change the path, the file extension was omitted. Re-run the ALTER DATABASE and make sure you specify the complete file name and path, so 'D:\Program Files\Microsoft SQL Server\MSSQL10_50.IDESK\MSSQL\DATA\365_Appnexus_ODS_FG1.ndf', assuming that's all that's missing.

    Alternately, rename the file to match what's in the catalog in order to get the DB online, then fix both the catalog (via ALTER DATABASE) and the file name.

    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 5 posts - 1 through 4 (of 4 total)

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