Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: copy data

Re: copy data

From: gazzag <gareth_at_jamms.org>
Date: 15 Mar 2006 05:34:48 -0800
Message-ID: <1142429687.973888.274800@v46g2000cwv.googlegroups.com>


> Sorry, I'm pretty green at this. Would my SQL look like this ....
>
> connected to db1
> export * from stock
> truncate stock
> connected to db2
> import ???
>
> How would I specify a target for the export?

Import (imp) and export (exp) are both command-line utilities supplied by Oracle for moving data around. So, you want to do something like the following:

  1. Export the STOCK table from DB1 at the command-line:

exp <schema_name>/<schema_password> file=stock.dmp log=exp_stock.log tables=stock

2. Truncate the STOCK table on DB2 within SQL*Plus:

truncate table stock;

3. Import the export from DB1 into DB2 with the "ignore=y" parameter, again, at the command-line:

imp <schema_name>/<schema_password> file=stock.dmp log=imp_stock.log ignore=y full=y

The "ignore" parameter stops the import from failing when trying to create the STOCK table in DB2 (it already exists, it's empty after the truncate), whereas the "full" parameter imports the whole dumpfile. In this case the dumpfile contains only the one table.

HTH -g Received on Wed Mar 15 2006 - 07:34:48 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US