带有SQLFILE参数的导入转储没有返回表中的数据[英] Import dump with SQLFILE parameter not returning the data inside the table

本文是小编为大家收集整理的关于带有SQLFILE参数的导入转储没有返回表中的数据的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

我试图使用sqlfile参数将转储文件导入.sql文件.

我使用命令" impdp用户名/密码目录= dir dumpfile = sample.dmp sqlfile = sample.sql logfile = sample.log"

我希望这将返回表中有内容的SQL文件.但是它创建了一个只有DDL查询的SQL文件.

对于导出我使用了" expdp用户名/密码目录= dir dumpfile = sample.dmp logfile = sample.log full = y"

转储文件大小为130 GB.因此,我相信垃圾场已经正确出口了.

我是否缺少导入命令中的某些内容?我应该使用其他参数来获取内容吗?

预先感谢!

推荐答案

恐怕您的期望是错误的.您要它做它不是为此设计的事情.

>:

目的

指定一个文件,所有导入将根据其他参数执行的所有SQL DDL均已写入.

所以它只会包含DDL.

没有将.dmp文件转换为包含插入语句的机制.如果您需要将数据放入表中,只需使用本机导入即可.

单独的插入语句 - 如果您可以生成它们,那么SQL开发人员将作为与您的数据泵导出无关的单独任务执行的操作 - 将会较慢,将在群中遇到问题,并且必须谨慎对待他们的订单除非禁用完整性约束,否则运行.数据泵为您照顾所有这些.

本文地址:https://www.itbaoku.cn/post/597352.html

问题描述

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

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

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

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

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?

Thanks in advance!

推荐答案

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

The documentation for SQLFILE says:

Purpose

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

So it will only ever contain DDL.

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.

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.