expdp system/system schemas=newtbs dumpfile=dir:export_user_newtbs.dmp
---注意:如果newtbs2用户不存在,imp job 会自动为你建立
impdp system/system dumpfile=dir:export_user_newtbs.dmp remap_schema=newtbs:newtbs2
alter user newtbs identified by system account unlock;
grant resource,connect to newtbs2;
select default_tablespace from user_users;--变更用户使用还是newtbs用户的表空间
---remap_tablespace ---下面,就是把数据迁移到另一个表空间,事先建变更用户和变更表空间,且变更表空间空间要足
SQL> create tablespace target datafile '/oracle/target01.dbf' size 500m;
Tablespace created.
SQL> create user target identified by system default tablespace target account unlock;
User created.
SQL> grant resource,connect to target;
Grant succeeded.
impdp system/system dumpfile=dir:export_user_newtbs.dmp remap_schema=newtbs:target remap_tablespace=newtbs:target
---reuse_datafiles ---是否重新初始化转储文件中已经存在的create tablespace对应的数据文件,经测试我没有发现这个选择的功能,怪了???
expdp system/system tablespaces=newtbs dumpfile=dir:export_tablespace_newtbs.dmp
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9240380/viewspace-614648/
,如需转载,请注明出处,否则将追究法律责任。