﻿{"id":913,"date":"2016-11-02T17:08:13","date_gmt":"2016-11-02T09:08:13","guid":{"rendered":"http:\/\/www.oracle.name\/?p=913"},"modified":"2016-11-02T17:08:13","modified_gmt":"2016-11-02T09:08:13","slug":"oracle-ebs%e5%a4%9aou%e6%80%bb%e7%bb%93","status":"publish","type":"post","link":"https:\/\/www.llku.com\/?p=913","title":{"rendered":"Oracle EBS\u591aOU\u603b\u7ed3"},"content":{"rendered":"<p>\n\t(\u4e00)&nbsp; \u591aOU\u603b\u7ed3\n<\/p>\n<p>\n\t1.&nbsp; Form\u591aOU\u5b9e\u73b0\n<\/p>\n<p>\n\t1)&nbsp; \u521b\u5efa\u4e00\u4e2aTable,\u4ee5CUX_AP_CHECK_HEADER_ALL\u4e3a\u4f8b\n<\/p>\n<p>\n\t2)&nbsp; \u521b\u5efaTable\u7684\u4e24\u4e2aSynonym(\u4e00\u4e2a\u4e0d\u542b_ALL,\u4e00\u4e2a\u4ee5_ALL\u7ed3\u5c3e)\uff1aCUX_AP_CHECK_HEADER\u548cCUX_AP_CHECK_HEADER_ALL\n<\/p>\n<p>\n\t3)&nbsp; \u7ed9\u4e0d\u542b_ALL\u7684Synonym\uff1aCUX_AP_CHECK_HEADER\u52a0\u4e0a\u7ec4\u7ec7\u5c4f\u853d\u7684\u7b56\u7565\u51fd\u6570\n<\/p>\n<p>\n\tdbms_rls.add_policy(object_name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&gt; &#39;CUX_AP_CHECK_HEADER&#39;,\n<\/p>\n<p>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; policy_name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&gt; &#39;ORG_SEC&#39;,\n<\/p>\n<p>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; policy_function =&gt; &#39;MO_GLOBAL.ORG_SECURITY&#39;,\n<\/p>\n<p>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; policy_type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&gt;&nbsp; dbms_rls.shared_context_sensitive);\n<\/p>\n<p>\n\t4)&nbsp; \u5728\u4e0d\u542b_ALL\u7684Synonym\u7684\u57fa\u7840\u4e0a\u521b\u5efa\u89c6\u56fe: CUX_AP_CHECK_HEADER_V\n<\/p>\n<p>\n\t5)&nbsp; \u8fdb\u5165FORM\u65f6(pre-form\u89e6\u53d1\u5668)\u6dfb\u52a0\u4ee3\u7801\uff1a\n<\/p>\n<p>\n\tmo_global.init(&amp;p_appl_shortname);&#8211;p_appl_shortname\u4e3a\u5e94\u7528\u7b80\u79f0\n<\/p>\n<p>\n\t6)&nbsp; \u5f53\u9009\u62e9\u67d0\u4e2aOU\u65f6(\u4e00\u822c\u5728when_validate_item\u89e6\u53d1\u5668)\u4e2d\u6dfb\u52a0\u4ee3\u7801\uff1amo_global.set_policy_context(&#39;S&#39;,&amp;p_org_id);&#8211;p_org_id\u4e3aOU\u7684id\n<\/p>\n<p>\n\t2.&nbsp; Report\u591aOU\u5b9e\u73b0\n<\/p>\n<p>\n\t1)&nbsp; \u7ed9\u5e76\u53d1\u7a0b\u5e8f\u8bbe\u7f6e\u4e1a\u52a1\u5b9e\u4f53\u6a21\u5f0f\uff1a\u5355\u4e2a\uff0c\u591a\u4e2a\u548c\u7a7a(\u9ed8\u8ba4)\u3002\u4e00\u822c\u8bbe\u7f6e\u4e3a&lsquo;\u5355\u4e2a&rsquo;\n<\/p>\n<p>\n\t\u4e1a\u52a1\u5b9e\u4f53\u6a21\u5f0f\u5bf9\u5e94\u8868fnd_concurrent_programs\u4e2d\u7684multi_org_category\u5b57\u6bb5\n<\/p>\n<p>\n\t2)&nbsp; \u5f97\u5230\u5f53\u524dOU\u7684\u503c\u3002\n<\/p>\n<p>\n\t\u4f7f\u7528\uff1amo_global.get_current_org_id\u6216\u8005fnd_global.org_id\n<\/p>\n<p>\n\t3)&nbsp; \u5728\u62a5\u8868\u7684\u53c2\u6570\u548c\u62a5\u8868\u7684\u903b\u8f91\u4e2d\u52a0\u4e0aOU\u7684\u9650\u5236\n<\/p>\n<p>\n\t3.&nbsp; GL\u6570\u636e\u7684\u591aOU\u5b9e\u73b0\n<\/p>\n<p>\n\t1)&nbsp; \u5f97\u5230\u5f53\u524dOU\u7684\u503c\u3002\n<\/p>\n<p>\n\t\u4f7f\u7528\uff1amo_global.get_current_org_id\u6216\u8005fnd_global.org_id\n<\/p>\n<p>\n\t2)&nbsp; \u6839\u636eOU\u7684\u503c\u5f97\u5230\u90e8\u95e8\u6bb5\u7684\u503c\uff1a\n<\/p>\n<p>\n\tDECLARE\n<\/p>\n<p>\n\t&nbsp;&nbsp;&nbsp; l_segment1&nbsp; VARCHAR2(150);&#8211;\u90e8\u95e8\u6bb5\n<\/p>\n<p>\n\t&nbsp;&nbsp; BEGIN\n<\/p>\n<p>\n\tSELECT o3.attribute5\n<\/p>\n<p>\n\t&nbsp;&nbsp; INTO l_segment1\n<\/p>\n<p>\n\t&nbsp; FROM hr_all_organization_units&nbsp;&nbsp;&nbsp;&nbsp; o,\n<\/p>\n<p>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hr_all_organization_units_tl&nbsp; otl,\n<\/p>\n<p>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hr_organization_information&nbsp;&nbsp; o2,\n<\/p>\n<p>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hr_organization_information&nbsp;&nbsp; o3\n<\/p>\n<p>\n\tWHERE o.organization_id = o2.organization_id\n<\/p>\n<p>\n\t&nbsp;&nbsp; AND o.organization_id = o3.organization_id\n<\/p>\n<p>\n\t&nbsp;&nbsp; AND o2.org_information_context = &#39;CLASS&#39;\n<\/p>\n<p>\n\t&nbsp;&nbsp; AND o3.org_information_context = &#39;Operating Unit Information&#39;\n<\/p>\n<p>\n\t&nbsp;&nbsp; AND o2.org_information1 = &#39;OPERATING_UNIT&#39;\n<\/p>\n<p>\n\t&nbsp;&nbsp; AND o2.org_information2 = &#39;Y&#39;\n<\/p>\n<p>\n\t&nbsp;&nbsp; and o.organization_id = otl.organization_id\n<\/p>\n<p>\n\t&nbsp;&nbsp; and o.organization_id = &amp;p_org_id &ndash;OU id\n<\/p>\n<p>\n\t&nbsp;&nbsp; AND otl.LANGUAGE = USERENV(&#39;LANG&#39;);\n<\/p>\n<p>\n\tEND;\n<\/p>\n<p>\n\t3)&nbsp; \u5c06\u6b65\u9aa42\u5f97\u5230\u7684\u503c\u4f5c\u4e3a\u9650\u5236\u6761\u4ef6\uff1a\n<\/p>\n<p>\n\tSELECT gl_code_combinations gcc WHERE gcc.segment1 = l_segment1;\n<\/p>\n<p>\n\t4.&nbsp; Interface\u591aOU\u603b\u7ed3\n<\/p>\n<p>\n\t1)&nbsp; \u7ed9\u5e76\u53d1\u7a0b\u5e8f\u8bbe\u7f6e\u4e1a\u52a1\u5b9e\u4f53\u6a21\u5f0f\uff1a\u5355\u4e2a\uff0c\u591a\u4e2a\u548c\u7a7a(\u9ed8\u8ba4)\u3002\u4e1a\u52a1\u5b9e\u4f53\u6a21\u5f0f\u5bf9\u5e94\u8868fnd_concurrent_programs\u4e2d\u7684multi_org_category\u5b57\u6bb5\n<\/p>\n<p>\n\t2)&nbsp; \u5982\u679c\u63a5\u53e3\u7684\u5bfc\u5165\u7a0b\u5e8f\u4e2dOU\u4f5c\u4e3a\u4e00\u4e2a\u53c2\u6570\uff0c\u5219\u5e94\u8be5\u5c06\u6240\u6709\u7684OU\u4f5c\u4e00\u6b21\u5faa\u73af\u3002\n<\/p>\n<p>\n\t5.&nbsp; \u591aOU\u5b9e\u73b0\u6269\u5c55\u77e5\u8bc6\n<\/p>\n<p>\n\t1)&nbsp; \u7ed9\u5ba2\u6237\u5316\u5e94\u7528\u6ce8\u518c\u548c\u53d6\u6d88MOAC\u7684\u63a7\u5236\n<\/p>\n<p>\n\tfnd_mo_product_init_pkg.register_application(\u6ce8\u518c\u5e94\u7528)\n<\/p>\n<p>\n\tfnd_mo_product_init_pkg.remove_application(\u53d6\u6d88\u5e94\u7528)\n<\/p>\n<p>\n\t\u67e5\u770b\u652f\u6301MOAC\u7684\u5e94\u7528SQL:\n<\/p>\n<p>\n\tSELECT * FROM fnd_mo_product_init;\n<\/p>\n<p>\n\t2)&nbsp; \u7ed9\u6570\u636e\u5e93\u5bf9\u8c61\u6ce8\u518c\u548c\u53d6\u6d88\u7b56\u7565-policy\n<\/p>\n<p>\n\tdbms_rls.add_policy(\u6ce8\u518c\u7b56\u7565)\n<\/p>\n<p>\n\tdbms_rls.drop_policy(\u53d6\u6d88\u7b56\u7565)\n<\/p>\n<p>\n\t3)&nbsp; \u591aOU \u6d89\u53ca\u5230\u7684\u8868\n<\/p>\n<p>\n\ta)&nbsp;&nbsp; \u67e5\u770b\u6570\u636e\u5e93\u5bf9\u8c61\u662f\u5426\u589e\u52a0\u4e86\u7b56\u7565-policy\n<\/p>\n<p>\n\tSELECT * FROM dba_policies;\n<\/p>\n<p>\n\tb)&nbsp;&nbsp; \u67e5\u770b\u5f53\u524dsession\u6240\u80fd\u8bbf\u95ee\u7684OU\n<\/p>\n<p>\n\tSELECT * FROM mo_glob_org_access_tmp;\n<\/p>\n<p>\n\tc)&nbsp;&nbsp; \u67e5\u770b\u5f53\u524dsession\u5e94\u7528\u4e0a\u4e0b\u6587(context)\u7684\u503c(\u8bf4\u660e\uff1aOU\u7684\u503c\u4fdd\u5b58\u5728context\u4e2d)\n<\/p>\n<p>\n\tSELECT * FROM dba_context dc WHERE dc.namespace LIKE &#39;MULTI%&#39;;\n<\/p>\n<p>\n\tMOAC\u4f7f\u7528\u7684\u5e94\u7528\u7a0b\u5e8f\u4e0a\u4e0b\u6587\uff1aMULTI_ORG\uff0cMULTI_ORG2\n<\/p>\n<p>\n\t(\u4e8c)&nbsp; \u591a\u5e10\u5957\u603b\u7ed3\n<\/p>\n<p>\n\t1.&nbsp;&nbsp; \u5ba2\u6237\u5316\u5f00\u53d1\u4e2d\u7684\u591a\u5e10\u5957\u5c4f\u853d\n<\/p>\n<p>\n\t1)&nbsp; \u5f97\u5230\u5f53\u524dOU\u7684\u503c\u3002\n<\/p>\n<p>\n\t\u4f7f\u7528\uff1amo_global.get_current_org_id\u6216\u8005fnd_global.org_id\n<\/p>\n<p>\n\t2)&nbsp; \u6839\u636e\u7ec4\u7ec7id\u5f97\u5230\u5e10\u5957id\u548c\u516c\u53f8\u540d\u79f0\u3002SQL\u8bed\u53e5\u4e3a\uff1a\n<\/p>\n<p>\n\tDECLARE\n<\/p>\n<p>\n\t&nbsp;&nbsp; l_org_information3 VARCHAR2(150);&#8211;\u5e10\u5957id\n<\/p>\n<p>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; l_company_desc&nbsp;&nbsp;&nbsp;&nbsp; VARCHAR2(150);&#8211;\u516c\u53f8\u4e2d\u6587\u63cf\u8ff0\n<\/p>\n<p>\n\t&nbsp; BEGIN\n<\/p>\n<p>\n\t&nbsp;&nbsp; SELECT o3.org_information3,o3.attribute3\n<\/p>\n<p>\n\t&nbsp;&nbsp;&nbsp;&nbsp; INTO l_org_information3\uff0cl_company_desc\n<\/p>\n<p>\n\t&nbsp;&nbsp;&nbsp;&nbsp; FROM hr_all_organization_units&nbsp;&nbsp;&nbsp; o,\n<\/p>\n<p>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hr_all_organization_units_tl otl,\n<\/p>\n<p>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hr_organization_information&nbsp; o2,\n<\/p>\n<p>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hr_organization_information&nbsp; o3\n<\/p>\n<p>\n\t&nbsp;&nbsp;&nbsp; WHERE o.organization_id&nbsp;&nbsp; = o2.organization_id\n<\/p>\n<p>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AND o.organization_id&nbsp;&nbsp; = o3.organization_id\n<\/p>\n<p>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AND o2.org_information_context || &#39;&#39; = &#39;CLASS&#39;\n<\/p>\n<p>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AND o3.org_information_context = &#39;Operating Unit Information&#39;\n<\/p>\n<p>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AND o2.org_information1 = &#39;OPERATING_UNIT&#39;\n<\/p>\n<p>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AND o2.org_information2 = &#39;Y&#39;\n<\/p>\n<p>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AND o.organization_id&nbsp;&nbsp; = otl.organization_id\n<\/p>\n<p>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AND otl.language&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = USERENV(&#39;LANG&#39;)\n<\/p>\n<p>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AND o.organization_id&nbsp;&nbsp; = &amp;p_org_id;&#8211;OU id\n<\/p>\n<p>\n\t&nbsp;&nbsp; END;\n<\/p>\n<p>\n\t3)&nbsp; \u5f97\u5230\u672c\u4f4d\u5e01\uff0cSQL\u8bed\u53e5\u4e3a\uff1a\n<\/p>\n<p>\n\tDECLARE\n<\/p>\n<p>\n\tl_local_currency_code VARCHAR2(15);&#8211;\u672c\u4f4d\u5e01\n<\/p>\n<p>\n\tBEGIN\n<\/p>\n<p>\n\tSELECT gsob.currency_code\n<\/p>\n<p>\n\t&nbsp;&nbsp;&nbsp; INTO l_local_currency_code\n<\/p>\n<p>\n\t&nbsp;&nbsp; FROM gl_sets_of_books gsob, hr_operating_units hou\n<\/p>\n<p>\n\t&nbsp; WHERE gsob.set_of_books_id = hou.set_of_books_id\n<\/p>\n<p>\n\t&nbsp; AND&nbsp;&nbsp; hou.organization_id&nbsp; = &amp;p_org_id;&#8211;OU ID\n<\/p>\n<p>\n\tEND;\n<\/p>\n<p>\n\t4)&nbsp; \u5728\u7a0b\u5e8f\u4e2d\u52a0\u4e0a\u5e10\u5957\u548c\u672c\u4f4d\u5e01\u7684\u9650\u5236\n<\/p>\n<p>\n\t2.&nbsp;&nbsp; \u591a\u5e10\u5957\u5b9e\u73b0\u6269\u5c55\n<\/p>\n<p>\n\t1)&nbsp; \u5f97\u5230\u5e10\u5957\u7684SQL\u8bed\u53e5\u4e3a\uff1a\n<\/p>\n<p>\n\tSELECT * FROM gl_ledgers;\n<\/p>\n<p>\n\t2)&nbsp; \u5f97\u5230\u6cd5\u4eba\u7684SQL\u8bed\u53e5\u4e3a\uff1a\n<\/p>\n<p>\n\tSELECT * FROM xle_entity_profiles;\n<\/p>\n<p>\n\t\u8f6c\u8f7d\u5730\u5740\uff1a<a href=\"http:\/\/blog.csdn.net\/cunxiyuan108\/article\/details\/6454450\">http:\/\/blog.csdn.net\/cunxiyuan108\/article\/details\/6454450<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>(\u4e00)&nbsp; \u591aOU\u603b\u7ed3 1.&nbsp; Form\u591aOU\u5b9e\u73b0 1)&nbsp; \u521b\u5efa\u4e00\u4e2aTable,\u4ee5 &hellip; <a href=\"https:\/\/www.llku.com\/?p=913\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">Oracle EBS\u591aOU\u603b\u7ed3<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[68],"tags":[135],"_links":{"self":[{"href":"https:\/\/www.llku.com\/index.php?rest_route=\/wp\/v2\/posts\/913"}],"collection":[{"href":"https:\/\/www.llku.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.llku.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.llku.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.llku.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=913"}],"version-history":[{"count":1,"href":"https:\/\/www.llku.com\/index.php?rest_route=\/wp\/v2\/posts\/913\/revisions"}],"predecessor-version":[{"id":914,"href":"https:\/\/www.llku.com\/index.php?rest_route=\/wp\/v2\/posts\/913\/revisions\/914"}],"wp:attachment":[{"href":"https:\/\/www.llku.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=913"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.llku.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=913"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.llku.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=913"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}