小叶同学今早又来问题了,还是exp的问题,本来很简单的问题,这家伙太懒了,遇到问题都不先自己多测试几次,直接就开问,打算把他的问题全部都记录起来
首先是这个截图的问题,原因是 query里面 1=1,没有where关键字
接下来问题又来了,如下:
这里面有两个问题:
1,exp命令最后还加了个“;”号
2,query里面的特殊符号都需要转义,"1<>1"里面的<>也需要转义
测试如下:
[oracle@goolen ~]$ exp userid=scott/tiger tables=emp file=./ab.dmp query=\"1=1\" STATISTICS=none
Export: Release 10.2.0.4.0 - Production on Mon Dec 29 11:30:07 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 AL32UTF8 character set and AL16UTF16 NCHAR character set
server uses WE8ISO8859P1 character set (possible charset conversion)
About to export specified tables via Conventional Path ...
. . exporting table EMP
EXP-00056: ORACLE error 933 encountered
ORA-00933: SQL command not properly ended
Export terminated successfully with warnings.
[oracle@goolen ~]$ exp userid=scott/tiger tables=emp file=./ab.dmp query=\"where 1<>1\"; STATISTICS=none
LRM-00111: no closing quote for value 'where'
EXP-00019: failed to process parameters, type 'EXP HELP=Y' for help
EXP-00000: Export terminated unsuccessfully
[oracle@goolen ~]$ exp userid=scott/tiger tables=emp file=./ab.dmp query=\"where 1<>1\" STATISTICS=none
LRM-00111: no closing quote for value 'where STAT'
EXP-00019: failed to process parameters, type 'EXP HELP=Y' for help
EXP-00000: Export terminated unsuccessfully
[oracle@goolen ~]$ exp userid=scott/tiger tables=emp file=./ab.dmp query=\"where 1\1\" STATISTICS=none
Export: Release 10.2.0.4.0 - Production on Mon Dec 29 11:30:27 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 AL32UTF8 character set and AL16UTF16 NCHAR character set
server uses WE8ISO8859P1 character set (possible charset conversion)
About to export specified tables via Conventional Path ...
. . exporting table EMP 0 rows exported
Export terminated successfully without warnings.
![](http://img.blog.itpub.net/blog/attachment/201412/29/23249684_1419823553z7sV.jpg?x-oss-process=style/bb)
首先是这个截图的问题,原因是 query里面 1=1,没有where关键字
接下来问题又来了,如下:
![](http://img.blog.itpub.net/blog/attachment/201412/29/23249684_1419823679Ff06.png?x-oss-process=style/bb)
这里面有两个问题:
1,exp命令最后还加了个“;”号
2,query里面的特殊符号都需要转义,"1<>1"里面的<>也需要转义
测试如下:
[oracle@goolen ~]$ exp userid=scott/tiger tables=emp file=./ab.dmp query=\"1=1\" STATISTICS=none
Export: Release 10.2.0.4.0 - Production on Mon Dec 29 11:30:07 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 AL32UTF8 character set and AL16UTF16 NCHAR character set
server uses WE8ISO8859P1 character set (possible charset conversion)
About to export specified tables via Conventional Path ...
. . exporting table EMP
EXP-00056: ORACLE error 933 encountered
ORA-00933: SQL command not properly ended
Export terminated successfully with warnings.
[oracle@goolen ~]$ exp userid=scott/tiger tables=emp file=./ab.dmp query=\"where 1<>1\"; STATISTICS=none
LRM-00111: no closing quote for value 'where'
EXP-00019: failed to process parameters, type 'EXP HELP=Y' for help
EXP-00000: Export terminated unsuccessfully
[oracle@goolen ~]$ exp userid=scott/tiger tables=emp file=./ab.dmp query=\"where 1<>1\" STATISTICS=none
LRM-00111: no closing quote for value 'where STAT'
EXP-00019: failed to process parameters, type 'EXP HELP=Y' for help
EXP-00000: Export terminated unsuccessfully
[oracle@goolen ~]$ exp userid=scott/tiger tables=emp file=./ab.dmp query=\"where 1\1\" STATISTICS=none
Export: Release 10.2.0.4.0 - Production on Mon Dec 29 11:30:27 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 AL32UTF8 character set and AL16UTF16 NCHAR character set
server uses WE8ISO8859P1 character set (possible charset conversion)
About to export specified tables via Conventional Path ...
. . exporting table EMP 0 rows exported
Export terminated successfully without warnings.
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/23249684/viewspace-1383504/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/23249684/viewspace-1383504/