以下导数据适用于,多个库的同一张表向某一个库合并数据(路由合并),有时会出现主建冲突,可忽略。
export ORACLE_SID=sid
expdp system/pass dumpfile=tt_%U.dmp tables=hx_qz.QZ_FWGLJD DIRECTORY=dp_dir logfile=impdp_zsj_qz.log PARALLEL=3 cluster = no EXCLUDE=TRIGGER,INDEX,GRANT,CONSTRAINT
export ORACLE_SID=sid
impdp system/pass dumpfile=tt_%U.dmp tables=hx_qz.QZ_FWGLJD DIRECTORY=dp_dir logfile=impdp_qz.log table_exists_action=append PARALLEL=3 cluster = no DATA_OPTIONS=SKIP_CONSTRAINT_ERRORS
--导入时忽略主键冲突,追加导入不重复的主键记录 选项 DATA_OPTIONS=SKIP_CONSTRAINT_ERRORS
--可以不用修改主键为disable :alter TABLE HX_QZ.QZ_JYJD modify primary key disable;
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
此sql适用于单个表的条件导入,直接拼写query参数据即可,\斜线为转义字符
export ORACLE_SID=sid
expdp system/pass dumpfile=HX1_%U.dmp DIRECTORY=dp_dir tables=hx_gzlyq.wd_modeldefine logfile=expdp_HX1_.log EXCLUDE=TRIGGER,INDEX,GRANT query=hx_gzlyq.wd_modeldefine:\"where substr\(orgid,1,3\) in \(\'137\'\)\"
export ORACLE_SID=sid
expdp system/pass dumpfile=HX2_%U.dmp DIRECTORY=dp_dir tables=hx_gzlyq.wr_model logfile=expdp_HX2_.log EXCLUDE=TRIGGER,INDEX,GRANT query=hx_gzlyq.wr_model:\"where \(defid like \'%_137%\'\)\"
scp HX1_* ip:/home/oracle
scp HX2_* ip:/home/oracle
export ORACLE_SID=sid
impdp system/pass dumpfile=HX1_%U.dmp tables=hx_gzlyq.wd_modeldefine DIRECTORY=dp_dir1 logfile=impdp_qz.log table_exists_action=append
export ORACLE_SID=sid
impdp system/pass dumpfile=HX2_%U.dmp tables=hx_gzlyq.wr_model DIRECTORY=dp_dir1 logfile=impdp_qz.log table_exists_action=append
阅读(1543) | 评论(0) | 转发(0) |