Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

data moving

Status
Not open for further replies.

abbath8

Programmer
Sep 20, 2003
40
HU
Hi,

There are two databases in different places. I want to copy some tables and their data from the one database to the another. How can I do it in the simplest way?
Thx.
 
Abbath8,

Probably the simplest method is the Oracle "exp" export utility, which, as one of its command-line parameters, allows, "tables=table1,table2,...tableN".

Then, on import, you can specify as parameters "fromuser=source_user touser=target_user".

Dave
 
If the places of your database are not very different (within the same LAN), you may also use COPY sql*plus command.

Regards, Dima
 
Why not just create a database link between the two DB's and then run a query to create the new table? I believe the format for that is:

CREATE PUBLIC DATABASE LINK "OtherDB"
USING 'OtherDB.MY.COM'

CREATE TABLE MyTable AS
SELECT * FROM MyTable@OtherDB;

Terry
**************************
* General Disclaimor - Please read *
**************************
Please make sure your post is in the CORRECT forum, has a descriptive title, gives as much detail to the problem as possible, and has examples of expected results. This will enable me and others to help you faster...
 
THoey,

True, database links can accommodate a "CREATE TABLE...AS SELECT...", but that construct does not re-create most declarative constraints (such as Primary Key, Foreign Key, Unique, and Check). Sure, you can re-create all those constraints by hand (or via SQL-writing-SQL), but at that point, we just disobeyed Abbath8's restriction, "...How can I do it in the simplest way?"

Dave
Sandy, Utah, USA @ 20:56 GMT, 13:57 Mountain Time
 
Thanks to everyone.I will look for more detailed info about the imp and exp.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top