使用SQLFILE参数导入转储不会返回表中的数据 [英] Import dump with SQLFILE parameter not returning the data inside the table

查看:183
本文介绍了使用SQLFILE参数导入转储不会返回表中的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用SQLFILE参数将转储文件导入到.sql文件。

I am trying to import the dump file to .sql file using SQLFILE parameter.

我使用命令impdp username / password DIRECTORY = dir DUMPFILE = sample。 dmp SQLFILE = sample.sql LOGFILE = sample.log

I used the command "impdp username/password DIRECTORY=dir DUMPFILE=sample.dmp SQLFILE=sample.sql LOGFILE=sample.log"

我预计这会返回一个sql文件,其中包含表内的内容。但是它创建了一个只有DDL查询的sql文件。

I expected this to return a sql file with contents inside the table. But it created a sql file with only DDL queries.

对于导出我使用了expdp username / password DIRECTORY = dir DUMPFILE = sample.dmp LOGFILE = sample.log FULL = y

For export I used, "expdp username/password DIRECTORY=dir DUMPFILE=sample.dmp LOGFILE=sample.log FULL=y"

转储文件大小为130 GB。所以,我相信转储已正确导出。

Dump file size is 130 GB. So, I believe the dump has been exported correctly.

我在导入命令中缺少一些东西?是否有任何其他参数应该用来获取内容?

Am I missing something in the import command? Is there any other parameter should I use to get the contents?

提前感谢!

推荐答案

您的期望是错误的,恐怕。

Your expectation was wrong, I'm afraid. You're asking it to do something it isn't designed for.

SQLFILE 的文档说:

The documentation for SQLFILE says:


目的

指定一个文件,导入的所有SQL DDL都将执行,基于其他参数。

Specifies a file into which all of the SQL DDL that Import would have executed, based on other parameters, is written.

因此它只会包含DDL。

So it will only ever contain DDL.

没有机制将 .dmp 文件转换为包含insert语句的 .sql 。如果您需要将数据放入表中,只需使用原生导入。

There isn't a mechanism to turn a .dmp file into a .sql containing insert statements. If you need to put the data into a table, just use the native import.

各个插入语句 - 如果可以生成它们,SQL Developer将单独执行任务与您的数据泵导出无关 - 会更慢,会有LOB的问题,并且必须小心他们运行的顺序,除非完整性约束被禁用。数据泵为您处理所有这些。

Individual insert statements - if you could generate them, which SQL Developer will do as a separate task unrelated to your data pump export - would be slower, would have problems with LOBs, and would have to be careful about the order they were run unless integrity constraints were disabled. Data pump takes care of all of that for you.

这篇关于使用SQLFILE参数导入转储不会返回表中的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆