简体   繁体   English

我如何知道我的 bacpac 用于哪个版本的 SQL 服务器? (我在 Ubuntu 上使用 SQL Server 2019 express)

[英]How do I know which version of SQL Server my bacpac is for? (I'm using SQL Server 2019 express on Ubuntu )

I was given a SQL Server bacpac file to restore a database on a Ubuntu 20.x instance.我得到了一个 SQL 服务器 bacpac 文件来恢复 Ubuntu 20.x 实例上的数据库。

I thought I would use this command to restore the file:我想我会使用这个命令来恢复文件:

/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P "Password123!" -Q "RESTORE DATABASE [demodb] FROM DISK = N'/var/opt/mssql/backup/mssql-latest.bacpac' WITH FILE = 1, NOUNLOAD, REPLACE, NORECOVERY, STATS = 5"

Though the error it fed me was:虽然它给我的错误是:

Msg 3241, Level 16, State 1, Server 6f604ce9f741, Line 1 The media family on device '/var/opt/mssql/backup/mssql-latest.bacpac' is incorrectly formed.消息 3241,级别 16,State 1,服务器 6f604ce9f741,第 1 行设备“/var/opt/mssql/backup/mssql-latest.bacpac”上的媒体系列格式不正确。 SQL Server cannot process this media family. SQL 服务器无法处理此媒体系列。 Msg 3013, Level 16, State 1, Server 6f604ce9f741, Line 1 RESTORE DATABASE is terminating abnormally.消息 3013,级别 16,State 1,服务器 6f604ce9f741,第 1 行 RESTORE DATABASE 异常终止。

And when looking into this more via google searches it seems to be related to an older version of SQL Server bacpac being used with a newer version of SQL Server.当通过谷歌搜索进一步调查时,它似乎与旧版本的 SQL 服务器 bacpac 与新版本的 SQL 服务器一起使用。

I am currently running SQL Server 2019 Express, thinking that this would work.我目前正在运行 SQL Server 2019 Express,认为这可行。

How can I find out which version I need to use without downloading every version of SQL Server?在不下载SQL Server的每个版本的情况下,如何找出我需要使用的版本? Similarly, How do I know if I need to use Express or Developer, or any of the other versions of SQL Server.同样,我如何知道我是否需要使用 Express 或 Developer,或 SQL 服务器的任何其他版本。 I thought Express would be ideal because I think it is lightweight.我认为 Express 是理想的,因为我认为它是轻量级的。

BACPAC is basically ZIP file. BACPAC 基本上是 ZIP 文件。 You can change the extension of file to zip file and extract it.您可以将文件的扩展名更改为 zip 文件并解压缩。 You can see the version of the SQL Server.您可以看到 SQL 服务器的版本。

Reference article on editing bacpac file 编辑 bacpac 文件的参考文章

BACPAC 提取文件夹

You can open the Origin.xml for the SQL Server version of the BACPAC.您可以打开 BACPAC 的 SQL 服务器版本的 Origin.xml。

SQL Server 版本

Also, to answer your question of SQL Server Express Vs SQL Server Developer.另外,要回答您关于 SQL Server Express 与 SQL Server Developer 的问题。 SQL Server Express is limited feature set and SQL Server Developer is with full feature set as SQL Server Enterprise edition. SQL Server Express 是有限的功能集,SQL Server Developer 具有完整的功能集,如 SQL Server Enterprise edition。 But, you can use SQL Server Developer only for the development purposes and not in production.但是,您只能将 SQL Server Developer 用于开发目的,而不能用于生产。 Express edition is having some limitation on storage and features. Express 版对存储和功能有一些限制。 If it is not satisfying, you can go for Developer edition and later upgrade, when you go for production.如果不满意,您可以 go 为开发版和以后升级,当您 go 为生产。

The different editions of SQL Server and differences among them SQL服务器的不同版本及区别

Real issue here is, you are trying to restore a.BACPAC file using "RESTORE DATABASE" command which will obviously fail as "RESTORE DATABASE" command is used to restore.BAK file not.BACPAC file.这里真正的问题是,您正在尝试使用“RESTORE DATABASE”命令恢复 .BACPAC 文件,这显然会失败,因为“RESTORE DATABASE”命令用于恢复.BAK 文件而不是.BACPAC 文件。

You got to use SQLPackage utility to restore a BACPAC file.您必须使用 SQLPackage 实用程序来恢复 BACPAC 文件。 Details are provided here . 此处提供了详细信息。

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

相关问题 sql-server:我怎么知道谁在我的数据库中? - sql-server: how do i know who is in my database? 如何更改SQL Server实例的版本? - How do I change the version of my SQL Server instance? 如何使用 Powershell 检查 SQL 服务器版本? - How do I check for the SQL Server Version using Powershell? SQL 服务器 2019 Express 我无法连接 - SQL Server 2019 Express I can't connect 我已将数据库项目部署到本地SQL Server Express中-现在如何查看数据库? - I've deployed a database project to my local SQL Server Express - how do I see the database now? 在我的情况下,如何使用SQL Server进行分组? - How can I do grouping in my case using SQL Server? VS 2010 & SQL Server 2008:我正在尝试备份我的数据库(.mdf 文件)但不知道如何 - VS 2010 & SQL Server 2008: I'm trying to backup my database (.mdf file) but don't know how 如何在我的 SQL 服务器代理作业中创建一个步骤,它将运行我的 SSIS package? - How do I create a step in my SQL Server Agent Job which will run my SSIS package? 如何显示SQL Server表的统一版本? - How can I display a consolidated version of my SQL Server table? SqlConnection,我使用的是SQL Server,而不是LocalDB; 那么如何 - SqlConnection, I'm using SQL Server, not LocalDB; so how to
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM