11i与r12 EBS迁移慎用per_people_v7

   oracle 标准的使用时也要谨慎,要向下了解清楚,在前期迁移的11i程序中有使用了 per_people_v7,这个标准人员视图中又有包裹 per_people_f 这个视图,然后这个视图条件中使用了hr_general.get_business_group_id,在这个hr_general.get_business_group_id中根据当前用户检查获取配置文件,使用我们常用方式fnd_profile.values, 这个fnd_profile.value 新版本与老版本的代码完全不同了,明显增加了get_profile_rowid 这个方法中就查询了fnd_profile_options 表,以RESULT_CACHE 结果集方式返回。造成性能问题,抛开其他因素,通过trace 发现 view执行一次,fnd_profile_options 这个查询了几十万甚至百万次。
decode(hr_general.get_xbg_profile,'Y',pap.business_group_id,hr_general.get_business_group_id)=pap.business_group_id;

begin
if(fnd_global.user_id=-1) then
   return (null);
else
   return (fnd_profile.value('PER_BUSINESS_GROUP_ID'));
end if;

end get_business_group_id;
目前发现的视图有PER_PEOPLE_F 这个视图,及使用到他的其他视图,如PER_PEOPLE_V7;org_organization_definitions 中查询HR_ORGANIZATION_UNITS  ou视图中也有相同使用;
总结:sql查询中 ,避免 fnd_profile 取数。

猜你喜欢

转载自cczmf.iteye.com/blog/2300744