Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Comparing two Oracle schema, other users

I have been tasked with comparing two oracle schema with a large number of tables to find the structural differences in the schema. Up until know I have used the DB Diff tool in Oracle SQL Developer, and it has worked very well. The issue is that now I need to compare tables in a user that I cannot log into , but I can see it through the other users section in SQL developer. The issue is that whenever I try to use the diff tool to compare those objects to the other schema it does not work. Does anyone have any idea how to do this? It would save me a very large amount of work. I have some basic SQL knowledge if that is whats needed. Thanks.

like image 573
Igman Avatar asked Nov 05 '22 12:11

Igman


1 Answers

If you have been GRANTed permissions in that other schema, issue an

alter session set current_schema = OTHER_SCHEMA_NO_QUOTES_REQUIRED;

the run whatever tool.

Otherwise, it's select * from all_tables where owner = OTHER_USER;, 'select * from all_indexes where ...` etc.

like image 124
tpdi Avatar answered Nov 13 '22 07:11

tpdi