模式迁移工具如何工作? [英] How the schema migration tools work?

查看:85
本文介绍了模式迁移工具如何工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有基于数据库的应用程序,并且删除了架构&每次模式中有任何更改时,db内容均会显示.现在它处于开发模式.不久我们将正式发布该应用程序.但是我们怀疑在正式发布生产应用程序后可能会有很多更改.该软件应安装在全球许多地方. (不是基于Web的应用程序)

I have db based application and I delete the schema & db content every time whenever there is any changes in the schema. Now it is in development mode. Soon we release the application in production. But we suspect there could be many changes after we release the application in production use. The software shall be installed on many locations across the globe. (Not a web based app)

在这种情况下,架构迁移工具如何工作?或我们如何在怀疑模式发生变化的典型的基于数据库的应用程序中使用它们?

How the schema migration tool work in this case? or How can we use them in typical database based applications where we suspect the changes in the schema?

推荐答案

下载 RedGate 工具并找到出去.我相信他们都有试用期,而且我敢肯定SQL Compare会提供试用期.

Download the RedGate tools and find out. I believe that they all have trial periods and I'm sure that SQL Compare does.

通常,您将它们指向两个数据库,它们列出了两者之间的所有差异.您可以将它们配置为忽略某些内容,例如注释,约束名称等.从那里,您可以选择要同步的项目以及在哪个方向上进行同步,该工具将为您生成脚本或将其生成.为您改变.

Typically, you point them to two databases and they list out all of the differences between the two. You can configure them to ignore certain things, like comments, constraint names, etc. From there you can select which items you want to synchronize and in which direction and the tool will either generate a script for you to do it or it will make the changes for you.

在您的情况下,您可能会生成脚本,然后将其用作发送给客户或安装脚本中包含内容的基础.只需为应用程序的每个版本保留一个数据库,然后您就可以通过指向两个数据库来生成从一个版本转到另一个版本的脚本.您可以将它们保留为空(或仅填充查找表),以免它们占用过多空间.

In your situation you would probably generate the script and then use that as a basis for what you would send to your customers or what you would include in your install scripts. Just keep a database for each version of your application and you can then generate scripts to go from one version to another by pointing at the two databases. You can keep them empty (or just fill the lookup tables) so that they don't take up too much space.

您还可以使用SQL数据比较来保持查询表同步.只是将其用于查找表,而不是实际的主数据表.

You can also use SQL Data Compare to keep lookup tables synchronized. Just use it for the lookup tables though, not the actual main data tables.

无论走哪条路线,都必须进行一些自定义编码,因为您需要在更改结构时转换数据或出于类似原因.

No matter which route you go, you're going to have to do some custom coding, either because you need to convert data while changing structure or for a similar reason.

这篇关于模式迁移工具如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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