创建表空间

create tablespace coss datafile 'D:\soft\db\oracle\oradata\orcl\coss.dbf' size 1000m autoextend on next 100m;

创建临时表空间

create temporary tablespace coss_tmp tempfile 'D:\soft\db\oracle\oradata\orcl\coss_tmp' size 100m autoextend on maxsize 2000m;

创建用户导出数据库时所使用的用户,并赋予权限

create user coss identified by coss default tablespace coss temporary tablespace coss_tmp;

为用户授权

grant connect, resource, create view to coss;

创建逻辑目录,别忘了在系统中创建相同路径的物理目录,还要把需要导入的数据库放到该目录中

create or replace directory impdp_dir as 'D:\project\broada\impdp_dir';

给impdp_dir逻辑目录赋予coss02的操作权限

grant read,write on DIRECTORY impdp_dir to coss;

导入数据库

impdp coss/coss directory=impdp_dir logfile=coss.log dumpfile=coss.dmp

导出数据库

expdp coss/coss directory=dir dumpfile=COSS20171101.DMP schemas=coss job_name=cases_export2
04-28 18:48