一、数据泵(expdp和impdp)
1、expdp
①在数据库中创建导出数据的目录
create or replace directory exp_dir as 'd:\or_exp_dir';
②把目录授权给bankuser
grant read,write on directory exp_dir to scott;
③用expdp导出数据
expdp scott/tiger@orcl directory=exp_dir dumpfile=test.dmp logfile=testExp.log
1)按用户导
expdp scott/tiger@orcl schemas=scott dumpfile=expdp.dmp DIRECTORY=dpdata1;
2)并行进程parallel
expdp scott/tiger@orcl directory=dpdata1 dumpfile=scott3.dmp parallel=40 job_name=scott3
3)按表名导
expdp scott/tiger@orcl TABLES=emp,dept dumpfile=expdp.dmp DIRECTORY=dpdata1;
4)按查询条件导
expdp scott/tiger@orcl directory=dpdata1 dumpfile=expdp.dmp Tables=emp query='WHERE deptno=20';
5)按表空间导
expdp system/manager DIRECTORY=dpdata1 DUMPFILE=tablespace.