SqlLocalDB信息列出了两个具有相同名称的实例 [英] SqlLocalDB info lists two Instances with the same Name

查看:168
本文介绍了SqlLocalDB信息列出了两个具有相同名称的实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我的IIS MVC4 Web App(作为我的用户运行)尝试连接到命名的LocalDb实例时,它无法启动MyInstance或连接到它。

When my IIS MVC4 Web App (running as my user) tries to connect to a named LocalDb Instance it fails to start MyInstance or connect to it.

我有我的Web.config中的自动创建部分和使用相同数据库的其他服务的App.config。

I have the auto-create section in my Web.config and App.config of another services that uses the same database.

然后我使用SqlLocalDb手动创建并启动我的命名实例MyInstance -s
我再次尝试并得到相同的错误。

I then manually create and start my named instance using SqlLocalDb create MyInstance -s I try again and get the same error.

如果我然后执行SqlLocalDb信息,它会显示2个具有相同名称的实例。

If I then do SqlLocalDb info, it shows 2 instances with the same name.

如果我停止并删除MyInstance,那么信息列表中只会有1个实例。

If I stop and delete MyInstance, then there will only be 1 instance in the info list.

那个实例不能与...进行交互。

That one instance cannot be interacted with.

执行SqlLocalDB信息MyInstance或启动MyInstance或删除MyInstance都会说该实例不存在,但它仍然在信息列表中。

Doing SqlLocalDB info MyInstance or start MyInstance or delete MyInstance will all say that the instance does not exist, but it is still in the info list.

我已经在互联网上找到了其他有这个问题但无法找到它的人。

I have looked everywhere on the Internet for someone else with this problem and cannot find it.

PS那些打算提出建议的人会转移到dba.stackexchange.com:LocalDB适用于开发人员,而不是DBA。

P.S. People that are going to suggest this gets moved to dba.stackexchange.com: LocalDB is for developers, not DBAs.

推荐答案

我从来没有找到对此的解释,但是我称之为ghost实例来自具有该名称的另一个用户拥有的重复实例或者在注册表中留下的先前实例的工件。如果列表中显示多个具有相同名称的实例,则必须手动以所有曾在计算机上创建LocalDb实例的用户身份登录,并停止并删除其实例。在某些情况下,这还不够。您还必须删除注册表的UserInstance部分下的注册表项。拥有一个可以管理所有用户的LocalDb管理工具真的很不错,但这不存在。我必须将PsExec用于服务帐户。

I never found an explanation for this, but the "ghost" instance, as I call it, comes from duplicate instances with that name owned by another user or artifacts of previous instances left in the Registry. If multiple instances show up in the list with the same name, you would have to manually log in as all users who have ever created LocalDb instances on your machine and stop and remove their instances. In some cases this is not enough. You also have to remove their Registry entries under the UserInstance section(s) of the Registry. It would be really nice to have a LocalDb management tool that can manage all users, but this does not exist. I have to use PsExec for service accounts.

这篇关于SqlLocalDB信息列出了两个具有相同名称的实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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