Home » SQL & PL/SQL » SQL & PL/SQL » need some help with comparing 2 same database
need some help with comparing 2 same database [message #225514] Tue, 20 March 2007 03:41 Go to next message
xenite
Messages: 3
Registered: March 2007
Location: Malaysia
Junior Member
hi everyone, i'm new to this forum

currently i'm having some problem with sql command in comparing 2 same database. How do i comparing 2 same database? i will give u an example.HQ and Branch 1 has same database structure and same table but both at different location.
How to i compare both HQ and Branch 1 table if Branch 1 has some changes in the database and HQ need to update its database so that it has the same database as Branch 1.

thank in advance
Re: need some help with comparing 2 same database [message #225519 is a reply to message #225514] Tue, 20 March 2007 03:54 Go to previous messageGo to next message
Littlefoot
Messages: 20891
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
If I understood what you are saying, it is a database link that you need.
Re: need some help with comparing 2 same database [message #225527 is a reply to message #225514] Tue, 20 March 2007 04:14 Go to previous messageGo to next message
xenite
Messages: 3
Registered: March 2007
Location: Malaysia
Junior Member
thank for the fast response, may i know how to link those databases together? i'm very new to oracle and sql.Thank in advance
Re: need some help with comparing 2 same database [message #225536 is a reply to message #225527] Tue, 20 March 2007 04:52 Go to previous messageGo to next message
Littlefoot
Messages: 20891
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Database link describes path from one database to another. It is created using the CREATE DATABASE LINK command. After it is done, you'll do something like this: get all records that exist in a remote table, but not in this one:
INSERT INTO this_table
  SELECT * FROM another_table@db_link t2
  WHERE t2.id NOT IN (SELECT t1.id FROM this_table t1);
or
INSERT INTO this_table
  SELECT * FROM another_table@db_link
  MINUS
  SELECT * FROM this_table;
or some other variations of the same.
Re: need some help with comparing 2 same database [message #225539 is a reply to message #225514] Tue, 20 March 2007 05:00 Go to previous messageGo to next message
martijn
Messages: 283
Registered: December 2006
Location: Netherlands
Senior Member
If you can use the tool toad, you can do a compare of 2 schema's or even 2 whole databases.

toad however is not freeware.
Re: need some help with comparing 2 same database [message #225540 is a reply to message #225514] Tue, 20 March 2007 05:05 Go to previous messageGo to next message
xenite
Messages: 3
Registered: March 2007
Location: Malaysia
Junior Member
thank you both, but if i'm using toad how do i compare them? can you please explain to me martijn. Thank you

Littlefoot, i will try to use your way. thank again.
Re: need some help with comparing 2 same database [message #225543 is a reply to message #225540] Tue, 20 March 2007 05:10 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
If you have OEM's Change Manager (licensed option) you can also compare two databases, two schemas, etc.
Re: need some help with comparing 2 same database [message #225548 is a reply to message #225540] Tue, 20 March 2007 05:27 Go to previous message
Littlefoot
Messages: 20891
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
In TOAD, go to the DBA menu and select "Compare Schemas" or "Compare Databases".
Previous Topic: help with ...
Next Topic: Sending data to fax server
Goto Forum:
  


Current Time: Sat Dec 03 20:16:00 CST 2016

Total time taken to generate the page: 0.15745 seconds