简体   繁体   English

SQL Server 2008 - 附加没有日志的 mdf - 操作系统错误 5:5(访问被拒绝。)

[英]SQL Server 2008 - Attach mdf without log - Operating system error 5: 5(Access is denied.)

I am trying to attach database without log file.我正在尝试在没有日志文件的情况下附加数据库。

Attach a SQL Server database with a missing transaction log file 附加缺少事务日志文件的 SQL Server 数据库

Error on SSMS SSMS 上的错误

在此处输入图片说明

Error on TSL TSL 上的错误

Msg 5120, Level 16, State 101, Line 1 Unable to open the physical file "....mdf".消息 5120,级别 16,状态 101,第 1 行无法打开物理文件“....mdf”。 Operating system error 5: "5(Access is denied.)".操作系统错误 5:“5(访问被拒绝。)”。

I'm not sa, but I'm in sysadmin role.我不是 sa,但我是 sysadmin 角色。 I'm not really sure what access permission I need.我不确定我需要什么访问权限。 Or is it because the .mdf is corrupted?还是因为.mdf已损坏?

在此处输入图片说明

Thank in advance!预先感谢!

That's a bug in the SSMS interface.这是 SSMS 界面中的一个错误。 It can be done using T-SQL.它可以使用 T-SQL 来完成。 Just don't include the log file in the list of files.只是不要在文件列表中包含日志文件。

exec sp_attach_db 'dbname', 'filename'

sp_attach_db (Transact-SQL) sp_attach_db (Transact-SQL)

以管理员身份启动SQL Server管理器(右键程序,选择“以管理员身份启动”):问题解决!

I am trying to attach database without log file.我正在尝试附加没有日志文件的数据库。

Attach a SQL Server database with a missing transaction log file 附加缺少丢失的事务日志文件的SQL Server数据库

Error on SSMS SSMS上的错误

在此处输入图片说明

Error on TSL TSL错误

Msg 5120, Level 16, State 101, Line 1 Unable to open the physical file "....mdf".消息5120,级别16,状态101,第1行无法打开物理文件“ .... mdf”。 Operating system error 5: "5(Access is denied.)".操作系统错误5:“ 5(拒绝访问。)”。

I'm not sa, but I'm in sysadmin role.我不是sa,但我是sysadmin角色。 I'm not really sure what access permission I need.我不确定我需要什么访问权限。 Or is it because the .mdf is corrupted?还是因为.mdf已损坏?

在此处输入图片说明

Thank in advance!预先感谢!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 SQL 服务器操作系统错误 5:“5(拒绝访问。)” - SQL Server Operating system error 5: "5(Access is denied.)" SQL备份错误(操作系统错误5(拒绝访问。)) - SQL backup error (Operating system error 5(Access is denied.)) sp_attach_single_file_db 错误:因操作系统错误 5 失败(访问被拒绝。) - sp_attach_single_file_db Error: failed with the operating system error 5(Access is denied.) 无法打开物理文件。 操作系统错误 5:“5(拒绝访问。)” - Unable to open the physical file. Operating system error 5: "5(Access is denied.)" Azure blob 到 Azure SQL 数据库:无法批量加载,因为无法打开文件“xxxx.csv”。 操作系统错误代码 5(访问被拒绝。) - Azure blob to Azure SQL Database: Cannot bulk load because the file "xxxx.csv" could not be opened. Operating system error code 5(Access is denied.) 如何将.mdf文件附加到SQL Server 2008 EXPRESS - how to attach .mdf file to sql server 2008 EXPRESS 如何修复RegCreateKeyEx()返回错误5,'访问被拒绝。 在SQL Server 2017中 - How to fix RegCreateKeyEx() returned error 5, 'Access is denied.' in SQL Server 2017 开头:带有mdf文件的SQL Server 2008 Express - beginning: sql server 2008 express with mdf file 访问错误 sql 服务器 2008 - access error sql server 2008 SQL Server 2012 Management Studio MDF文件的无附加选项 - SQL Server 2012 Management Studio no attach option for mdf files
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM