RE: Get permission error after mdb move.

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



You can give the Network Service account that Express is running under rights
to the folder on D: with the data files using Windows Explorer. In general it
is better to fix a permission problem by giving access to a needed resource
instead of changing the account an application is using to access the
resource. Check the security permissions that were granted to the folder on
C: where the data file originally resided.
The rights to access the data files could have been granted using a special
group created for SQL Server. If that is the case, give that group the rights
to the folder on D. Is SQLServer2005MSSQLUser$SERVER909$SQLEXPRESS in the
security list for the folder on C but not the folder on D?
LocalSystem is a very high privilidged account similar to being an
administrator. These days it is best not to run services under that account.
It would be similar to how people ran everything using the administrator
account in the past to "solve" all security issues.
LocalService and Network Service are both low privilidged accounts. The
difference is that the Network Service account can be used to touch a
resource on a different server.

Chris Dickey
FastSqlServer.com

"Brian Smither" wrote:

Using this MSDN page:
http://msdn.microsoft.com/en-us/library/ms345483(SQL.90).aspx
I went through moving two databases, AdventureWorks and another one, both
located on drive C: and attached to an instance of SQL Server 2005
Enterprise. I successfully moved them to D: and they are working fine.

However, I did the same thing to another mdb (and ldf), C: to D:, that
was attached to SQL Server 2005 Express.

When I SET ONLINE, I get:
Msg 5120, Level 16, State 101, Line 1
Unable to open the physical file "D:\file.mdf".
Operating system error 5: "5(Access is denied.)".
....
File activation failure. The physical file name
"D:\file_log.ldf" may be incorrect.
Msg 945, Level 14, State 2, Line 1
Database 'File' 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 1
ALTER DATABASE statement failed.

Event 17207 Category 2
FCB::Open: Operating system error 5(Access is denied.) occurred while
creating or opening file 'D:\file.mdf'. Diagnose and correct the
operating system error, and retry the operation.

Enterprise is logged on as LocalSystem and Express is logged on as
Network Service. I am logged in via RDP /console as the Chief Kahuna
Administrator.

Who is not getting permission?

SQLServer2005MSSQLUser$SERVER909$SQLEXPRESS is the user that needed
permission, that's who!


--
Remove INVALID from e-mail address.

Brian Smither
Smither Consulting

.



Relevant Pages

  • Re: dts and access db
    ... How can I setup permission for sa account under \\server\data folder? ... The service account for SQL Server ... >>already opened exclusively by another user, or you need permission to view ...
    (microsoft.public.sqlserver.dts)
  • Re: Access to temp folders?
    ... > I have given Network Service id access to the folder where the aspx ... > folder as the real one, ... >> The application is a DLL and an is invoked with an aspx file. ... >> runs under the Network Service account. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Install SQL Server 2008 Questions ....
    ... Network Service or System. ... you should have a domain account that sql server runs ... When we choose "Mixed Authentication", it seems that we are not able to ... Does SA not longer exist in SQL Server 2008? ...
    (microsoft.public.sqlserver.server)
  • Re: could not read file snapshot.pre due to OS error 5
    ... Is the snapshot folder shared? ... the SQL Server Agent account or the account you are impersonating with have ... Looking for a SQL Server replication book? ...
    (microsoft.public.sqlserver.replication)
  • Re: NT AUTHORITYANONYMOUS LOGON --- SQL server
    ... > account the system works fine. ... I am trying to test as a network service ... use the "Machine account" credentials when authenticating over the ... credentials, when challenged by the remote SQL server, the credentials are ...
    (microsoft.public.dotnet.languages.csharp)