导出和导入 Oracle 表时遇到问题

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10519430/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 00:48:07  来源:igfitidea点击:

Having trouble exporting and importing Oracle tables

sqldatabaseoracleimpdp

提问by Vampnik

I'm using Oracle 11 and I'm having trouble moving tables between two databases. I've successfully exported a datadumb as follows:

我正在使用 Oracle 11,但在两个数据库之间移动表时遇到问题。我已经成功导出了一个 datadumb 如下:

expdp.exe www/www@xe tables=TABLE1,TABLE2,TABLE3 directory=dmpdir dumpfile=tables.dmp

When I try to:

当我尝试:

impdp.exe www2/www2@xe tables=TABLE1,TABLE2,TABLE3 directory=dmpdir dumpfile=tables.dmp

As a result I got the following exception:

结果我得到了以下异常:

ORA-39002: invalid operation
ORA-39166: Object WWW2.TABLE1 was not found.
ORA-39166: Object WWW2.TABLE2 was not found.
ORA-39166: Object WWW2.TABLE3 was not found.

If I try to:

如果我尝试:

impdp.exe www2/www2@xe remap_tables=WWW2:TABLE1,TABLE2,TABLE3 directory=dmpdir dumpfile=tables.dmp

I get:

我得到:

LRM-00101: unknown parameter name 'remap_tables'

In my situation I can't use a database link. How can I change the schema when importing and exporting my tables? Have I somehow misunderstood Oracle?

在我的情况下,我无法使用数据库链接。导入和导出表时如何更改架构?我是否以某种方式误解了 Oracle?

回答by Phil

Use REMAP_SCHEMA=WWW:WWW2and drop the tables=clause.

使用REMAP_SCHEMA=WWW:WWW2和删除tables=子句。

impdp.exe www2/www2@xe REMAP_SCHEMA=WWW:WWW2 directory=dmpdir dumpfile=tables.dmp

回答by DCookie

I think you want the REMAP_SCHEMAparameter. The REMAP_TABLE(note the spelling) parameter is for changing the name of a table, not the schema it belongs to.

我想你想要REMAP_SCHEMA参数。该REMAP_TABLE(注意拼写)参数是改变一个表的名称,而不是架构它属于。