【问题标题】:Having trouble exporting and importing Oracle tables导出和导入 Oracle 表时遇到问题
【发布时间】:2012-05-18 03:58:21
【问题描述】:

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

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

当我尝试:

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

结果我得到了以下异常:

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.

如果我尝试:

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

我明白了:

LRM-00101: unknown parameter name 'remap_tables'

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

【问题讨论】:

    标签: sql database oracle impdp


    【解决方案1】:

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

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

    【讨论】:

    • 如果我想重新映射架构并且只想导入几个表怎么办?
    【解决方案2】:

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

    【讨论】:

    • 我误解了语法。谢谢。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-04-14
    相关资源
    最近更新 更多