oracle impdp导入dmp文件时更改用户及表空间方法
impdp默认导入expdp的dmp文件时,是需要建立相同名称的表空间及临时表空间的;而且会自动创建相同名称的用户名。
但是有时候我们想更改这种默认设置,这个时候就要用到impdp的特殊参数remap_schema(更改用户名)及remap_tablespace(更改存储表空间);
假设我们有一个example.dmp文件,原来用户为olduser,存储空间为example,example_temp;
我们需要更改用户名及存储表空间导入到新的库中,只需要按照如下步骤进行:
1、建立新的表空间(假设名称:newtablespace)及临时表空间(假设名称:newtablespace_temp),语句如下
--表空间
create tablespace newtablespace
logging
datafile 'D:\app\Administrator\oradata\newtablespace.dbf'
size 50m
autoextend on
next 50m maxsize 20480m
extent management local;
--临时表空间
create temporary tablespace newtablespace_temp
tempfile &#