How to specify query option of Oracle export utility.

Links: http://www.dbatools.net/experience/export_query_option.html

    There is a "query" option in Oracle exp utility, which enables you export filtered rows of a table by providing a where clause with this option. However this option is not widely used, many people do not clearly know how to specify a value for this option in Windows or UNIX platform, including me, and always get the following errors:

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

    This is due the value always contains multiple words, we must to pack them together as one value to the exp utility by quoting the values. On Windows, we could specify this value as following:

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

    On UNIX platform, I tested the following command on Solaris, it works well.

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

    On other UNIX platform, it should work also. Now you should be able to use it freely. The simplest way is to prepare a parameter file for export utility, then you do not need to quote the value at all.

Post a comment

« Previous | Main | Next »

Powered by
Movable Type 3.36