今天需要另一个数据库的用户表导入到当前库中,但用户名不相同,以前exp/imp时,可以指定fromuser和touser来解决,在expdp中也提供了类似的解决方法
impdp system/zlsoft dumpfile=expdp:EXPDP_ZLHIS.DMP nologfile=y tables=zlhis.dept remap_schema=zlhis:scott remap_tablespace=ZL9BASEITEM:users,zl9indexhis
:users,zl9indexmtl:users table_exists_action=truncate exclude=object_grant
几个重要参数的说明一下:
1、remap_user 重新映射用户,格式:
source_user1:target_user1,source_user2:target_user2
2、remap_tablespace 重新映射表空间
3、 table_exists_action 表已经存在的动作 有效关键字: (SKIP), APPEND, REPLACE 和 TRUNCATE。
4、exclude=object_grant 跳过对象授权