oracle创建表空间导入dmp表

--收回dba权限
revoke dba from nfam2;
drop user nfam2 cascade;

drop tablespace NFAM2 including contents and datafiles cascade constraint;
drop tablespace NFAM_TEMP2 including contents and datafiles cascade constraint;

--创建临时表空间2.0
create  temporary tablespace NFAM_TEMP2
tempfile 'D:\app\yxt\oradata\orcl\nfam2.dbf'   
size 10240m   
autoextend on next 1024m  
 maxsize 20480m  
extent management local;

create tablespace NFAM2
logging  
datafile  'D:\app\yxt\oradata\orcl\nfam_2.dbf'   
size 10240M  
autoextend on next 2000M   
maxsize unlimited  
extent management local autoallocate   
segment space management auto ;

--创建用户并指定表空间2.0
create user nfam2 identified by nfam2 default tablespace NFAM2
temporary tablespace NFAM_TEMP2;  

--赋予普通链接权限2.0
grant resource, unlimited tablespace, create session, create view, create tablespace, select any table , select any dictionary, connect to nfam2;
grant dba to nfam2;

drop directory dumpfile;

create directory dumpfile as 'D:\database\dump\';
grant read,write on directory dumpfile to nfam2;

impdp nfam2/[email protected]:1521/orcl DIRECTORY=dumpfile DUMPFILE= impdp_TAMS4_20180423.dmp remap_schema=TAMS9:nfam2 remap_tablespace=BASE_DATA:NFAM2 transform=segment_attributes:n logfile=impdp_TAMS4_20180423.log;

 

 

你可能感兴趣的:(sql)