You are on page 1of 2

xbook54321vt

show user;

alter table xbook_parametro add codigo_mo_global varchar2(30);


-- R12
update xbook_parametro set versao_ebs = 'R11', codigo_mo_global =
'apps.mo_global.init(''S'',null)' ;
-- R11
update xbook_parametro set versao_ebs = 'R11', codigo_mo_global =
'apps.mo_global.init' ;
commit;

declare
vCodigo_Mo_Glogal varchar2(30);
vReleaseEBS varchar2(03);
vOrg varchar2(10);

begin

select substr(versao_ebs,1,3), codigo_mo_global


into vReleaseEBS , vCodigo_Mo_Glogal
from xbook_parametro;

-- SINTAXE R12 apps.mo_global.init('S',null);


-- SINTAXE R11 apps.mo_global.init;

DBMS_OUTPUT.PUT_LINE(' vCodigo_Mo_Glogal -> '|| vCodigo_Mo_Glogal);

execute immediate 'begin '|| vCodigo_Mo_Glogal||';' || ' end;';

-- apps.mo_global.init;

apps.fnd_global.apps_initialize(user_id => 73250 -- EALMEIDA


,resp_id => 53044 -- 061 SSR COM OM
SUPERUSUARIO
,resp_appl_id => 660 -- OM
);

end;

SELECT version FROM v$instance;


select count(*) from apps.fnd_profile_option_values
select count(*) from apps.fnd_profile_options

MO_GLOBAL.INIT will read the MO: Operating Unit and MO: Security Profile
profile option values from the current context (responsibility/user) and will
initialize access to Multiple Organizations.

select apps.mo_global.is_multi_org_enabled from dual;

select count(*) from apps.FND_MO_PRODUCT_INIT

IS_MULT_ORG_ENABLED
SELECT nvl(multi_org_flag, 'N')
FROM APPS.fnd_product_groups;

SELECT COUNT(*) FROM APPS.fnd_product_groups;


select count(*) from APPS.hz_cust_acct_sites_all;
select count(*) from APPS.hz_cust_acct_sites;

COUNT(*)
----------
0

SQL> exec MO_GLOBAL.SET_POLICY_CONTEXT('S',111);

PL/SQL procedure successfully completed

SQL> select count(*) from APPS.hz_cust_acct_sites;

COUNT(*)
----------
23

SQL> select count(*) from APPS.hz_cust_acct_sites_all;

COUNT(*)
----------
33

SQL> exec apps.mo_global.init;

You might also like