Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: copy data
> 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:
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