部署 SQL Server:安装第二个实例?

发布于 2024-08-15 15:11:52 字数 640 浏览 4 评论 0原文

简单的问题。我正在开发一个 Delphi 2007/WIN32 应用程序,它现在使用 MS Access 作为简单的数据存储。我必须修改它以支持 SQL Server Express,这很容易。这些修改正在发挥作用,因此可以使用 SQL Server 或 MS Access 部署应用程序。 (无论用户喜欢什么。)我确实考虑过将整个应用程序与 SQL Compact 一起部署,但这并不实用。使用 SQL Server Express 2008 而不是 2005 是一种选择,但也有一些令人讨厌的副作用,我们暂时不想解决。

问题是部署整个项目。 SQL Server 的安装需要安静安装,以便用户不会注意到。文档中提到了 SQL Server,因此他们知道它的存在。我们只是不想用技术问题来打扰他们。在大多数情况下,这样的安装会顺利进行。

但是,如果用户已经安装了用于其他用途的 SQL Server (2005),该怎么办?就我个人而言,我更愿意在他们的系统上安装第二个 SQL Server 实例,这样就不会与其他安装发生冲突。 (因此,如果他们卸载其他应用程序,SQL 实例将保持安装状态。)

虽然只需使用实例的两个不同名称即可将 SQL Server 2005 和 2008 安装在同一系统上,但我想知道是否也可以安装SQL Server 2005 在单个系统上运行两次以获得两个实例。如果可能的话,如何实现?

Simple problem. I'm working on a Delphi 2007/WIN32 application which now uses MS Access as simple data store. I have to modify it to support SQL Server Express, which is easy. These modifications are working so the application can be deployed using either SQL Server or MS Access. (Whatever the user prefers.) I did consider deploying the whole application together with the SQL Compact but this is not practicak. Using SQL Server Express 2008 instead of 2005 is an option, but also has a few nasty side-effects which we don't want to resolve for now.

The problem is deploying the whole project. The installation with SQL Server would need a quiet installation so the user won't notice it. SQL Server is mentioned in the documentation so they know it's there. We just don't want to bother them with technical issues. In most cases, such an installation will go just fine.

But what if the user already has an SQL Server (2005) installation which is used for something else? Personally, I would prefer to just install a second instance of SQL Server on their system so it won't conflict with the other installation. (Thus, if they uninstall the other app, the SQL instance will just stay installed.)

While SQL Server 2005 and 2008 can be installed on the same system simply by using two different names for the instance, I wonder if it's also possible to install SQL Server 2005 twice on a single system to get two instances. And if possible, how?

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

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

发布评论

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

评论(3

是你 2024-08-22 15:11:53

回答你的问题:是的,SQL2005/SQL2008 和 SQLExpress2005/2008 可以幸福地并存。 SQLExpress 安装的默认实例名称是 [计算机名称]\SQLEXPRESS。但话虽如此,您应该考虑让您的客户选择使用他们已有的 sql 实例,并且仅在他们选择的情况下安装新实例。

我不知道 SQLExpress 是否可以静默安装(很可能可以,只要您在安装时在命令行上指定正确的属性)。但我们已经向很多客户推出了它,他们正常安装时几乎没有遇到任何问题。

编辑:我已将其添加为编辑,因为评论不允许足够。

我理解您不愿意让用户手动安装 SQL 并共享另一个实例。为了解决这些问题:

  • 卸载产品永远不应自动卸载 SQL 实例,即使该 SQL 实例在安装该产品时已放置在那里。无论如何,数据库可能会被摧毁,但卸载 SQL 实例应该是一个手动过程,因为它是一个服务器产品,可能被许多其他产品使用,
  • 您可以通过使用合适的安装程序产品使您的任务变得更加容易。例如,我们使用InstallShield。它有一个内置的 sql 浏览对话框(它是 InstallShield 的内置功能),用户可以使用它来选择他们想要用于我们产品的 sql 实例和数据库。然后,使用 XML 文件更改任务(也是 InstallShield 中内置的功能)将用户输入的详细信息插入到 web.config 文件中。通过使用这样的对话框,您可以消除许多潜在的用户错误。
  • 如果已有 sql 实例,则使用它。您的数据库对实例的唯一依赖是它是正确的版本(即 SQL2005,对于 2005 数据库来说 2008 就可以了)。您应该要求拥有自己的实例的唯一时间是,如果您正在处理/存储足够的数据,需要拥有自己的服务器,或者您依赖于未记录的功能。如果现有实例已经处于重负载下,那么坚持在不同服务器上建立新实例就可以了,但是这样您也避免了整个并行情况。或者,您可以只安装到现有实例并让客户承诺升级硬件。

我希望这会有所帮助 - 我只是试图说服您,需要单独实例的原因有限,并且 99% 的情况下您可以很好地安装到现有实例中。拥有自己的实例固然很好,但实际上它并没有给您带来什么真正的好处,特别是当您使用强大的安装程序时。

To answer your question: yes SQL2005/SQL2008 and SQLExpress2005/2008 can all live happily side by side. The default instance name for the SQLExpress install is [machine name]\SQLEXPRESS. But having said that, you should consider giving your customer the option to use the sql instance they already have, and only install a new instance if they choose to.

I don't know if SQLExpress can be installed silently (most likely it can as long as you specify the right properties on the command line when you install it). But we have rolled it out to lots of customers, and they have very few issues installing it normally.

Edit: I have added this as an edit because a comment doesn't allow enough.

I understand your reluctance to both having the user install SQL manually, and to sharing another instance. To address these points:

  • uninstalling a product should never automatically uninstall the SQL instance, even if that SQL instance was put there when installing that product. By all means the database can be blown away, but uninstalling a SQL instance should be a manual process, as it is a server product that may be used by many other products
  • you can make your task a lot easier by using a decent installer product. For instance, we use InstallShield. It has a sql browse dialog built in (its a baked in feature of InstallShield) that the user can use to select which sql instance and database they want to use for our product. The details the user enters are then inserted in to the web.config file using an XML file change task (also functionality baked into InstallShield). By using dialogs like this you eliminate a lot of potential user errors.
  • if there is already an existing sql instance, use it. The only dependence your database should have on the instance is that it is the right version (i.e. SQL2005, and 2008 is fine for a 2005 database). The only time you should demand your own instance is if you are processing/storing enough data that you require your own server, or if you are depending upon undocumented features. If the existing instance is already under heavy load, then insisting on a new instance on a different server is fine, but then you have also avoided that whole side-by-side situation. Alternatively you could just install in to the existing instance and get the customer to commit to upgrading the hardware.

I hope this helps somewhat - i'm just trying to persuade you that there are limited reasons for needing a separate instance and that 99% of the time you will be fine installing in to an existing instance. It's nice to have your own instance but in reality it brings you few real benefits, especially if you are using a robust installer.

留蓝 2024-08-22 15:11:53

您可以使用 /Q 命令行开关以静默模式安装 SQL Server Express,或使用 /QS 命令行开关来查看安装进度,而无需用户输入。您可以在已安装 SQL Server 的系统上安装命名实例。

http://msdn.microsoft.com/en-us/library/ms144259。 ASPX

You can install SQL Server Express in silent mode using the /Q command line switch or use the /QS command line switch to see setup progress without user input. You can install a named instance on a system that already has SQL Server installed.

http://msdn.microsoft.com/en-us/library/ms144259.aspx

我还不会笑 2024-08-22 15:11:53

拥有自己的 SQL Server 实例非常有用,原因有很多。

  • 您可以自行决定使用哪种类型的身份验证(SQL 身份验证或 Windows 身份验证)。尽管建议使用 Windows 身份验证,但存在这样的情况:这根本不是一个选项。当其他产品使用同一实例时,为实例启用 SQL 身份验证会带来安全风险。
  • 您可以放心地假设您的产品是已安装实例的唯一用户。因此,通过安装和卸载实例,您可以知道该实例使用的版本和数据库。不需要额外的检测,只要您的产品的不同版本使用相同的 SQL 配置和版本即可。

隔离您的安装(文件、注册表项、DLL 和其他产品)是一个非常好的做法!

此外,卸载 SQL Server 实例不会导致数据丢失,因为数据库的数据文件不会被删除。重新安装后,如果需要,您可以再次附加数据文件。

话虽这么说,SQL Server Express 可以以三种不同的交互模式安装:

  • 完整 UI,包括 SQL 许可协议接受
  • 无提示,但有详细进度 UI
  • 无提示,没有任何进度 UI(并抑制错误!)

可以找到详细的安装说明在 http://msdn.microsoft.com/en-我们/库/ms144259(SQL.90).aspx

There are a number of reasons why it is very useful to have your own instance of an SQL Server.

  • You can decide for yourself what type of authentication you use (SQL authentication or Windows authentication). Although Windows authentication is recommended, scenario's exist where this is simply not an option. And enabling SQL authentication for an instance where other products use the same instance is a security risk.
  • You can safely assume that your product is the only user of the installed instance. So with installing and uninstalling the instance you know the version and databases in use by that instance. No extra detection needed, as long as different versions of your product use the same SQL configuration and version.

Isolation of your installments (files, registry keys, dll's and other products) is a very good practice!

Also, uninstalling an SQL Server instance doesn't lead to data loss, because the data files of the databases will not be removed. After reinstalling, you can attach the data files again if needed.

that being said, SQL Server express can be installed in three different interaction modes:

  • Full UI, including SQL license agreement acceptance
  • Silent, but with detailed progress UI
  • Silent, without any progress UI (and suppressed errors!)

Detailed instructions for installation can be found at http://msdn.microsoft.com/en-us/library/ms144259(SQL.90).aspx

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