数据库架构验证 - 可部署/可编译
寻找一种允许构建数据库模式验证的工具,该工具可以编译成独立工具或作为在另一个应用程序中使用的模块。
该场景是 - 一个出售给客户并通过服务版本进行维护的客户端/服务器应用程序。服务版本包括数据库脚本,用于通过任何架构更改等更新数据库。
但是,由于这是一个数据库,客户可能会
- 错误地运行升级脚本,或者
- 修补并弄乱数据库中的某些内容,
我希望拥有此工具每个版本都可用,因此我们可以验证结构(可能还有一些数据)是否有效。当客户拥有服务票证时,还可以将其用于远程调试。
我研究过的模式比较工具非常适合比较本地数据库,但我还没有看到可以生成可与我们的应用程序一起部署的东西。
谢谢!
Looking for a tool that will allow building database schema validation that can be compiled into a standalong tool or as a module to be used in another application.
The scenario is - a client/server application that is sold to customers, and maintained through service releases. The service releases include database scripts to updated the database with any schema changes etc.
However, since this is a database and the customer could either
- run upgrade scripts incorrectly, or
- tinker around and mess up something in the DB
I would like to have this tool available with each release so we can verify the struture, and possibly some data, is valid. Also to have it available for remote debugging when a customer has a service ticket.
Schema compare tools I've researched work great for comparing local databases, but I haven't seen something that can generate something that is deployable with our application.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看一下 SchemaCrawler,它非常适合此目的。 SchemaCrawler 可以生成人类可读的数据库模式(和数据)“快照”,这些快照旨在使用纯文本文件比较工具进行比较。 SchemaCrawler 是独立于数据库和操作系统的、免费的、开源的,可以从命令行以及通过 Java API 调用。
Take a look at SchemaCrawler, which is ideally suited to this purpose. SchemaCrawler can generate human-readable database schema (and data) "snapshots", which are designed to be compared using plain-text file comparison tools. SchemaCrawler is database and operating system independent, free, open-source, and can be invoked from the command-line, as well as through a Java API.
您说模式比较工具不能满足您的要求,但是您是否考虑过使用模式比较工具 SDK 并编写自己的验证代码?例如,我管理 Red Gate 的 SQL Compare 及其 API(SQL Comparison SDK),它允许您将模式快照与目标数据库进行比较,如果不匹配则中止部署,并保存以下日志:差异,可以通过电子邮件发回给您。
http://www.red-gate.com/products/SQL_Comparison_SDK/index.html嗯
You say that schema compare tools don't meet your requirements, but have you considered using a schema compare tool SDK and write your own validation code? I product manage Red Gate's SQL Compare and its API, the SQL Comparison SDK, will, for example, allow you to compare a schema snapshot against a target database and abort the deployment if it doesn't match, as well as saving a log of the differences, which could be emailed back to you.
http://www.red-gate.com/products/SQL_Comparison_SDK/index.htm