Oracle DB 版本控制方案
只是想知道是否有人曾经想过/实现过这样的事情。
我正在考虑实施数据库版本控制方案。每天运行一次作业,将所有 DDL 和源代码输出到单个文件中。然后将针对该文件运行哈希。哈希值将与版本号一起存储在数据库中。每当哈希值发生变化时,哈希值都会更新,版本号也会增加。
这有道理吗?除了每天发生一次之外,有人看到其中有什么巨大的漏洞吗?
有人做过类似的事情吗?
Just wondering if anyone has ever thought of/implemented something like this.
I'm considering implementing a DB versioning scheme. Once per day, a job would run, which outputs all DDL and source code into a single file. A hash would then be run against that file. The hash would be stored in the DB with a version number. Anytime the hash changed, the hash value would be updated and the version number incremented.
Does that make sense? Anyone see any huge holes in that other than the fact it would happen once per day?
Anyone done something similar?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这是某个随意的人关于该主题的博客文章。他链接到一些好文章来提供想法。
将您的数据库置于版本控制之下
Here's a blog post by some random guy about the subject. He links to a few good articles to give ideas.
Get Your Database Under Version Control
另一种方法可能是编写增量更改的脚本,以便这些脚本的总和代表您当前的版本。优点是 - 特别是如果您在团队中进行开发 - 各个脚本可以在提交到存储库之前在本地实例上进行测试。
如果更改很多且频繁,我会使用一系列增量脚本,如果数据库代码已达到一定程度的稳定性,我会使用您的方法。
Another approach could be to script your incremental changes so that the sum of these scripts represents your current version. The advantage is that - especially if you are developing in a team - the individual scripts can be tested on a local instance before being committed to the repository.
I'd use a series of incremental scripts if the changes are many and frequent, and your approach if the database code has reached a certain level of stability.
不确定您认为此用途有何用途。我倾向于使用 AUDIT 和/或 DDL 触发器来捕获数据库中的代码更改。
我不会用它来代替适当的源代码控制版本控制,尽管如果它不存在并且您无力将其到位,那么它可能比没有好。
一种想法是,有时参考数据与代码一样重要。
Not sure what you see as the use for this. I'd tend towards AUDIT and/or DDL triggers to capture code changes in the database.
I wouldn't use this in place of a proper source code control versioning, though it may be better than nothing if that doesn't exist and you are powerless to put it in place.
One thought is that sometimes reference data is as important as code.
与工作区管理器类似的东西用于版本控制数据:
http:// /www.oracle.com/technology/products/database/workspace_manager/index.html
Something along the lines of Workspace Manager although is for versioning data:
http://www.oracle.com/technology/products/database/workspace_manager/index.html