Error encountered during creation of databases: CREATE FILE encountered operating system error 5(Access is denied.)

  • Error messages:

    CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file 'S:\SQL\userdblog01\test_log.LDF'.

    CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file 'S:\SQL\userdbdata01\test.mdf'.

    The create database script that I try to run as a member of sysadmin and local windows admin:

    CREATE DATABASE [test] ON PRIMARY

    ( NAME = N'test', FILENAME = N'S:\SQL\userdbdata01\test.mdf' , SIZE = 3072KB , FILEGROWTH = 1024KB )

    LOG ON

    ( NAME = N'test_log', FILENAME = N'S:\SQL\userdblog01\test_log.ldf' , SIZE = 3072KB , FILEGROWTH = 10%)

    GO

    And I am sure both SQL Server service account and SQL Server agent service account have full control privileges on both folder 'S:\SQL\userdbdata01\' and 'S:\SQL\userdblog01\'.

    Is there anything else that I might have missed?

    Thanks in advance!

    Bazinga!

  • Is that a local drive, a SAN, a network drive, something else?

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • sqlapprentice (7/19/2011)


    And I am sure both SQL Server service account and SQL Server agent service account have full control privileges on both folder 'S:\SQL\userdbdata01\' and 'S:\SQL\userdblog01\'.

    Do you think you're sure or have you checked?

    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
  • just my 2ct:

    Is this on a cluster ?

    Did you create the dependency for the S drive for your sqlserver instance ?

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • GilaMonster (7/19/2011)


    sqlapprentice (7/19/2011)


    And I am sure both SQL Server service account and SQL Server agent service account have full control privileges on both folder 'S:\SQL\userdbdata01\' and 'S:\SQL\userdblog01\'.

    Do you think you're sure or have you checked?

    Yes, I checked and I even restarted the sql server service.

    Bazinga!

  • ALZDBA (7/19/2011)


    just my 2ct:

    Is this on a cluster ?

    Did you create the dependency for the S drive for your sqlserver instance ?

    Not a cluster.

    Bazinga!

  • I'm guessing that this isn't as simple as the file exists already and SQL can't overwrite it or the folder name being named wrong.

    I don't see a response to whether or not this is a local drive. If it's a mapped drive I'm pretty sure SQL doesn't like that.

  • cfradenburg (7/19/2011)


    I'm guessing that this isn't as simple as the file exists already and SQL can't overwrite it or the folder name being named wrong.

    I don't see a response to whether or not this is a local drive. If it's a mapped drive I'm pretty sure SQL doesn't like that.

    It is a mapped volume (mount point) from SAN, and that "test" database doesn't exist yet.

    Any other suggestions?

    Bazinga!

  • The user that you are using don't have access to the file system.

    Grant yourself relevenat permissions on the drive you want to create the DB on.

    Cheers

    Jannie

  • Jannie-186227 (7/19/2011)


    The user that you are using don't have access to the file system.

    Grant yourself relevenat permissions on the drive you want to create the DB on.

    Cheers

    Jannie

    I am using remote desktop as a local windows admin on that server and can perfect create any other files under S: drive and its subfolders.

    Bazinga!

  • GSquared (7/19/2011)


    Is that a local drive, a SAN, a network drive, something else?

    It is a volume mount point from SAN.

    Bazinga!

  • A similar post

    http://www.sqlservercentral.com/Forums/Topic366456-357-1.aspx#bm1035748

    Jayanth Kurup[/url]

  • operating system error 5 is pretty clear. The SQL Server services user does not have access to the file\folder. Please check the NTFS ACLs and post a screenshot. Alternatively, use this link and install XCACLs utility and perform a dump of permissions from 'S:\SQL\userdbdata01\'

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • Jayanth_Kurup (7/20/2011)


    A similar post

    http://www.sqlservercentral.com/Forums/Topic366456-357-1.aspx#bm1035748%5B/quote%5D

    I've checked this post before I even put up this one.

    It didn't help.

    Bazinga!

  • Perry Whittle (7/20/2011)


    operating system error 5 is pretty clear. The SQL Server services user does not have access to the file\folder. Please check the NTFS ACLs and post a screenshot. Alternatively, use this link and install XCACLs utility and perform a dump of permissions from 'S:\SQL\userdbdata01\'

    Thanks for recommending this tool.

    I've tried it and all displayed access rights do prove that sql server service accounts have full control over S:\, S:\SQL\ and S:\SQL\userdbdata01\ and S:\SQL\userdblog01\ and all their subdirectories.

    Bazinga!

Viewing 15 posts - 1 through 15 (of 23 total)

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