Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

schema duplicate

Posted on 2014-04-10
5
Medium Priority
?
229 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 35

Accepted Solution

by:
johnsone earned 2000 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 38

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 23

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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
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 shows how to recover a database from a user managed backup
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

618 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