|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Today @ 3:44 PM
Points: 2,551,
Visits: 7,202
|
|
I needed to move the MDF to another location so I detached the database, and dragged the MDF to a new folder. I was thinking it had finished copying, so I attempted to attach it, but got an error because the MDF was in use. No surprise. After the copy finished, I tried to attach again, but now I get the error:
"Unable to open the phuysical file "F:\log\search_log.LDF Operating system error 5 "Access is denied" SQL Error 5120.
I did not make any changes to the LDF, so not quite sure why that is throwing the error.
Any suggestions ?
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Today @ 3:05 PM
Points: 150,
Visits: 1,022
|
|
| "Access is denied" check if account, on which running sql server have sufficient rights
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 4:15 PM
Points: 37,651,
Visits: 29,903
|
|
The SQL Server service does not have permissions on the log file or the directory it's in. Check the permissions, ensure that SQL Server service has full control over both folder and file.
Log file, not data file.
Gail Shaw Microsoft Certified Master: SQL Server 2008, MVP 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
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Today @ 3:44 PM
Points: 2,551,
Visits: 7,202
|
|
The permission problem seems like it would be a red herring. I had no trouble moving (detach/attach) a different database in the same folders. And I wasn't moving the log file, just the MDF.
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 4:15 PM
Points: 37,651,
Visits: 29,903
|
|
Check the permissions, the error is OS error 5, that is a permission problem. Could be that in the detach the permissions on the files were changed, I have seen that. Usually the SQL Server service retains permissions, but worth checking.
Gail Shaw Microsoft Certified Master: SQL Server 2008, MVP 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
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Today @ 3:44 PM
Points: 2,551,
Visits: 7,202
|
|
You are correct (as usual). All good now after manually putting permissions back on.
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Thursday, May 16, 2013 8:44 PM
Points: 442,
Visits: 1,300
|
|
There are a number of reasons to rather do an OFF LINE rather than a DETACH when moving database files like this. In SQL 2005 there was a particular issue with permissions being lost, but it looks like this happens ocassionally in SQL 2008 as well. I've never seen this happening using OFF LINE.
Another issue is a detach losses some database spesific configurations that are maintained in the MASTER database (e.g. cross database ownership chaining - not a recommended option), which aren't lost when an OFF LINE is used.
Cheers
Leo
|
|
|
|