Solved

schema duplicate

Posted on 2014-04-10
5
213 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
Comment Utility
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
Comment Utility
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 36

Expert Comment

by:Geert Gruwez
Comment Utility
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
Comment Utility
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.

Join & Write a Comment

Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines

771 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

11 Experts available now in Live!

Get 1:1 Help Now