[Oracle EBS R12]SQL Queries and Multi-Org Architecture in Release 12 (Doc ID 462383.1)
In this Document
| Abstract |
| History |
| Details |
| Previous Releases |
| Release 12 |
| Multi-Org Session Context |
| Backwards Compatibility |
Applies to:
Oracle Project Foundation - Version 12.0.0 to 12.1.3 [Release 12.0 to 12.1] Information in this document applies to any platform. *** Checked for relevance on 04-May-2015 ***
Abstract
This paper will review changes in the multi-org architecture in Release 12 designed to enable the Multi-Org Access Control (MOAC) feature. It will discuss how this impacts the users ability to access data from multi-org enabled objects via SQL*Plus or other client query tools outside of the applications.
History
Author : Andrew Lumpe Create Date 11-Oct-2007 Update Date 11-Oct-2007 Expire Date
Details
In Release 12, the architecture of multi-org and the way in which data is partitioned by operating unit has changed significantly. As a result the ways in which data are stored and accessed has changed.
Previous Releases
In previous releases, data was restricted to a single operating unit using views which striped base table data based on the current operating unit setting.
- Base tables (generally named with ‘_ALL’, e.g. MY_TABLE_ALL) contained data for all operating units.
- Each such table contained a column named ORG_ID to indicate what operating unit a particular row belonged to.
- Data was then restricted by using restricted views (e.g. MY_TABLE) which would only return rows which corresponded to the current operating unit’s organization ID.
- The current operating unit was stored in the first 10 characters of the database Application Context variable CLIENT_INFO.
- When logging into the applications, the CLIENT_INFO value was set to the appropriate operating unit organization ID for the session based on the profile option setting for “MO: Operating Unit”.
- In SQL*Plus, CLIENT_INFO could be set to point to a particular operating unit using
execute dbms_application_info.set_client_info(‘<ORG_ID>’);
Release 12
In release 12 a more flexible architecture has been put in place to support Multi-Org Access Control (MOAC). This architecture allows users to define security profiles so that users may access data for more than one operating unit within a single responsibility. To accomplish this
- Multi-org views have been removed, and replaced with synonyms. For example, MY_TABLE would no longer be a view defined on MY_TABLE_ALL, but rather a synonym which points to MY_TABLE_ALL
- The data restriction is accomplished by assigning a virtual private database (VPD) policy to the synonym. This policy allows the system to dynamically generate restricting conditions when queries are run against the synonym.
Data relating to defined VPD policies is viewable in the data dictionary view DBA_POLICIES. These policies associate a function with an object, and when the object is accessed, this function can return additional restrictions on the object to restrict the data returned. The particular policy used to implement Multi-Org in release 12 is:
- Policy_name: ORG_SEC
- Policy_group: SYS_DEFAULT
- Package: MO_GLOBAL
- Function: ORG_SECURITY
The function (MO_GLOBAL.ORG_SECURITY) is called with the following parameters:
- obj_schema - the object schema, in this case APPS
- obj_name – the object name (e.g., MY_TABLE)
The function then returns additional where clause conditions to restrict the data accessible from the object. The structure of this function will dynamically generate conditions which will either:
- Restrict the data to a single operating unit if the access mode is Single
- Restrict the data to multiple operating units if the access mode is Multiple
- Restrict the data to eliminate only seed data rows if the access mode is All
- Restrict the data to not return any rows if the access mode is None
The conditions returned in each case are as follows:
Single OU Access
Only data for the current operating unit is accessible. The value of sys_context('multi_org2','current_org_id') would have to be set to the current operating unit as described below.
Multiple OU Access
The user will be able to access data for any org_id which has been populated into mo_glob_org_access_tmp. When a session is initialized in the applications, values will be populated into mo_glob_org_access_tmp for each of the operating units the user has access to based on their "MO: Security Profile" setting.
All OU Access
Seed template records, which are used to create new seed data when a new operating unit is created. are created with an org_id of –3113. So in this mode, only these template records, which do not correspond to any actual operating unit, will be filtered out.
No OU Access
The condition is never satisfied. No data will be returned from the object.
Multi-Org Session Context
The database utility DBMS_SESSION.SET_CONTEXT(<namespace>, <attribute>, <value>) is used to initialize and set the Multi-Org context information for a user’s session. The utility SYS_CONTEXT(<namespace>, <attribute>) is used to retrieve this data. The key context items are:
| Namespace | Attribute | Value |
|---|---|---|
| multi_org | access_mode | S=Single, M=Multiple, A=All, X=None |
| multi_org2 | current_org_id | Operating unit org id, only applicable if access mode is Single |
dbms_session.set_context('multi_org','access_mode','S');myvar := sys_context('multi_org','access_mode');dbms_output.put_line('Access Mode: '||myvar);
However, it is generally preferable to use the following wrapper functions from MO_GLOBAL which will call the appropriate utilities to maintain the various elements of the multi-org context:
Procedure: SET_POLICY_CONTEXT(p_access_mode varchar2, p_org_id number) This procedure will set the access mode, and when applicable the current operating unit context.
Procedure: SET_ORG_ACCESS(p_org_id_char varchar2, p_sp_id_char varchar2, p_appl_short_name varchar2) This procedure determines if the application specified has multi-org access control enabled, by querying FND_MO_PRODUCT_INIT for the application short name. If this is enabled, and a security profile is specified (p_sp_id_char), then all orgs the user has access to will be populated in MO_GLOB_ORG_ACCESS_TMP. If there are more than one such org, the access method will be set to "Multiple". Otherwise if no security profile id is specified, it will use the value of p_org_id to set the current operating unit value and set the access mode to "Single".
Procedure: INIT(p_appl_short_name varchar2) The procedure used by the applications when starting a new session. Based on the profile options "MO: Operating Unit" (ORG_ID) and "MO: Security Profile" (XLA_MO_SECURITY_PROFILE_LEVEL), this procedure calls set_org_access to establish the multi-org context for the session. To call this from withing SQL, the profile option context should have been initialized for the session.
Function: GET_CURRENT_ORG_ID Returns the current operating unit setting. This should be null if the access mode is not 'S'
Function: GET_ACCESS_MODE Returns the current access mode value.
a) If you know the security_profile_id for that responsibility and user, you could call:
execute mo_global.set_org_access(null, <sp_id>, 'PA');
Security profiles are stored in PER_SECURITY_PROFILES, and the final parameter is the application short name of the application associated with the responsibility you would be using.
b) If you do not know the security profile or operating unit profile option settings for your user, responsibility and application, you could use code similar to the following to get this information:
declarel_user_id fnd_user.user_id%type;l_resp_id fnd_responsibility.responsibility_id%type;l_appl_id fnd_application.application_id%type;l_appl_short_name fnd_application_vl.application_short_name%type;l_ou_value fnd_profile_option_values.profile_option_value%type;l_sp_value fnd_profile_option_values.profile_option_value%type;beginselect user_idinto l_user_idfrom fnd_userwhere user_name = upper('&user_name');select responsibility_idinto l_resp_idfrom fnd_responsibility_vlwhere responsibility_name = ('&resp_name');select application_id,application_short_nameinto l_appl_id,l_appl_short_namefrom fnd_application_vlwhere application_short_name = upper('&appl_short_name');l_ou_value := fnd_profile.value_specific( 'ORG_ID',l_user_id, l_resp_id, l_appl_id);l_sp_value := fnd_profile.value_specific( 'XLA_MO_SECURITY_PROFILE_LEVEL', l_user_id, l_resp_id, l_appl_id);dbms_output.put_line('MO: Operating Unit: '||l_ou_value);dbms_output.put_line('MO: Security Profile: '||l_sp_value);if l_sp_value is null and l_ou_value is nullthen dbms_output.put_line('No operating unit or security profile information found');else mo_global.set_org_access(l_ou_value, l_sp_value, l_appl_short_name);end if;exception when others thendbms_output.put_line('Error: '||sqlerrm);end;/
2) To set the operating unit context to a single operating unit, you could simply use:
execute mo_global.set_policy_context(‘S’,<org_id>);
Backwards Compatibility
When running queries on multi-org objects in SQL, you can still use the old CLIENT_INFO settings to gather data and run queries against multi-org objects if the profile option:
MO: Set Client_Info for Debugging (FND_MO_INIT_CI_DEBUG)
is set to "Yes". When this profile option is set to “Yes” and the global access mode setting is null (as it would be in a SQL*Plus or other client session unless specifically set), the VPD function MO_GLOBAL.ORG_SECURITY will return the following as the additional where clause condition for the object:
This will limit the data returned by the object to the current value set in CLIENT_INFO. This value is set as described at the beginning of this article under "Previous Releases".
[Oracle EBS R12]SQL Queries and Multi-Org Architecture in Release 12 (Doc ID 462383.1)的更多相关文章
- Using Load-Balancers with Oracle E-Business Suite Release 12 (Doc ID 380489.1)
Using Load-Balancers with Oracle E-Business Suite Release 12 (Doc ID 380489.1) Modified: 12-Jun-20 ...
- How to Determine the Version of Oracle XML Publisher for Oracle E-Business Suite 11i and Release 12 (Doc ID 362496.1)
Modified: 29-Mar-2014 Type: HOWTO In this DocumentGoal Solution 1. Based upon an output file gen ...
- Oracle EBS R12 (12.1.3) Installation Linux(64 bit)
Oracle EBS R12 (12.1.3) Installation Linux(64 bit) Contents Objective. 3 1 Download & Unzip. 3 D ...
- Oracle EBS R12文件系统结构(学习汇总网上资料)
Oracle EBS R12在服务器端文件结构如下: 顶层目录下面分为 1)inst --–跟ebs整个实例(instance)相关的配置信息以及其他信息 2) db ---主要存储DB层的信息 ...
- Oracle EBS R12经验谈(二)
作者: jianping.ni 时间: 2009-2-13 12:52 标题: Oracle EBS R12经验谈(二) OAF页面:银行帐户开户人LOV值列表无值 在输入 应付超 ...
- Oracle EBS R12多组织(多OU)访问架构
Oracle EBS R12多组织访问架构 多组织架构实现了经营单位(OU)的数据安全性,在底层数据表中有一列ORG_ID来记录数据所属的经营单一,所有多OU的基表都是以"_ALL" ...
- Oracle EBS R12多组织访问架构
关于R12的新特性Multi-Org Access Control(MOAC).Oracle宣传的好处主要有:1.enable users to access to secured data in o ...
- Oracle Ebs R12 SLA与GL关系变化
http://www.cnblogs.com/bruce_zhao/p/3809886.html Oracle Ebs R12 SLA与GL关系变化 SLA概念:SLA(Subledger Accou ...
- 处理Oracle EBS R12登录首页跳转出现unexpected error问题(转)
原文地址: 处理Oracle EBS R12登录首页跳转出现unexpected error问题 经上网搜索,造成此问题的问题有很多,如内存不足.系统参数配置不当.程序代码.系统表空间不足等原因.查询 ...
随机推荐
- MSP430F5438内部延时函数的用法
今天看示例程序中出现了__delay_cycles()这个函数,在查找msp430x54x.h这个头文件的时候,发现这个头文件中没有该函数的声明,原来这个函数已经在IAR这个编译器中集成,这里总结一下 ...
- 【译】 AWK教程指南 5AWK中的数组
awk程序中允许使用字符串当做数组的下标(index).利用这个特色十分有助于资料统计工作.(使用字符串当下标的数组称为Associative Array) 首先建立一个数据文件,并取名为 reg.d ...
- 17个Web前端开发工程师必看的国外网站
Web设计是一个不断变化的领域,因此掌握最新的发展趋势及技术动向对设计师来说非常重要,无论是学习新技术,还是寻找免费资源与工具,设计博客都是很不错的去处. 1. Smashing Magazine S ...
- Ubuntu 小技巧
一.获得当前文件夹的路径: 在目标文件夹下,按Ctrl+l此文件的路径会被选中 之后Ctrl+c复制.要复制到终端(Terminal),选中终端按鼠标的滚轮就粘贴到了Terminal命令行中了. 二. ...
- Web技术导论复习大纲
1. 什么是URL,其一般形式是什么? 资源类型://网址[:端口号][/[文件路径/文件名]][?参数名=参数值&参数名=参数值...] 2. 什么是B/S模式,与C/S模式相比有哪些优越性 ...
- Xcode5和ios7下交叉编译ffmpeg
先申明本机环境 dev-mini:ffmpeg devone$ sw_vers ProductName: Mac OS X ProductVersion: BuildVersion: 1 ...
- 局域网Internet的共享
局域网接入Internet,之后,在服务器安装共享代理软件,可以使客户机通过代理软件接入Internet. 局域网接入Internet 而目前几乎所有的浏览器.下载软件.信件收发软件都支持代理服务器. ...
- 【现代程序设计】【Homework-01】
1维的最大子数组之和 对于1维的最大子数组之和 假设f[i]表示:对于1..i这个序列中,包含i这个元素的最大序列的值 则对于f[i],0<i<=n; 应该有 f[i]=max(a[i], ...
- 现代程序设计homework-02
总体思路 (1)单维数组 单维数组的思路的构建在第一次作业已经完成了,简单来说就是根据贪心策略从头到尾累加,一旦遇到当前累加和变为负数,就将累加和清零,继续遍历数组中的元素,算法的时间复杂度是O(n) ...
- keil中 code、data、idata的区别
存储器类型 本C51编译器支持8051及其派生类型的结构能够访问8051的所有存储器空间具有下表列出的存储器类型的变量都可以被分配到某个特定的存储器空间.存储器类型 描述code 程序空间64 Kby ...