如何指定exp的query参数以导出部份记录?

    Oracle的exp工具有一个query参数可以指定一个where条件来有条件地导出记录, 对于不经常用这个选项的人来说, 经常会遇到这样的错误:

LRM-00112: multiple values not allowed for parameter 'query'

EXP-00019: failed to process parameters, type 'EXP HELP=Y' for help
EXP-00000: Export terminated unsuccessfully

    这是因为在where条件中一般都会有空格, 而命令行下就会被释成几个命令行参数, 需要用单引号或双引号将整个where条件括起来, 就可以了. 在Windows下, 如何指定query参数:

exp ... query='where deptno=10'
exp ... query='where deptno=''10'''
exp ... query='where deptno"<"10'

    在Solaris(C shell)下, 如何指定query参数:

exp ..... query=\"where col1 \< 1000\"
exp ..... query=\"where col1 \< '1000'\"

    其他Unix平台的应当和Solaris下的一样, 我自已也经常搞错. 在上面的例子中已经说明了如何在query值中使用单引号, 因此在看完这篇后, 就应当可以写出正确的where条件了. 最好是写在一个参数文件里, 这样的话就不用注意这些了.

留言 (4)

对于这种,,个人建议使用parfile..

在Solaris(C shell)下, 如何指定query参数:

exp ..... query=\"where col1 \ exp ..... query=\"where col1 \ 其他Unix平台的应当和Solaris下的一样,

在 LINUX下还是有区别
exp hyf f file= RVER/ora10/a.dmp tables=mycolumns query=\"where owner \= \'SYSTEM\'\"

请问碰到了start with这样的怎么过导阿。不带where语句的

CTAS到一个表, 再导出吧.

发表留言:

« Previous | Main | Next »

英语900句 | English 900

  • Well, it depends.
  • 这得视情况而定.
  • I don't think it's necessary for us to discuss this question any further.
  • 我想我们没有必要进一步讨论这个问题.
  • There are always two sides to everything.
  • 每件是都有两面性.
  • Finally, we came to an agreement.
  • 最后我们达成了一致.
  • I want to be a journalist after graduation.
  • 毕业后我想当记者.