Has Anyone Used SAN Snapshot To Restore Database To A Developer Server? Permissions Issue?

  • Hi,

    I'm trying to do this, but running into this error message:

    Msg 3415, Level 16, State 5, Line 1
    Database 'DB_Dev' cannot be upgraded because it is read-only, has read-only files or the user does not have permissions to modify some of the files. Make the database or files writeable, and rerun recovery.
    Msg 1813, Level 16, State 2, Line 1
    Could not open new database 'DB_Dev'. CREATE DATABASE is aborted.

    I added the SQL Server account, domain admins (which I'm a part of), and the NT Service\MSSQLSERVER account and none of those accounts allowed me to attach the database.  

    A little background:
    Took a SAN Snapshot of the production database and attempting to bring it up on a different developer server.  Production database is Enterprise Edition and Developer server has Developer Edition.  
    Production database is part of an AG.  Not sure if that affects this or not.  

    I'm completely baffled.  Any help is GREATLY appreciated!

    Thank you!

  • I've had this problem frequently on Compellent* SAN's where by a Replay (Snapshpot in Compellent parlance) that was turned into a LUN would mark all the files as READ ONLY. Simply changing this property on the files was sufficient to make it work. As to whether this is by design or a misconfiguration I am not sure and never really got the bottom of before leaving that company.

    * This was Compellent before it got bought out by DELL

  • Continued from https://www.sqlservercentral.com/Forums/1879185/Attach-Database-Question

    Did you speak to the SAN admin? What did they say?

    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
  • Haha!  I'm the admin of all infrastructure stuff...  If I asked myself, I would've said: ¯\_(?)_/¯

    So I figured it out!  It wasn't a permissions issue.  It was a disk issue.  

    I originally typed this in diskpart:
    attributes volume clear readonly
    attributes volume clear hidden

    But I needed to run this command as well:
    attributes disk clear readonly

    And now I am able to attach the database.  I made sure that that one command was the resolution by redoing the whole snapshot/attach process without fiddling with permissions.

Viewing 4 posts - 1 through 3 (of 3 total)

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