今天要将人力资源系统的人员表导入到OA系统,更新一下OA中人员照片,将遇到的问题及解决办法记录一下。因为照片为BLOB字段,无法通过dblink的方式访问,所以只能将员工表从HR数据库导入到OA数据库。
1.HR系统的数据库是orcle11.2,OA的数据库是oracle11.1,
直接用命令expdp ****@** dumpfile=employee.dmp
tables=t_employee导入时报错
ORA-01918 用户
** 不存在
ORA-00959 表空间** 不存在
要将用户与表空间映射一下。
使用命令impdp **/**@** dumpfile=employee.dmp
tables=t_employee remap_schema=hr_user:oa_user
remap_tablespace=hr_tablespace:oa_tablespace
logfile=employee.log。
网上查询的说明:
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 跳过对象授权