无法安装数据库图支持对象...没有有效的所有者

发布于 2024-08-17 10:23:10 字数 652 浏览 7 评论 0原文

我尝试使用 SQL Server 2008 创建数据库图表,但出现错误:

数据库图支持对象 无法安装,因为这个 数据库没有有效的所有者。 要继续,请首先使用“文件”页面 数据库属性对话框的 或 ALTER AUTHORIZATION 语句 将数据库所有者设置为有效 登录,然后添加数据库图 支持对象。

然后我尝试了以下操作:

EXEC sp_dbcmptlevel 'Ariha', '90';
GO
ALTER AUTHORIZATION ON DATABASE::Ariha TO [WIN-NDKPHUPPNFL\Administrator]
GO
USE Ariha
GO
EXECUTE AS USER = N'dbo' REVERT
GO

弹出下一个错误:

消息 15404,第 16 级,状态 11,第 1 行 无法获取有关信息 Windows NT 组/用户 “WIN-NDKPHUPPNFL\管理员”,错误 代码0x534。

问题是PC的名称已更改为“DevPC”我也在更新脚本中更改了此名称,但仍然是相同的错误15404。

我该怎么做才能解决这个恼人的错误?

I tried to create a database diagramm with SQL Server 2008, but an error occurs:

Database diagram support objects
cannot be installed because this
database does not have a valid owner.
To continue, first use the Files page
of the Database Properties dialog box
or the ALTER AUTHORIZATION statement
to set the database owner to a valid
login, then add the database diagram
support objects.

Then I tried the following:

EXEC sp_dbcmptlevel 'Ariha', '90';
GO
ALTER AUTHORIZATION ON DATABASE::Ariha TO [WIN-NDKPHUPPNFL\Administrator]
GO
USE Ariha
GO
EXECUTE AS USER = N'dbo' REVERT
GO

Next erorr pops up:

Msg 15404, Level 16, State 11, Line 1
Could not obtain information about
Windows NT group/user
'WIN-NDKPHUPPNFL\Administrator', error
code 0x534.

The Problem is the name of the PC has changed into "DevPC" I also changed this in the update script, but still the same error 15404.

What can I do to fix this annoying error?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(14

秉烛思 2024-08-24 10:23:10

在 SQL Server Management Studio 中执行以下操作:

  1. 右键单击​​数据库,选择属性
  2. 转至选项页
  3. 在右侧标有“兼容级别”的下拉列表中选择“SQL Server 2005(90)”
    3-1.如果收到比较错误,请选择“SQL Server 2008”。
  4. 转到文件页面
  5. 在所有者文本框中输入“sa”。
    5-1 或单击省略号 (...) 并选择合法所有者。
  6. 执行此操作后点击“确定”

,您现在将能够访问数据库图表。

在此处输入图像描述

In SQL Server Management Studio do the following:

  1. Right Click on your database, choose properties
  2. Go to the Options Page
  3. In the Drop down at right labeled "Compatibility Level" choose "SQL Server 2005(90)"
    3-1. choose "SQL Server 2008" if you receive a comparability error.
  4. Go to the Files Page
  5. Enter "sa" in the owner textbox.
    5-1 or click on the ellipses(...) and choose a rightful owner.
  6. Hit OK

after doing this, You will now be able to access the Database Diagrams.

enter image description here

情定在深秋 2024-08-24 10:23:10

您应该考虑使用 SQL 身份验证帐户来获取数据库所有权;那么您就不必担心帐户的来来去去、数据库或实例移动到不同的服务器以及您的下一个 PC 名称更改。我有几个使用的系统:

ALTER AUTHORIZATION ON DATABASE::Ariha TO [sa];

或者如果您想将所有者更改为该本地管理员帐户,那么应该是:

ALTER AUTHORIZATION ON DATABASE::Ariha TO [DevPC\Administrator];

因为将计算机重命名为 DevPC 已经消除了以前命名的本地帐户WIN-ND...\Administrator 这也使数据库的当前所有者失效。

如果 SELECT @@SERVERNAME; 不准确(应该是 DevPC),那么为了确保您的服务器重命名已在 SQL Server 中生效,您可能还需要发出以下文件:

EXEC sys.sp_dropserver @server = N'old server name';
GO
EXEC sys.sp_addserver @server = N'DevPC', @local = N'local';
GO

You should consider SQL authentication account for database ownership; then you don't have to worry about accounts coming and going, databases or instances moving to different servers, and your next PC name change. I have several systems where we use:

ALTER AUTHORIZATION ON DATABASE::Ariha TO [sa];

Or if you want to change the owner to that local Administrator account, then it should be:

ALTER AUTHORIZATION ON DATABASE::Ariha TO [DevPC\Administrator];

Because renaming the machine to DevPC has eliminated the local account that used to be named WIN-ND...\Administrator and this has also invalidated the current owner of the database.

If SELECT @@SERVERNAME; is not accurate (it should say DevPC), then in order to ensure that your server rename has taken hold within SQL Server, you may also want to issue the following:

EXEC sys.sp_dropserver @server = N'old server name';
GO
EXEC sys.sp_addserver @server = N'DevPC', @local = N'local';
GO
过潦 2024-08-24 10:23:10
USE [ECMIS]
GO
EXEC dbo.sp_changedbowner @loginame = N'sa', @map = false
GO

有用。

USE [ECMIS]
GO
EXEC dbo.sp_changedbowner @loginame = N'sa', @map = false
GO

It works.

〃温暖了心ぐ 2024-08-24 10:23:10

选择您的数据库 - 右键单击​​ - 选择属性

在页面左侧选择文件

在“所有者”框中,选择其中包含三个点 (...) 的按钮

现在选择用户“sa”,然后单击“确定”

Select your database - Right Click - Select Properties

Select FILE in left side of page

In the OWNER box, select button which has three dots (…) in it

Now select user ‘sa and Click OK

一笔一画续写前缘 2024-08-24 10:23:10

在所有者文本框中输入“SA”而不是“sa”。这对我有用。

Enter "SA" instead of "sa" in the owner textbox. This worked for me.

为人所爱 2024-08-24 10:23:10

我也遇到了同样的问题。
我想查看我当天在家里工作时创建的图表。但因为这条消息我不能。
我发现数据库的所有者是我的计算机的用户 - 正如预期的那样。但由于计算机位于公司域中,并且我未连接到公司网络,因此数据库无法解析所有者。

所以我所做的就是将所有者更改为本地用户,它成功了!!
希望这对某人有帮助。

您可以通过右键单击数据库、属性、文件、所有者来更改用户

I had the same problem.
I wanted to view my diagram, which I created the same day at work, at home. But I couldn't because of this message.
I found out that the owner of the database was the user of my computer -as expected. but since the computer is in the company's domain, and I am not connected to the company's network, the database couldn't resolve the owner.

So what I did is change the owner to a local user and it worked!!
Hope this helps someone.

You change the user by right-click on the database, properties, files, owner

踏雪无痕 2024-08-24 10:23:10

这为我解决了这个问题。它设置在数据库属性窗口的“文件”部分下找到的所有者,并由 Management Studio 编写脚本。

USE [your_db_name]
GO
EXEC dbo.sp_changedbowner @loginame = N'sa', @map = false
GO

根据 sp_changedbowner 文档,这是已弃用的现在。

根据以色列的回答。亚伦的答案是这个的未弃用的变体。

This fixed it for me. It sets the owner found under the 'files' section of the database properties window, and is as scripted by management studio.

USE [your_db_name]
GO
EXEC dbo.sp_changedbowner @loginame = N'sa', @map = false
GO

According to the sp_changedbowner documentation this is deprecated now.

Based on Israel's answer. Aaron's answer is the non-deprecated variation of this.

慵挽 2024-08-24 10:23:10

我刚刚经历过这个。我已经阅读了本页上的建议以及 SQL Authority 建议(这是同一件事),但以上都不起作用。

最后,我删除了该帐户并重新创建(使用相同的用户名/密码)。就这样,所有的问题都迎刃而解了。

可悲的是,这意味着我不知道出了什么问题,所以我无法分享任何其他内容。

I just experienced this. I had read the suggestions on this page, as well as the SQL Authority suggestions (which is the same thing) and none of the above worked.

In the end, I removed the account and recreated (with the same username/password). Just like that, all the issues went away.

Sadly, this means I don't know what went wrong so I can't share any thing else.

り繁华旳梦境 2024-08-24 10:23:10

1.右键单击您的数据库,
2.然后选择属性。
3. 选择兼容性级别中的选项,如果您使用的是 Microsoft sql 2008,请选择 sql 2008[100]。

4. 然后选择文件并在所有者的文本框中写入 ( sa )

100% 对我有用。

1.Right click on your Database ,
2.Then select properties .
3.Select the option in compatibility levels choose sql 2008[100] if you are working with Microsoft sql 2008.

4.Then select the file and write ( sa ) in owner`s textbox

100% works for me.

扮仙女 2024-08-24 10:23:10

解决此问题的一个更简单的方法是右键单击数据库名称,选择“新查询”,键入“ exec sp_changedbowner 'sa' ”并执行查询。然后你就可以出发了。

An easier way to solve this issues would be to right click the name of your database, choose "New Query", type " exec sp_changedbowner 'sa' " and execute the query. Then you'll be good to go.

德意的啸 2024-08-24 10:23:10

您必须以管理员身份进入,右键单击 microsofft sql server management studio 并以管理员身份运行

you must enter as administrator right click to microsofft sql server management studio and run as admin

英雄似剑 2024-08-24 10:23:10

只需要在查询编辑器中执行即可
将 DATABASE::YourDatabase 上的授权更改为 [domain\account];

Only need to execute it in query editor
ALTER AUTHORIZATION ON DATABASE::YourDatabase TO [domain\account];

咋地 2024-08-24 10:23:10

真正的问题是默认所有者(dbo)根本没有映射到它的登录名。当我尝试将 sa 登录名映射到数据库所有者时,我收到另一个错误,指出“用户,组或角色'dbo'已经存在......”。但是,如果您尝试此代码,它实际上会起作用:

<块引用>

执行 sp_dbcmptlevel 'yourDB', '90';

将 DATABASE::yourDB 上的授权更改为“yourLogin”

使用[您的数据库]

作为用户执行 = N'dbo' REVERT

The real problem is that the default owner(dbo) doesn't have a login mapped to it at all.As I tried to map the sa login to the database owner I received another error stating "User,group, or role 'dbo' already exists...".However if you try this code it will actually works :

EXEC sp_dbcmptlevel 'yourDB', '90';

go

ALTER AUTHORIZATION ON DATABASE::yourDB TO "yourLogin"

go

use [yourDB]

go

EXECUTE AS USER = N'dbo' REVERT

go

最初的梦 2024-08-24 10:23:10

右键单击您的数据库,然后选择属性。
如果您使用的是 Microsoft sql 2008,请选择兼容性级别中的选项,选择 sql 2005[90] 而不是 2008。
然后选择该文件并在所有者的文本框中写入 ( sa )。
它可能会起作用

right click on your Database , then select properties .
select the option in compatibility levels choose sql 2005[90] instead of 2008 if you are working with Microsoft sql 2008.
then select the file and write ( sa ) in owner`s textbox.
it will work probably

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文