To compare two databases, you can use tools, such as toad, or write a stored procedure yourself. I will introduce an SQL statement to check whether the table structure is consistent, and so on, you can write an SQL statement that compares the consistency of indexes and the consistency of constraints. The disadvantage of this SQL statement is that it can only identify the differences, but it is caused by the table:
Select case when a. cnt = B. cnt then 'two database structures are consistent'
When a. cnt <> B. cnt then 'inconsistent database structures 'end
From (select count (*) as cnt
From dba_tab_columns t1, dba_tab_colums @ lnk_db2 t2
Where t1.owner = 'taobao'
And t1.owner = t2.owner
And t1.table _ name = t2.table _ name
And t1.column _ name = t2.column _ name
And t1.data _ type = t2.data _ type
And t1.data _ length = t2.data _ length
And t1.nullable = t2.nullable
And nvl (t1.data _ precision, 0) = nvl (t2.data _ precision, 0)
And nvl (t1.data _ scale, 0) = nvl (t2.data _ scale, 0),
(Select count (*) as cnt
From dba_tab_columns
Where owner = 'taobao') B