需要比较并找到两个dB之间的丢失约束
我需要比较两个DB,并在所有模式中找到约束的差异,即用于测试目的,并且它们之间的DB对象相同。如何比较约束不匹配? 给予一些输入。
提前
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
我需要比较两个DB,并在所有模式中找到约束的差异,即用于测试目的,并且它们之间的DB对象相同。如何比较约束不匹配? 给予一些输入。
提前
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(1)
选择'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$%'
;