恢复 SQL Server 备份时出现问题
我有一个 SQL Server 2008,它是域的一部分。现在,我对此服务器的数据库进行备份,并将其恢复到不属于域的 SQL Server 上。 我有一个使用此数据库的C# 应用程序。在非域计算机上,我现在收到如下异常:
“无法作为数据库主体执行,因为主体“dbo”不存在,这种类型的主体不能被模拟,或者您不没有权限”
我认为,问题是,数据库所有者是域用户,并且该用户在目标计算机上不存在(备份机)!?我该如何解决这个问题?
I have a SQL Server 2008, which is part of a domain. Now I make a backup of a database of this server and restore it on a SQL Server, which is not part of a domain.
I have an C# application, which uses this database. On the NON-Domain machine I get now exceptions like this:
"Cannot execute as the database prinzipal because the principial "dbo" does not exist, this type of principal cannot be impersonatedm or you don not have the permission"
I think, the problem is, that the database owner is a domain user and this user doesn't exist on the target machine (backup machine)!? How can I solve this ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
MS SQL 服务器遵循 2 层用户系统。
您必须确保您的登录名是 SQL Server 上的实际登录名(这是指 SQL Server 本身而不实际数据库的登录名)。
您可以在 Management Studio 中的以下位置找到 SQL Server 用户:
服务器根->安全性 - 登录
确保您的登录可用后,您必须将其映射到用户/架构。为此,您必须:
The MS SQL server follows a 2 layer user system.
You must make sure that your login is an actual login on the SQL Server (this refers to the SQL Server itself NOT to the actual database).
You find the SQL Server users in the Management Studio under:
Server root -> Security - Logins
After you ensured that your login is available you have to map it to a user/schema. In Order todo so you must: