--创建用户临时表空间
create temporary tablespace SCF_MAIN_TEMP
tempfile 'E:/app/data/TableSpace/SCF_MAIN_TEMP.dbf'
size 5120m
autoextend on
next 1024m maxsize 20480m
extent management local;


--创建用户数据表空间
create tablespace SCF_MAIN_DATA
logging
datafile 'E:/app/data/TableSpace/SCF_MAIN_DATA.dbf'
size 5120m
autoextend on
next 1024m maxsize 20480m
extent management local;


--创建用户并指定表空间
create user scfapp identified by scfapp
default tablespace SCF_MAIN_DATA
temporary tablespace SCF_MAIN_TEMP;


--给用户授予权限
grant connect,resource,dba,exp_full_database,imp_full_database to scfapp;


--创建关联用户并指定表空间
create user readonly identified by readonly
default tablespace SCF_MAIN_DATA
temporary tablespace SCF_MAIN_TEMP;


--给用户授予权限
grant connect,resource,dba,exp_full_database,imp_full_database to readonly;


--1.创建逻辑目录,该命令不会在操作系统创建真正的目录,最好以system等管理员创建。
create directory dpdata1 as 'd:\test\dump';


--2.给scfapp用户赋予在指定目录的操作权限,
grant read,write on directory dpdata1 to scfapp;


--导入语句

impdp scfapp/scfapp DIRECTORY=dpdata1 DUMPFILE=scfapp.dmp FULL=y logfile=scfapplog.log

 

imp leaseapp/leaseapp@127.0.0.1:1521/orcl file=D:/leaseapp.dmp fromuser=leaseapp log=D:/leaseapp.log

 

删除用户:drop user scfapp cascade;