Solved

schema duplicate

Posted on 2014-04-10
5
219 Views
Last Modified: 2014-06-10
Sever A has database X with schemas A,B,C............
Server B has database Y with schemas A,B,D etc

How will you find out the schema that is not B is having ...other than A


A kind of subtract..Minus
0
Comment
Question by:tonydba
5 Comments
 
LVL 34

Accepted Solution

by:
johnsone earned 500 total points
ID: 39991590
I am assuming that you don't have a database link set up between the 2 databases that connects as a privileged account.  If you do, you shouldn't.

What I would do is get a list of schemas from database X:

Connect with SQL*Plus as a privileged user and run:
spool db_x_schemas.txt
select distinct owner from dba_objects order by 1;
spool off

Then on database Y:

Connect with SQL*Plus as a privileged user and run:
spool db_y_schemas.txt
select distinct owner from dba_objects order by 1;
spool off

Now you have 2 files:  db_x_schemas.txt and db_y_schemas.txt.  Get those 2 files on the same server (using scp or ftp) and then do:

diff db_x_schemas.txt db_y_schemas.txt

You most likely see differences due to prompts and you can ignore those.
0
 
LVL 15

Expert Comment

by:Devinder Singh Virdi
ID: 39991691
Another method with DB link is
Create database link to_another connect to system identified by password using 'CONNTING_STRING';

select username from A, b@to_another
where a.username = b.username(+)
and b.username is null;

OR

you can use full outer join to see which schemas are mismatching

Then drop DB link.
0
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 39991869
use toad compare
http://software.dell.com/products/toad-development-suite-for-oracle/

it can generate a script for all the differences
0
 
LVL 22

Expert Comment

by:Steve Wales
ID: 40124042
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
Subquery in Oracle: Sub queries are one of advance queries in oracle. Types of advance queries: •      Sub Queries •      Hierarchical Queries •      Set Operators Sub queries are know as the query called from another query or another subquery. It can …
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now