简体   繁体   English

SQL Oracle - 比较 DEV 和 TEST 之间的两个表模式(列数据类型和大小,而不是值)

[英]SQL Oracle - Compare two table schemas(column Data Types and size, not the values) between DEV and TEST

I would like to compare two tables DEV-TABLEA and QA-TABLEA in order to determine if there is any difference in datatypes, column lengths, or additional columns, here I am not concerned with the actual data;我想比较两个表 DEV-TABLEA 和 QA-TABLEA 以确定数据类型、列长度或附加列是否有任何差异,这里我不关心实际数据; I would appreciate any help.我将不胜感激任何帮助。 thank you谢谢你

As you do use SQL Developer (but reported that it didn't do what you wanted), then: are you using the latest version?当您使用 SQL Developer(但报告说它没有按照您的要求执行)时,那么:您使用的是最新版本吗? Maybe yours doesn't do that correctly/completely.也许你没有正确/完全地做到这一点。 Because, on my 21.4.2, it works just fine.因为,在我的 21.4.2 上,它工作得很好。

For testing purposes, I created a test table in scott schemas in two different databases:出于测试目的,我在两个不同数据库的scott模式中创建了一个test表:

SQL> connect scott/tiger@db1
Connected.

SQL> create table test(id number, name varchar2(10));

Table created.

SQL> connect scott/tiger@db2
Connected.

SQL> create table test(id number, name varchar2(20), address varchar2(20));

Table created.

As you can see, table in db2 has modified name column length and additional ( address ) column.如您所见, db2中的表修改了name列长度和附加( address )列。

Running Database Diff produces the following result (exclamation mark icons warn you that there are some issues there; I chose the test table):运行Database Diff会产生以下结果(感叹号图标警告您那里存在一些问题;我选择了test表):

在此处输入图像描述

Both name and address have been marked, so... it works OK (at least, I think so). nameaddress都已标记,所以......它工作正常(至少,我认为是这样)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM