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.
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".
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...
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
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.