⽰例1:如果where条件⾥⽆字符串
语句:
expdp scott/oracle directory=xx dumpfile=emp.dmp tables=emp query='emp:"WHERE deptno=20"';记住我
如果是多张表
语句:
expdp scott/oracle directory=xx dumpfile=emp.dmp tables=emp,emp2,emp3 query='emp:"WHERE deptno=20"','emp2:"WHERE age=20"','emp3:"WHERE year=2020"'
⽰例2:要求把user_name='hh'的这条数据导出来如果query⾥的条件是字符串的话,就要⽤下⾯这种⽅法:
先写出⼀个参数⽂件txt.par
dumpfile=1emp.dmp
directory=xx
tables=(emp)
query=(emp:"where username='hh'")
然后执⾏导出语句:
expdp scott/oracle parfile=txt.par
如果是多张表
tables=(emp1,emp2,emp3)
query=(emp:"where username='hh'",emp2:"where username='hh'",emp3:"where username='hh'")
注:如果query⾥的条件是字符串还⽤案例1的⽅法,就会报错
ORA-31693: Table data object "SCOTT"."EMP" failed to load/unload and is being skipped due to error:
ORA-00904: "hh": invalid identifier
发布评论