I have two tablesspaces with tables, views and etc. I would like to write a SQL statement that would compare what tables are not in the other tablespaces. For instance, I wrote this SQL statement to determine the table commonalities between two tablespaces.
How would I do the opposite of this? If DB1 and DB2 had these tables:
Therefore, the differences would be DB1 has A and DB2 has E. What would be the correct syntax?
Thanks,
Todd
Code:
SELECT * FROM (SELECT TABLE_NAME AS DB1_TABLE_NAME
FROM all_all_tables
WHERE owner='DB1') a,
(SELECT TABLE_NAME AS DB2_TABLE_NAME
FROM all_all_tables
WHERE owner='DB2') b
WHERE a.DB1_TABLE_NAME=b.DB2_TABLE_NAME
ORDER BY a.DB1_TABLE_NAME;
How would I do the opposite of this? If DB1 and DB2 had these tables:
Code:
DB1: A, B, C and D
DB2: B, C, D, and E
Therefore, the differences would be DB1 has A and DB2 has E. What would be the correct syntax?
Thanks,
Todd