简体   繁体   English

了解localDB与SQL Server Express和SQL Server CE的关系

[英]Understand localDB is relation to SQL Server Express and SQL Server CE

I'm trying to understanding LocalDB by reading MSDN: SQL Server 2016 Express LocalDB and MSDN: SQL Server Express LocalDB and SQL Server Express and a number of SO posts including confusion about SQL Server Express and localdb , I still cannot understand what is LocalDB. 我正在尝试通过阅读MSDN来理解LocalDB :SQL Server 2016 Express LocalDBMSDN:SQL Server Express LocalDB和SQL Server Express以及许多SO帖子,包括有关SQL Server Express和localdb的困惑 ,我仍然无法理解什么是LocalDB。 I understand and have used SQL Server Express and SQL Server CE. 我了解并已使用SQL Server Express和SQL Server CE。

Questions: 问题:

LocalDB...the necessary SQL Server infrastructure is automatically created and started LocalDB ...必要的SQL Server基础结构自动创建并启动

My understanding is that, if using LocalDB to handle an application's database, neither the developer nor the client machine where the application is deployed needs to install the heavy SQL Server Express, but just need to install the lighter LocalDB. 我的理解是,如果使用LocalDB处理应用程序的数据库,则部署该应用程序的开发人员和客户端计算机都不需要安装繁重的SQL Server Express,而只需安装较轻的LocalDB。 How, then, without SQL Server Express install can localDB "create(d) and start(ed)" SQL Server? 那么,如何在没有安装SQL Server Express的情况下localDB可以“创建(d)并启动(ed)” SQL Server? If localDB 如果localDB

... once installed, LocalDB is an instance of SQL Server Express that can create and open SQL Server databases. ...安装后,LocalDB是SQL Server Express的实例,可以创建和打开SQL Server数据库。 The system database files for the database are stored in the users' local AppData path which is normally hidden. 数据库的系统数据库文件存储在用户的本地AppData路径中,该路径通常是隐藏的。

If developer or client can use localDB without installing SQL Server, how can localDB be an instance of something that is not installed? 如果开发人员或客户端无需安装SQL Server就可以使用localDB,那么localDB如何成为未安装对象的实例? Or is localDB an incomplete version of SQL Server Express that just does not need to click..click..click.. to configure. 还是localDB是SQL Server Express的不完整版本,只需要单击..click..click ..即可进行配置。 Essentially localDB works like SQL Server CE where localDB use some hidden "files" in AppData to create database while SQL Server CE use the dll to generate the database? 本质上,localDB的工作方式类似于SQL Server CE,其中localDB在AppData中使用一些隐藏的“文件”来创建数据库,而SQL Server CE使用dll来生成数据库?

SqlLocalDB.msi program to install the necessary files on the computer SqlLocalDB.msi程序在计算机上安装必要的文件

If client still needs to install localDB (which is not really portable along with the application like SQL Server CE), then why not just install SQL Server Express? 如果客户端仍然需要安装localDB(与SQL Server CE这样的应用程序一起不能真正移植),那么为什么不安装SQL Server Express? Either localDB or SQL Server Express is above 100MB+ anyway and need separate installation, what is the point of using localDB anyway? 无论是localDB还是SQL Server Express都超过100MB以上,并且需要单独安装,无论如何,使用localDB有什么意义?

We used localdb on a project where we had agents in the field using laptops. 我们在一个项目中使用了localdb,在该项目中,我们使用笔记本电脑在该领域拥有代理。

  1. The functionality of localdb was better than SQL Server CE (I don't remember exactly what CE was missing, but it was important to the project), you should review the functional differences. localdb的功能比SQL Server CE更好(我不记得到底缺少了什么CE,但这对项目很重要),您应该检查一下功能差异。

  2. Another advantage was the db was stored in the user folder which makes it impossible for other non-admin users of the laptop to see. 另一个优点是db存储在用户文件夹中,这使笔记本电脑的其他非管理员用户无法查看。 This allowed us to reuse and even share laptops between users without mixing data - a nice feature. 这使我们能够在用户之间重复使用甚至共享笔记本电脑,而无需混合数据-这是一个不错的功能。

  3. Finally, the dbs (with a little effort) can be copied to the dev/support side and restored/attached for troubleshooting. 最后,只需稍作努力即可将数据库复制到开发/支持侧,并进行还原/附加以进行故障排除。 They are full .mdf / .ldf database files. 它们是完整的.mdf / .ldf数据库文件。

You do have to create the instances using a command line (sqllocaldb utility), after the product is installed. 安装产品后,您必须使用命令行(sqllocaldb实用程序)创建实例。 This was just part of our install app. 这只是我们安装应用程序的一部分。

LocalDB is a programmer-oriented version of SQL Server Express that needs to be installed just like SQL Server Express. LocalDBSQL Server Express的面向程序员的版本,需要像SQL Server Express一样安装。

Unlike SQL Server Express, it's not installed as a Windows Service that starts up with your Windows OS - but it only starts up as needed (when your application starts up, or when you start it manually with the SqlLocalDb command line tool). 与SQL Server Express不同,它不是作为随Windows操作系统启动的Windows服务安装的,而是仅根据需要启动的(应用程序启动时,或使用SqlLocalDb命令行工具手动启动时)。

But LocalDB IS SQL Server Express (not Compact Edition). 但是LocalDB SQL Server Express (不是Compact Edition)。 It uses the same .mdf and .ldf database files like and desktop/server version of SQL Server, not SQL Server CE's .sdf file format. 它使用与SQL Server和台式机/服务器版本相同的.mdf.ldf数据库文件,而不是SQL Server CE的.sdf文件格式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM