- create oracle目录,用user 登录sqlplus
create or replace directory dpdata1 as ‘/A/B‘;
- 给予权限, dba登录sqlplus
grant read,write on directory dpdata1 to user;
- 导出dmp
a.按表导出,bin目录下
./expdp user/[email protected] TABLES=table1,table2 dumpfile=expdp.dmp DIRECTORY=dpdata1;
b.按用户导出
./expdp user/[email protected] schemas=user dumpfile=expdp.dmp DIRECTORY=dpdata1;
- 导入dmp
a.导入按表导出的dmp,bin目录下
./impdp user/[email protected] DIRECTORY=dpdata1 DUMPFILE=expdp.dmp full=y logfile=impdlog.log ;
b.导入按用户导出的dmp
./impdp user/[email protected] DIRECTORY=dpdata1 DUMPFILE=expdp.dmp SCHEMAS=user logfile=impdlog.log ;
时间: 2024-10-12 20:18:01