database 从 Oracle 转储文件重新导入特定表

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21230978/
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-08 09:10:25  来源:igfitidea点击:

Re-importing specific tables from Oracle dump file

databaseoracleimport

提问by yugesh

I imported a full oracle dump file into my database schema using the following command in linux ssh.

我在 linux ssh 中使用以下命令将完整的 oracle 转储文件导入到我的数据库模式中。

    impdp system/password directory=bckup schemas=sch101 dumpfile=sc101.dmp    remap_schema=sch101:MY_SCHEMA TABLE_EXISTS_ACTION=APPEND;

This command imported must of the tables into me target schema but some of the tables were skipped due to some constraint error. I wanted to try to import these tables into my database after fixing the problem one by one. I used following command for doing so,

此命令将必须的表导入我的目标模式,但由于某些约束错误,某些表被跳过。我想一一解决问题后尝试将这些表导入到我的数据库中。我使用以下命令这样做,

    impdp system/password DIRECTORY=bckup TABLES=TBL_NAME DUMPFILE=sch101.dmp remap_schema=sch101:MY_SCHEMA TABLE_EXISTS_ACTION=APPEND;

But this command returns me error:

但是这个命令返回我错误:

    ORA-39002: invalid operation
    ORA-39166: Object SYSTEM.TBL_NAME was not found.

I checked the name of the tables I tried to import in the export log file of the dump file that I used and they exist in the dump file. What is that silly mistake that I am doing here?

我在我使用的转储文件的导出日志文件中检查了我尝试导入的表的名称,它们存在于转储文件中。我在这里做的那个愚蠢的错误是什么?

采纳答案by Alex Poole

Because you're importing as systemfrom what is presumably a full (not schema) export, you need to specify the schema name in the tablesparameter, despite the presence of the schemaparameter:

因为您system从可能是完整(非架构)导出的内容中导入,所以您需要在tables参数中指定架构名称,尽管存在schema参数:

... TABLES=sch101.TBL_NAME ...

The error message you're getting refers to SYSTEM.TBL_NAME, which clearly (or hopefully, anyway) isn't what you want.

您收到的错误消息指的是SYSTEM.TBL_NAME,这显然(或希望,无论如何)不是您想要的。