如果使用impdp要看dump的内容,可以使用sqlfile参数,他会将所有的DDL语句写入文件,
SQLFILE
Write all the SQL DDL to a specified file.
如果使用imp要看dump的内容,可以使用show参数,默认值为n,
SHOW just list file contents (N)
但是今儿执行了指令imp,提示错误,
imp oracle/[email protected]:1521/lk fromuser=user_a touser=user_b file=/home/oracle/data.dmp log=/home/oracle/data.log show=y
...
illegal lob length marker 65279
bytesread = 00000000000
TABLE =
IMP-00098: INTERNAL ERROR: impgst2Segmentation fault
oerr显示00098是一个内部的错误,
oerr imp 00098
00098, 00000, "INTERNAL ERROR: %s"
// *Cause: An INTERNAL error occurred.
// *Action: Contact Oracle Worldwide Support.
针对这种错误,MOS这篇文章《Import Fails With IMP-98 Internal Error impgst2 Segmentation Fault Core Dumped (Doc ID 578616.1)》给出了介绍,
When executing the import command by adding the parameter SHOW=Y to scan the dump file, then the same error is reported.
出现这种错误的原因,就是dump文件出现了问题,要么因为导出工具所致,要么是因为mv/cp文件导致的,
The fact that running import with SHOW=Y generates same error indicates that the export dump file is corrupted.
When SHOW=Y is used, the content of the export dump file is listed to the display and not imported.
There are two ways an export dump file could be corrupted:
the export tool corrupts the file itself;
the file is corrupted during the transfer (move/copy) from the source to the target machine; this is the most common cause of the error.
相应的解决方案,就是重新导入,如果源端测试imp ... show=y报这个错误,则说明原始dump文件有问题,如果没错,移动文件在目标端执行imp ... show=y,要是提示错误,则说明传输过程中出现错误,
Since the export dump file is corrupt, the export needs to be done again:
After the export is finished, one should always check if the export dump file is corrupted on the source machine using imp with SHOW=Y. When getting the above errors, the file was corrupted on the source machine
Assuming the file is not corrupted on the source machine, after transferring the file, one must execute imp with SHOW=Y on target machine. If getting the above errors then the file was corrupted during transfer.
Use ftp command in binary mode as a way of transferring the dump file between source and target machines.
If imp with SHOW=Y reports no errors after the above steps then proceed with the real import.
需要注意的是,使用show=y并不会执行实际导入,因此若用show=y正常,再进行真实的导入操作,就比较稳妥了。
对于上面的案例,可惜的是原始文件就有问题,由于原始库已经无法访问,因此成了悬案。
针对导入导出,之前碰见了各种错误,朋友们若有兴趣,可以参考,若是碰见了其他的问题,欢迎文末回复,以提醒朋友们,再次碰见的时候,可以快速定位和解决,与人方便就是与己方便,《Oracle导入导出的常见错误》《解决导入过程中出现的ORA-02289错误》、《生产数据导入测试环境碰见的一些问题》、《使用exp导出报错EXP-00091》、《数据迁移中碰见的一些问题》、《如何验证dump文件的有效性》。