需要比较并找到两个dB之间的丢失约束

发布于 2025-02-04 23:01:22 字数 82 浏览 1 评论 0 原文

我需要比较两个DB,并在所有模式中找到约束的差异,即用于测试目的,并且它们之间的DB对象相同。如何比较约束不匹配? 给予一些输入。

提前

i need to compare two DBs and find the differences in constraints in all the schemas i.e. the schemas are used for test purpose and the DB objects are same between them. How can i compare the constraints mismatch? Give some inputs

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

多彩岁月 2025-02-11 23:01:22

选择'miss_in_db1',table_name,constraint_name,constraint_type从all_constraints wheres ='db2'and constraint_name不喜欢'sys%'和table_name不喜欢'bin $%'

sirus
选择'miss_in_db1',table_name,constraint_name,constraint_type从all_constraints中的所有者='db1'and constraint_name不喜欢'sys%''和table_name不喜欢'bin $%'

union
选择'miss_in_db2',table_name,constraint_name,constraint_type从all_constraints wheres andal ='db1'and constraint_name不喜欢'sys%''和table_name不喜欢'bin $%'bin $%'

minus
选择'miss_in_db2',table_name,constraint_name,constraint_type从all_constraints中的所有者='db2'and constraint_name不喜欢'sys%''和table_name不喜欢'bin $%''
;

select 'MISS_IN_DB1',table_name,constraint_name, constraint_type from all_constraints where owner = 'DB2' and constraint_name not like 'SYS%' and table_name not like 'BIN$%'

minus
select 'MISS_IN_DB1',table_name,constraint_name, constraint_type from all_constraints where owner = 'DB1' and constraint_name not like 'SYS%' and table_name not like 'BIN$%'

UNION
select 'MISS_IN_DB2',table_name,constraint_name, constraint_type from all_constraints where owner = 'DB1' and constraint_name not like 'SYS%' and table_name not like 'BIN$%'

minus
select 'MISS_IN_DB2',table_name,constraint_name, constraint_type from all_constraints where owner = 'DB2' and constraint_name not like 'SYS%' and table_name not like 'BIN$%'
;

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文