ASCP to EBS Mapping:
Background and Requirement:
TESTA (ASCP) environment is mapped to TEST (EBS) for planning data collection. Due to TEST is taken for other implementation, UAT is suggested as EBS DB for TESTA. For modifying this mapping, below steps performed.
In UAT, TESTA tns entry created.
-----------------------
TESTA=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.10)(PORT=1521))
(CONNECT_DATA=
(SID=TESTA)
)
)
IN TESTA, UAT tns entry created.
-----------------------
UAT=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.20)(PORT=1521))
(CONNECT_DATA=
(SERVICE_NAME=UAT)
(INSTANCE_NAME=UAT)
)
)
In UAT:
=======
SQL> select name from v$database;
NAME
---------
UAT
SQL> create public database link UAT_TESTA.COMPANY.COM connect to APPS identified by password using 'TESTA';
Database link created.
SQL> select name from v$database@UAT_TESTA.COMPANY.COM;
NAME
---------
TESTA
In TESTA:
==========
SQL> select name from v$database;
NAME
---------
TESTA
SQL> create public database link TESTA_UAT.COMPANY.COM connect to APPS identified by password using 'UAT';
Database link created.
SQL> select name from v$database@TESTA_UAT.COMPANY.COM;
NAME
---------
UAT
Update in UAT:
==============
update MRP.MRP_AP_APPS_INSTANCES_ALL set M2A_DBLINK='TESTA_UAT',A2M_DBLINK='UAT_TESTA';
commit;
select instance_code,A2M_DBLINK, M2A_DBLINK from MRP.MRP_AP_APPS_INSTANCES_ALL;
SQL> select instance_code,A2M_DBLINK, M2A_DBLINK from MRP.MRP_AP_APPS_INSTANCES_ALL;
INSTANCE_CODE A2M_DBLINK M2A_DBLINK
--------------- -------------------- --------------------
DM2 UAT_TESTA TESTA_UAT
=================================================================
=========================
In TESTA, before update:
========================
select instance_code,A2M_DBLINK,M2A_DBLINK FROM MSC.MSC_APPS_INSTANCES;
SQL> select instance_code,A2M_DBLINK,M2A_DBLINK FROM MSC.MSC_APPS_INSTANCES;
Background and Requirement:
TESTA (ASCP) environment is mapped to TEST (EBS) for planning data collection. Due to TEST is taken for other implementation, UAT is suggested as EBS DB for TESTA. For modifying this mapping, below steps performed.
In UAT, TESTA tns entry created.
-----------------------
TESTA=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.10)(PORT=1521))
(CONNECT_DATA=
(SID=TESTA)
)
)
IN TESTA, UAT tns entry created.
-----------------------
UAT=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.20)(PORT=1521))
(CONNECT_DATA=
(SERVICE_NAME=UAT)
(INSTANCE_NAME=UAT)
)
)
In UAT:
=======
SQL> select name from v$database;
NAME
---------
UAT
SQL> create public database link UAT_TESTA.COMPANY.COM connect to APPS identified by password using 'TESTA';
Database link created.
SQL> select name from v$database@UAT_TESTA.COMPANY.COM;
NAME
---------
TESTA
In TESTA:
==========
SQL> select name from v$database;
NAME
---------
TESTA
SQL> create public database link TESTA_UAT.COMPANY.COM connect to APPS identified by password using 'UAT';
Database link created.
SQL> select name from v$database@TESTA_UAT.COMPANY.COM;
NAME
---------
UAT
Update in UAT:
==============
update MRP.MRP_AP_APPS_INSTANCES_ALL set M2A_DBLINK='TESTA_UAT',A2M_DBLINK='UAT_TESTA';
commit;
select instance_code,A2M_DBLINK, M2A_DBLINK from MRP.MRP_AP_APPS_INSTANCES_ALL;
SQL> select instance_code,A2M_DBLINK, M2A_DBLINK from MRP.MRP_AP_APPS_INSTANCES_ALL;
INSTANCE_CODE A2M_DBLINK M2A_DBLINK
--------------- -------------------- --------------------
DM2 UAT_TESTA TESTA_UAT
=================================================================
=========================
In TESTA, before update:
========================
select instance_code,A2M_DBLINK,M2A_DBLINK FROM MSC.MSC_APPS_INSTANCES;
SQL> select instance_code,A2M_DBLINK,M2A_DBLINK FROM MSC.MSC_APPS_INSTANCES;
INSTANCE_CODE A2M_DBLINK M2A_DBLINK
--------------- -------------------- --------------------
TST TEST_TESTA TESTA_TEST
After update:
==============
update MSC.MSC_APPS_INSTANCES set M2A_DBLINK='TESTA_UAT',A2M_DBLINK='UAT_TESTA';
SQL> update MSC.MSC_APPS_INSTANCES set M2A_DBLINK='TESTA_UAT',A2M_DBLINK='UAT_TESTA';
1 row updated.
SQL> select instance_code,A2M_DBLINK,M2A_DBLINK FROM MSC.MSC_APPS_INSTANCES;
INSTANCE_CODE A2M_DBLINK M2A_DBLINK
--------------- -------------------- --------------------
TST UAT_TESTA TESTA_UAT
SQL> commit;
Commit complete.
=================================================================
Change the package body in TESTA:
==================================
desc APPS.MSC_RELEASE_HOOK
CREATE OR REPLACE PACKAGE BODY APPS.MSC_RELEASE_HOOK AS
PROCEDURE EXTEND_RELEASE( ERRBUF OUT NOCOPY VARCHAR2
, RETCODE OUT NOCOPY NUMBER
, arg_dblink IN VARCHAR2
, arg_plan_id IN NUMBER
, arg_log_org_id IN NUMBER
, arg_org_instance IN NUMBER
, arg_owning_org_id IN NUMBER
, arg_owning_instance IN NUMBER
, arg_compile_desig IN VARCHAR2
, arg_user_id IN NUMBER
, arg_po_group_by IN NUMBER
, arg_po_batch_number IN NUMBER
, arg_wip_group_id IN NUMBER
, arg_loaded_jobs IN NUMBER
, arg_loaded_lot_jobs IN NUMBER
, arg_resched_lot_jobs IN NUMBER
, arg_loaded_reqs IN NUMBER
, arg_loaded_scheds IN NUMBER
, arg_resched_jobs IN NUMBER
, arg_resched_reqs IN NUMBER
, arg_int_repair_orders IN NUMBER
, arg_ext_repair_orders IN NUMBER
, arg_wip_req_id IN NUMBER
, arg_osfm_req_id IN NUMBER
, arg_req_load_id IN NUMBER
, arg_req_resched_id IN NUMBER
, arg_int_repair_Order_id IN NUMBER
, arg_ext_repair_Order_id IN NUMBER
, arg_mode IN VARCHAR2
, arg_transaction_id IN NUMBER
, l_apps_ver in VARCHAR2 )
IS
BEGIN
UPDATE msc_wip_job_schedule_interface mws
SET job_name='OSP'||job_name
WHERE group_id = arg_wip_group_id
AND EXISTS ( SELECT 1 FROM fnd_lookup_values, mtl_parameters@TESTA_UAT mp
WHERE lookup_type='XXFM_ORGANIZATION_CODE'
AND lookup_code=mp.organization_code
AND mp.organization_id=mws.organization_id)
AND EXISTS ( SELECT 1 FROM fnd_lookup_values, mtl_system_items@TESTA_UAT msi
WHERE lookup_type='XXFM_PLANNER_CODE'
AND lookup_code=msi.planner_code
AND msi.organization_id=mws.organization_id
AND msi.inventory_item_id=mws.primary_item_id);
COMMIT;
END EXTEND_RELEASE;
END MSC_RELEASE_HOOK;
/
===============================================================
Drop the below three synonyms and Recreate it with correct DB Links for APPS user in EBS DB:
APPS.XXFMPA_MSC_SYSTEM_ITEMS
APPS.XXFMPA_MSC_SUPPLIES
APPS.XXFMPA_MSC_ORDERS_V
DROP SYNONYM APPS.XXFMPA_MSC_SYSTEM_ITEMS;
CREATE SYNONYM APPS.XXFMPA_MSC_SYSTEM_ITEMS FOR APPS.MSC_SYSTEM_ITEMS@"UAT_TESTA.COMPANY.COM";
DROP SYNONYM APPS.XXFMPA_MSC_SUPPLIES;
CREATE SYNONYM APPS.XXFMPA_MSC_SUPPLIES FOR APPS.MSC_SUPPLIES@"UAT_TESTA.COMPANY.COM";
DROP SYNONYM APPS.XXFMPA_MSC_ORDERS_V;
CREATE SYNONYM APPS.XXFMPA_MSC_ORDERS_V FOR APPS.MSC_ORDERS_V@"UAT_TESTA.COMPANY.COM";
--------------- -------------------- --------------------
TST TEST_TESTA TESTA_TEST
After update:
==============
update MSC.MSC_APPS_INSTANCES set M2A_DBLINK='TESTA_UAT',A2M_DBLINK='UAT_TESTA';
SQL> update MSC.MSC_APPS_INSTANCES set M2A_DBLINK='TESTA_UAT',A2M_DBLINK='UAT_TESTA';
1 row updated.
SQL> select instance_code,A2M_DBLINK,M2A_DBLINK FROM MSC.MSC_APPS_INSTANCES;
INSTANCE_CODE A2M_DBLINK M2A_DBLINK
--------------- -------------------- --------------------
TST UAT_TESTA TESTA_UAT
SQL> commit;
Commit complete.
=================================================================
Change the package body in TESTA:
==================================
desc APPS.MSC_RELEASE_HOOK
CREATE OR REPLACE PACKAGE BODY APPS.MSC_RELEASE_HOOK AS
PROCEDURE EXTEND_RELEASE( ERRBUF OUT NOCOPY VARCHAR2
, RETCODE OUT NOCOPY NUMBER
, arg_dblink IN VARCHAR2
, arg_plan_id IN NUMBER
, arg_log_org_id IN NUMBER
, arg_org_instance IN NUMBER
, arg_owning_org_id IN NUMBER
, arg_owning_instance IN NUMBER
, arg_compile_desig IN VARCHAR2
, arg_user_id IN NUMBER
, arg_po_group_by IN NUMBER
, arg_po_batch_number IN NUMBER
, arg_wip_group_id IN NUMBER
, arg_loaded_jobs IN NUMBER
, arg_loaded_lot_jobs IN NUMBER
, arg_resched_lot_jobs IN NUMBER
, arg_loaded_reqs IN NUMBER
, arg_loaded_scheds IN NUMBER
, arg_resched_jobs IN NUMBER
, arg_resched_reqs IN NUMBER
, arg_int_repair_orders IN NUMBER
, arg_ext_repair_orders IN NUMBER
, arg_wip_req_id IN NUMBER
, arg_osfm_req_id IN NUMBER
, arg_req_load_id IN NUMBER
, arg_req_resched_id IN NUMBER
, arg_int_repair_Order_id IN NUMBER
, arg_ext_repair_Order_id IN NUMBER
, arg_mode IN VARCHAR2
, arg_transaction_id IN NUMBER
, l_apps_ver in VARCHAR2 )
IS
BEGIN
UPDATE msc_wip_job_schedule_interface mws
SET job_name='OSP'||job_name
WHERE group_id = arg_wip_group_id
AND EXISTS ( SELECT 1 FROM fnd_lookup_values, mtl_parameters@TESTA_UAT mp
WHERE lookup_type='XXFM_ORGANIZATION_CODE'
AND lookup_code=mp.organization_code
AND mp.organization_id=mws.organization_id)
AND EXISTS ( SELECT 1 FROM fnd_lookup_values, mtl_system_items@TESTA_UAT msi
WHERE lookup_type='XXFM_PLANNER_CODE'
AND lookup_code=msi.planner_code
AND msi.organization_id=mws.organization_id
AND msi.inventory_item_id=mws.primary_item_id);
COMMIT;
END EXTEND_RELEASE;
END MSC_RELEASE_HOOK;
/
===============================================================
Drop the below three synonyms and Recreate it with correct DB Links for APPS user in EBS DB:
APPS.XXFMPA_MSC_SYSTEM_ITEMS
APPS.XXFMPA_MSC_SUPPLIES
APPS.XXFMPA_MSC_ORDERS_V
DROP SYNONYM APPS.XXFMPA_MSC_SYSTEM_ITEMS;
CREATE SYNONYM APPS.XXFMPA_MSC_SYSTEM_ITEMS FOR APPS.MSC_SYSTEM_ITEMS@"UAT_TESTA.COMPANY.COM";
DROP SYNONYM APPS.XXFMPA_MSC_SUPPLIES;
CREATE SYNONYM APPS.XXFMPA_MSC_SUPPLIES FOR APPS.MSC_SUPPLIES@"UAT_TESTA.COMPANY.COM";
DROP SYNONYM APPS.XXFMPA_MSC_ORDERS_V;
CREATE SYNONYM APPS.XXFMPA_MSC_ORDERS_V FOR APPS.MSC_ORDERS_V@"UAT_TESTA.COMPANY.COM";
Conclusion:
Using the above steps new EBS DB can be mapped to planning instance.