RE: Get permission error after mdb move.



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

.


Quantcast