Oracle导出时报00904,exp导出报错ORA-00904

Oracle导出时报00904,exp导出报错ORA-00904小叶同学用exp导出数据,加了query参数,结果命令执行报ORA-00904错误如果query在命令行直接指定的话,所有的特殊字符都需要做转义的,如果是放到参数文件里,就无需转义了简单的做个测试:[oracle@goolengoolen]$expuserid=scott/tigertables=empfile=./a.dmpquery=\’whereename=’SCOTT’\’E…

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全家桶1年46,售后保障稳定

小叶同学用exp导出数据,加了query参数,结果命令执行报ORA-00904错误

如果query在命令行直接指定的话,所有的特殊字符都需要做转义的,如果是放到参数文件里,就无需转义了

简单的做个测试:

[oracle@goolen goolen]$ exp userid=scott/tiger tables=emp file=./a.dmp query=\’where ename=’SCOTT’\’

Export: Release 10.2.0.4.0 – Production on Tue Dec 23 11:54:47 2014

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 – 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

Export done in WE8ISO8859P1 character set and AL16UTF16 NCHAR character set

About to export specified tables via Conventional Path …

. . exporting table                            EMP

EXP-00056: ORACLE error 904 encountered

ORA-00904: “SCOTT”: invalid identifier

Export terminated successfully with warnings.

[oracle@goolen goolen]$

转义后可以成功导出:

[oracle@goolen goolen]$ exp userid=scott/tiger tables=emp file=./b.dmp query=\”where\ ename\=\’SCOTT\’\”  STATISTICS=none

Export: Release 10.2.0.4.0 – Production on Tue Dec 23 11:55:45 2014

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 – 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

Export done in WE8ISO8859P1 character set and AL16UTF16 NCHAR character set

About to export specified tables via Conventional Path …

. . exporting table                            EMP          1 rows exported

Export terminated successfully without warnings.

把query加到parfile里:

[oracle@goolen goolen]$ cat parfile

query=”where ename=’SCOTT'”

[oracle@goolen goolen]$ exp userid=scott/tiger tables=emp file=./c.dmp parfile=./parfile STATISTICS=none

Export: Release 10.2.0.4.0 – Production on Tue Dec 23 11:57:48 2014

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 – 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

Export done in WE8ISO8859P1 character set and AL16UTF16 NCHAR character set

About to export specified tables via Conventional Path …

. . exporting table                            EMP          1 rows exported

Export terminated successfully without warnings.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/23249684/viewspace-1377028/,如需转载,请注明出处,否则将追究法律责任。

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/219257.html原文链接:https://javaforall.net

(0)
上一篇 2025年7月6日 下午8:22
下一篇 2025年7月6日 下午9:01


相关推荐

  • hadoop如何查看文件系统

    hadoop如何查看文件系统

    2021年8月25日
    67
  • Kafka学习之一 Kafka是什么,主要应用在什么场景?

    Kafka学习之一 Kafka是什么,主要应用在什么场景?Kafka是什么,主要应用在什么场景,能为我们解决什么问题

    2022年10月13日
    9
  • 原型模式的应用场景_原型化开发方法

    原型模式的应用场景_原型化开发方法ProtoType 原型模式动机模型定义实例结构要点总结笔记动机在软件系统中,经常面临着”某些结构复杂的对象“的创建工作;由于需求的变化,这些对象经常面临着剧烈的变化,但是它们却拥有比较稳定一致的接口如何应对这种变化?如何向”客户程序“(使用这些对象的程序)”隔离出“这些易变对象,从而使得”依赖这些易变对象的客户程序“不随着需求变化而变化?模型定义使用原型实例指定创建对象的种类,然后通过拷贝这些原型来创建新对象。实例和工厂模型用的同一个实例工厂模式//工厂class SplitterF

    2022年8月9日
    5
  • RowBounds[通俗易懂]

    RowBounds[通俗易懂]在mybatis中,使用RowBounds进行分页,非常方便,不需要在sql语句中写limit,即可完成分页功能。但是由于它是在sql查询出所有结果的基础上截取数据的,所以在数据量大的sql中并不适用,它更适合在返回数据结果较少的查询中使用最核心的是在mapper接口层,传参时传入RowBounds(intoffset,intlimit)对象,即可完成分页。不需要修改xml配置添加limitmapper接口层代码如下List<Book>selectBoo

    2022年4月19日
    53
  • DEDECMS开启邮箱验证通知的解决方法

    DEDECMS开启邮箱验证通知的解决方法

    2021年9月25日
    44
  • 深入分析消息列队CMQ七大功能

    深入分析消息列队CMQ七大功能2019 独角兽企业重金招聘 Python 工程师标准 gt gt gt

    2026年3月18日
    2

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号