expdb导出数据库用户的数据,可以限制含(include), 或排除(exclude)某些表名,或按sql查询表名, 使用时需要用配置文件,如下:
--假设oracle用户为wisg,需排除一些_HIS结尾的表. %U为并行度的多个文件编号
[oracle@redhat-inux1 ~]$ more expdb_cfg_wisg.par
directory=wisgdump
dumpfile=wisg_expdb20200727_%U.dmp
SCHEMAS=wisg
logfile=wisg_expdb20200727.log
parallel=5
exclude=table:"in(select table_name from user_tables where table_name like '%_HIS' )"
[oracle@edhat-inux1 ~]$ expdp wisg/password@wisgdb parfile=expdb_cfg_wisg.par
其中directory要提前用sql创建,用于存放导入或导出的dump文件,例如这个目录/dmp/expdp
SQL> create or replace directory wisgdump as '/dmp/expdp';
SQL> grant read,write on directory wisgdump to wisg;
导出时参数CON