sql server 2008 r2 restore DB返回error 5
来源:互联网 发布:linux tar解压命令 编辑:程序博客网 时间:2024/05/21 22:40
在sql servrver 2008 r2上restore db时碰到了好几次出现返回5(access is denied)的错误,错误信息如下:
solution(转载自http://www.conetrix.com/Blog/post/5(Access-is-denied)-Error-Restoring-SQL-Server-2005-Database.aspx):
System.Data.SqlClient.SqlError: The operating system returned the error '5(Access is denied.)' while attempting 'RestoreContainer::ValidateTargetForCreation' on 'c:\Program Files\Microsoft SQL Server\MSSQL.2\MSSQL\[my database name].mdf'. (Microsoft.SqlServer.Express.Smo)
I searched the Internet using the error message and found several posts stating that it was a problem with the privileges of the user account that my SQL Server Express service was running as. I hadn't changed the account it was running as and I had restored other databases in the past, but I checked the SQL Server Configuration Manager anyway. As I suspected the service was still running as the default account (Network Service), so that wasn't it.
After I couldn't find a quick fix on the Internet I decided to look around the options in the Restore Database window. It turns out the problem was with the paths under the restore options. The backup was trying to restore the .mdf and .ldf files to the c:\Program Files\Microsoft SQL Server\MSSQL.2\MSSQL\ directory. The instance of SQL Server I was working with was storing all it's data files in C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\. Once I changed the paths for the database file and log file to be the same as where my other database files were being stored the restore ran fine with no errors. For additional reference, here is an article that explains the naming of folders for SQL Server 2005 instances:http://weblogs.sqlteam.com/tarad/archive/2006/06/07/10114.aspx
- sql server 2008 r2 restore DB返回error 5
- SQL Server 2008 R2 error: sa 18456
- Sql Server 2008 R2 error:40 错误处理
- SQL Server 2008 r2 Error:926应急处理方法
- SQL Server 2008 R2: error 26 开启远程连接
- SQL server 2008 R2 MSSQLSERVER 无法启动 error code 17058.
- 连接SQL Server 2008 R2 error 40处理方法
- SQL Server 2008 R2
- SQL Server 2008 R2
- SQL Server 2008 R2
- SQL Server 2008 、 SQL Server R2 版本号
- RESTORE DATABASE is terminating abnormally. (Microsoft SQL Server, Error: 3154)
- RESTORE DATABASE is terminating abnormally. (Microsoft SQL Server, Error: 3154)
- SQL Server 2008 R2 安装
- SQL Server 2008 R2 序列号
- SQL Server 2008 R2修复
- SQL Server 2008 R2 下载
- SQL Server 2008 R2 安装
- Android 混淆代码学习以及Android加密工具--APKProtect的使用
- 重建、合并、删除索引
- /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
- Liunx每日一问】在Linux中,如何结束多个进程
- 从WekaWiki上的一个文本聚类的示例开始(2)
- sql server 2008 r2 restore DB返回error 5
- JS: Casting string to Date
- 第一部分:Twisted理论基础
- hadoop两表join相关
- 两种最远曼哈顿距离模板
- 第二部分:异步编程初探与reactor模式
- 第28期状元简讯:百度首款金融产品月底上线 或将与支付产品打通
- 第三部分:初步认识Twisted
- 数据库:JDBC+DBCP