# oracle expdp impdp 导出多张表结构ddl
-- 查找有哪些表
SELECT * FROM dba_tables t where t.OWNER in ('MDIKDATA') and
regexp_like (t.TABLE_NAME,'_1$') order by t.OWNER,t.TABLE_NAME;
--export NLS_LANG="SIMPLIFIED CHINESE_CHINA.ZHS16GBK"
export NLS_LANG=american_america.AL32UTF8
vi expdp_MDIKDATA_tab1_meta_20230119.par
directory=dumpdir
dumpfile=expdp_MDIKDATA_tab1_meta_20230119.dmp
logfile=expdp_MDIKDATA_tab1_meta_20230119.log
cluster=no
content=metadata_only
tables=MDIKDATA.UPM_QRTZ_PAUSED_TRIGGER_GRPS,
MDIKDATA.UPM_QRTZ_JOB_LOG,
MDIKDATA.TASK_IMG_ACCOUNT_TEMP,
MDIKDATA.UWK_RU_PROPERTY,
MDIKDATA.UWK_RU_EXECUTION,
MDIKDATA.UWK_RE_PROCDEF,
MDIKDATA.UWK_HI_PROCINST
-- 执行导出
expdp \"/ as sysdba\" parfile=expdp_MDIKDATA_tab1_meta_20230119.par
scp expdp_MDIKDATA_tab1_meta_20230119.dmp op12c@00.00.33.15:/data01/dumpdir/
-- crt客户端终端编码是utf8,impdp文件是ZHS16GBK编码,直接more查看中文乱码,下载用utraedit看是正常的
NLS_LANG=american_america.ZHS16GBK
-- 传到中间库生成sql
export NLS_LANG=american_america.AL32UTF8
impdp \'/ as sysdba\' directory=dumpdir dumpfile=expdp_MDIKDATA_tab1_meta_20230119.dmp logfile=impdp_MDIKDATA_tab1_meta_20230119.log cluster=no sqlfile=expdp_MDIKDATA_tab1_meta_20230119.sql exclude=grant,statistics,trigger