oracle 导出指定表

--exp:
file=d:/bak/exp0301.dmp
tables=u1.table1
query="where datatime>=to_date('2016-01-01','yyyy-mm-dd')"
statistics=none

--expdp:
SCHEMAS=u1
file=d:/bak/exp0301.dmp
tables=table1
query="where datatime>=to_date('2016-01-01','yyyy-mm-dd')"
statistics=none

-另外expdp的exclude,include
SCHEMAS=u1
DIRECTORY=expdpdir
DUMPFILE=expdp.dmp
LOGFILE=expdp.log
EXCLUDE=STATISTICS,TABLE:"IN('TABLE1','TABLE2')

另,批量导出前100行数据,线查询导出的表列表:

select a.OWNER||'.'||a.TABLE_NAME||','  from all_tables a where  a.OWNER in ('U1');
select a.OWNER||'.'||a.TABLE_NAME||':"where rownum<=100",'  from all_tables a where  a.OWNER in ('U1');

编辑par文件:

DIRECTORY=DATA_PUMP_DIR
DUMPFILE=expdp0905.dmp
exclude=STATISTICS
tables=(
U1.TABLE1,
U1.TABLE1
)
QUERY=(
U1.TABLE1:"where rownum<=100",
U1.TABLE2:"where rownum<=100"
)

最后执行导出即可

或者直接导出:
expdp \'/ as sysdba \' directory=DATA_PUMP_DIR dumpfile=expdp_test01.dmp tables=u1.table1,u1.table2  query='u1.table1:"where rownum <= 100"','u1.table2:"where rownum <= 100"' logfile=log01.log;

你可能感兴趣的:(--,Oracle,BAK&REC)