--SQLPLUS连接数据库
C:UsersAdministrator>sqlplus system/123123@zjorcl as sysdba
--创建逻辑目录
create or replace directory DUMPDIR as 'E:unzip_projectzj_databases';
--创建B表空间和用户
create tablespace DATA_INDB datafile 'D:sqlplus ablespasezjorclDATA_INDB.dbf' size 51200M AUTOEXTEND on next 100M extent management local;
注:单引号里面的文件名与表空间名字相同
create user INDBADMIN identified by INDBADMIN default tablespace DATA_INDB temporary tablespace temp;
grant connect to INDBADMIN;
grant resource to INDBADMIN;
grant dba to INDBADMIN;
--给用户授权
grant read, write on directory DUMPDIR to INDBADMIN;
--导入备份文件 DOS命令行执行下列命令
impdp INDBADMIN/INDBADMIN@orcl transform=segment_attributes:n directory=DUMPDIR dumpfile=indbadmin20190730.dmp logfile=indbadmin20190730.log remap_schema =INDBADMIN:INDBADMIN
impdp ilanni/numen@192.168.24.249:/orcl transform=segment_attributes:n directory=wpdp_dir remap_schema=numen: ilanni dumpfile=140109.dmp logfile=1401092.log
--注:remap_schema=INDBADMIN:INDBADMIN表示把左边的INDBADMIN用户的数据,导入到右边的INDBADMIN用户里面
ALTER TABLESPACE SYSAUX ADD DATAFILE 'D:sqlplus ablespasezjorclSYSAUX.DBF' SIZE 4096M;
ALTER TABLESPACE UNDOTBS1 ADD DATAFILE 'D:sqlplus ablespasezjorclUNDOTBS1.DBF' SIZE 4096M;
ALTER TABLESPACE SYSTEM ADD DATAFILE 'D:sqlplus ablespasezjorclSYSTEM.DBF' SIZE 4096M;
ALTER TABLESPACE DATA_INDB ADD DATAFILE 'D:sqlplus ablespasezjorclDATA_INDB2.DBF' SIZE 30720M;
drop tablespace DATA_INDB including contents and datafiles;
drop user INDBADMIN cascade;
drop tablespace DATA_MKDB including contents and datafiles;
drop user MK_DB cascade;
drop user KETTLE cascade;