Sql文件权限 [英] Sql file permissions

查看:284
本文介绍了Sql文件权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

希望有人在这里可以提供帮助......



我们的C:在我们的一台服务器上的驱动器有点满,所以我们决定尝试重新定位SQL数据库到同一台机器上的另一个驱动器。 SQL 2016 - Windows Server 2016.请注意,这是在Hyper-V下运行的虚拟服务器。



我们按照说明分离数据库,然后将文件复制到所需的位置,然后重新附加数据库。



除了数据库设置为只读外,这一切似乎都有效。

当尝试在选项中将只读设置为False时,我们收到错误消息,说明权限不足且状态无法更改。



阅读一百万篇帖子关于这一点,每个人都建议我们需要为NT服务/ MSSQLSERVER添加完整权限。

这听起来很合理,但安全选项卡无法识别ant NT服务条目。



查看正在运行的服务,它肯定会将其用作服务登录,那么为什么我们在尝试允许完全访问移动的文件时不能选择它?



我们勾选方框以显示服务帐户但仍然没有这件事。



这次我犯了什么愚蠢的错误?



谢谢



我尝试过:



尝试通过文件添加权限>属性>安全设置但无法找到SQL服务器帐户。

解决方案

过去我总是发现直接复制SQL Server数据库文件是在寻找麻烦,而不是最好a 备份并恢复它。



这个StackOverflow答案可能正是您要找的:复制数据库的最佳方法(SQL Server 2008) - Stack Overflow [ ^ ]

Hope someone on here can help...

Our C: drive on one of our servers is getting a bit full so we decided to try to relocate the SQL databases to another drive on the same machine. SQL 2016 - Windows Server 2016. Note that this is a virtual server running under Hyper-V.

We followed the instructions to Detach the database, then copy the files to the desired location and then re-attach the database.

This all seemed to work except the database was set to 'Read Only'.
When trying to set read only to False in the options we got an error saying that there were insufficient permissions and the state could not be changed.

Reading a million posts about this everyone suggests that we need to add full permissions to NT Service/MSSQLSERVER.
That sounds reasonable but the security tab does not recognise ant NT Service entries.

Looking at the running services it definitely uses this as the service log on so why can we not select it when trying to allow full access to the moved files?

We ticked the box to show service accounts but still nothing.

What stupid mistake have I made this time?

Thanks

What I have tried:

Tried to add permissions via the file > properties > security settings but cannot find the SQL server account.

解决方案

In the past I always found that copying SQL Server database files directly was looking for trouble, instead it's better to make a backup and restore that.

This StackOverflow answer might be what you are looking for: Best way to copy a database (SQL Server 2008) - Stack Overflow[^]


这篇关于Sql文件权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆