如何使用Oracle FND_LOAD工具在不同Instance间同步数据(Example)

如何使用Oracle FND_LOAD工具在不同Instance间同步数据(Example)

如何使用Oracle FND_LOAD工具在不同Instance间同步数据(Example)

FNDLOAD是Oracle官方提供数据同步工具(Data Synchronization),一般情况下,我们通过FNDLOAD工具把DEV Instance的客户化AOL数据下载到一个文本文件中,然后同样使用FNDLOAD上传到PROD Instance中去。

如何使用Oracle FND_LOAD工具在不同Instance间同步数据(Example)

什么样的情况下,需要使用FNDLOAD来同步

我们在测试环境开发了一些客户化程序(Personalization),Concurrent Program,Message....想要同步到正式的环境中去,这时我们可以使用FNDLOAD同步工具。

哪些数据可以使用FNDLOAD来同步?

* Concurrent Programs, Executables
* Request Groups, Request Sets
* Profile Options
* Key and Descriptive Flexfields
* Menus and Responsibilities
* Forms and Form Functions
* Attachments
* Messages
* Value Sets and Values
* Lookup Types
* User Responsibilities
* Printer Definitions
* FND Dictionary
* Help Configuration
* Document Sequences
* Concurrent Manager Schedules

FNDLOAD的使用语法

FNDLOAD apps/appspwd 0 Y mode configfile datafile entity [parameter1|..]
The mode is either DOWNLOAD or UPLOAD.
The configfile is the file that Fndload needs to download on upload data.
The data file is the output file, in which the downloaded data is written
The entity is the entity you want to download,
Parameters van is passed to download a certain Alert

A Example How to download Personalization Code

我在测试环境给Move Order form写了一个简单的Personalization代码,这个Function Name为INV_INVTOMAI

如何使用Oracle FND_LOAD工具在不同Instance间同步数据(Example)

如何使用Oracle FND_LOAD工具在不同Instance间同步数据(Example)

现在我想把这个测试代码整体迁移到另外一个环境,可以使用FNDLOAD工具来做迁移。登陆到Unix/Linux服务器,执行下边的命令,

FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/affrmcus.lct PTIAN_CUSTOM_FUC.ldt FND_FORM_CUSTOM_RULES function_name="INV_INVTOMAI"

“INV_INVTOMAI”为我新加的客户化功能的名称;

“PTIAN_CUSTOM_FUC.ldt”是我为到处的文本文件设定的名称;

命令执行完之后,在当前目录就会生成一个“PTIAN_CUSTOM_FUC.ldt”文本文件,里边就包含了我们客户化程序的表数据。

  1. # $Header$  
  2.   
  3. # dbdrv: exec fnd bin FNDLOAD bin &phase=daa+70 checkfile:~PROD:~PATH:~FILE &ui_apps 0 Y UPLOAD @FND:patch/115/import/affrmcus.lct @~PROD:~PATH/~FILE  
  4. LANGUAGE = "US"  
  5. LDRCONFIG = "affrmcus.lct 120.3.12010000.4"  
  6.   
  7. #Source Database instance_name  
  8.   
  9. #RELEASE_NAME 12.1.3  
  10. # -- Begin Entity Definitions --   
  11.   
  12. DEFINE FND_FORM_CUSTOM_RULES  
  13. .....此处省去部分文本内容  
  14. .....此处省去部分文本内容  
  15. BEGIN FND_FORM_CUSTOM_RULES "500"  
  16.   FUNCTION_NAME = "INV_INVTOMAI"  
  17.   DESCRIPTION = "test"  
  18.   TRIGGER_EVENT = "WHEN-NEW-FORM-INSTANCE"  
  19.   SEQUENCE = "10"  
  20.   CREATED_BY = "1068"  
  21.   CREATION_DATE = "2012/07/03"  
  22.   OWNER = "MFG"  
  23.   LAST_UPDATE_DATE = "2012/07/03"  
  24.   LAST_UPDATE_LOGIN = "5760463"  
  25.   ENABLED = "Y"  
  26.   FIRE_IN_ENTER_QUERY = "N"  
  27.   FORM_NAME = "INVTOMAI"  
  28.   RULE_TYPE = "A"  
  29.   
  30.   BEGIN FND_FORM_CUSTOM_ACTIONS "729" "500"  
  31.     SEQUENCE = "10"  
  32.     ARGUMENT_TYPE = "C"  
  33.     CREATED_BY = "1068"  
  34.     CREATION_DATE = "2012/07/03"  
  35.     OWNER = "MFG"  
  36.     LAST_UPDATE_DATE = "2012/07/03"  
  37.     LAST_UPDATE_LOGIN = "5760463"  
  38.     ACTION_TYPE = "M"  
  39.     ENABLED = "Y"  
  40.     OBJECT_TYPE = "ITEM"  
  41.     MESSAGE_TYPE = "S"  
  42.     MESSAGE_TEXT = "PTIAN Test"  
  43.     BUILTIN_TYPE = "C"  
  44.     LANGUAGE = "*"  
  45.     PROPERTY_NAME = "1550"  
  46.     MENU_SEPERATOR = "N"  
  47.     
  48.   END FND_FORM_CUSTOM_ACTIONS  
  49.     
  50.   
  51.   BEGIN FND_FORM_CUSTOM_SCOPES "500" "20" ""  
  52.     LAST_UPDATE_DATE = "2012/07/03"  
  53.     OWNER = "MFG"  
  54.     CREATION_DATE = "2012/07/03"  
  55.     CREATED_BY = "1068"  
  56.     LAST_UPDATE_LOGIN = "5760463"  
  57.   END FND_FORM_CUSTOM_SCOPES  
  58.     
  59. END FND_FORM_CUSTOM_RULES  

然后我们使用FNDLOAD把这个文本文件上传到另外一个Instance中去,在第二个Instance下执行命令:

FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/affrmcus.lct PTIAN_CUSTOM_FUC.ldt

这样你的客户化代码就完成了迁移,在第二个环境下也能正常使用了。下图为迁移后,在第二个instance里,Move Order Form客户化界面的截图

如何使用Oracle FND_LOAD工具在不同Instance间同步数据(Example)

FNDLOAD Sample

蓝色为下载,红色为上传

 

1. Lookups 
-- ------------- 
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/aflvmlu.lct XX_CUSTOM_LKP.ldt FND_LOOKUP_TYPE APPLICATION_SHORT_NAME="XXCUST" LOOKUP_TYPE="XX_LOOKUP_TYPE"

 

FNDLOAD apps/apps O Y UPLOAD $FND_TOP/patch/115/import/aflvmlu.lct XX_CUSTOM_LKP.ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE

 

2. Concurrent Program 
-- ----------------------------- 
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afcpprog.lct XX_CUSTOM_CP.ldt PROGRAM APPLICATION_SHORT_NAME="XXCUST" CONCURRENT_PROGRAM_NAME="XX_CONCURRENT_PROGRAM"

 

FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/afcpprog.lct XX_CUSTOM_CP.ldt - WARNING=YES UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE

 

3. Profile 
-- --------- 
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afscprof.lct XX_CUSTOM_PRF.ldt PROFILE PROFILE_NAME="XX_PROFILE_NAME" APPLICATION_SHORT_NAME="XXCUST"

 

$FND_TOP/bin/FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/afscprof.lct XX_CUSTOM_PRF.ldt - WARNING=YES UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE

 

4. Request Set and Link 
-- ------------------------------ 
FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/afcprset.lct XX_CUSTOM_RS.ldt REQ_SET REQUEST_SET_NAME='REQUEST_SET_NAME'

 

FNDLOAD apps/apps O Y UPLOAD $FND_TOP/patch/115/import/afcprset.lct  XX_CUSTOM_RS.ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE

 

5. FND Message 
-- --------------------- 
FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/afmdmsg.lct XX_CUSTOM_MESG.ldt FND_NEW_MESSAGES APPLICATION_SHORT_NAME="XXCUST" MESSAGE_NAME="MESSAGE_NAME%"

 

FNDLOAD apps/apps O Y UPLOAD $FND_TOP/patch/115/import/afmdmsg.lct XX_CUSTOM_MESG.ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE

 

6. D2K FORMS 
-- ------------------ 
$FND_TOP/bin/FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/afsload.lct XX_CUSTOM_FRM.ldt FORM FORM_NAME="FORM_NAME"
       

$FND_TOP/bin/FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/afsload.lct XX_CUSTOM_FRM.ldt - WARNING=YES UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE

 

7. Form Function 
-- --------------------- 
FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/afsload.lct XX_CUSTOM_FUNC.ldt FUNCTION FUNCTION_NAME="FORM_FUNCTION_NAME"

 

$FND_TOP/bin/FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/afsload.lct XX_CUSTOM_FUNC.ldt - WARNING=YES UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE

 

8. Alerts 
-- --------- 
FNDLOAD apps/apps 0 Y DOWNLOAD $ALR_TOP/patch/115/import/alr.lct XX_CUSTOM_ALR.ldt ALR_ALERTS APPLICATION_SHORT_NAME=XXCUST ALERT_NAME="XX - Alert Name"

 

FNDLOAD apps/apps 0 Y UPLOAD $ALR_TOP/patch/115/import/alr.lct XX_CUSTOM_ALR.ldt CUSTOM_MODE=FORCE

 

9. Value Set 
-- -------------- 
$FND_TOP/bin/FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/afffload.lct XX_CUSTOM_VS.ldt VALUE_SET FLEX_VALUE_SET_NAME="XX Value Set Name"

 

$FND_TOP/bin/FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/afffload.lct XX_CUSTOM_VS.ldt - WARNING=YES UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE

 

10. Data Definition and Associated Template
--- ---------------------------------------------------------- 
FNDLOAD apps/$CLIENT_APPS_PWD O Y DOWNLOAD  $XDO_TOP/patch/115/import/xdotmpl.lct XX_CUSTOM_DD.ldt XDO_DS_DEFINITIONS APPLICATION_SHORT_NAME='XXCUST' DATA_SOURCE_CODE='XX_SOURCE_CODE' TMPL_APP_SHORT_NAME='XXCUST' TEMPLATE_CODE='XX_SOURCE_CODE'

 

FNDLOAD apps/$CLIENT_APPS_PWD O Y UPLOAD $XDO_TOP/patch/115/import/xdotmpl.lct XX_CUSTOM_DD.ldt

 

11. DATA_TEMPLATE (Data Source .xml file)
--- ---------------------------------------------------------- 
java oracle.apps.xdo.oa.util.XDOLoader DOWNLOAD -DB_USERNAME apps -DB_PASSWORD apps -JDBC_CONNECTION '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=XX_HOST_NAME)(PORT=XX_PORT_NUMBER))(CONNECT_DATA=(SERVICE_NAME=XX_SERVICE_NAME)))' -LOB_TYPE DATA_TEMPLATE -LOB_CODE XX_TEMPLATE -APPS_SHORT_NAME XXCUST -LANGUAGE en -lct_FILE $XDO_TOP/patch/115/import/xdotmpl.lct -LOG_FILE $LOG_FILE_NAME

 

java oracle.apps.xdo.oa.util.XDOLoader UPLOAD -DB_USERNAME apps -DB_PASSWORD apps -JDBC_CONNECTION '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=XX_HOST_NAME)(PORT=XX_PORT_NUMBER))(CONNECT_DATA=(SERVICE_NAME=XX_SERVICE_NAME)))' -LOB_TYPE DATA_TEMPLATE -LOB_CODE XX_TEMPLATE -XDO_FILE_TYPE XML -FILE_NAME $DATA_FILE_PATH/$DATA_FILE_NAME.xml -APPS_SHORT_NAME XXCUST -NLS_LANG en -TERRITORY US -LOG_FILE $LOG_FILE_NAME

 

12. RTF TEMPLATE (Report Layout .rtf file)
--- ------------------------------------------------------- 
java oracle.apps.xdo.oa.util.XDOLoader DOWNLOAD -DB_USERNAME apps -DB_PASSWORD apps -JDBC_CONNECTION '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=XX_HOST_NAME)(PORT=XX_PORT_NUMBER))(CONNECT_DATA=(SERVICE_NAME=XX_SERVICE_NAME)))' -LOB_TYPE TEMPLATE -LOB_CODE XX_TEMPLATE -APPS_SHORT_NAME XXCUST -LANGUAGE en -TERRITORY US -lct_FILE $XDO_TOP/patch/115/import/xdotmpl.lct -LOG_FILE $LOG_FILE_NAME

 

java oracle.apps.xdo.oa.util.XDOLoader UPLOAD -DB_USERNAME apps -DB_PASSWORD apps -JDBC_CONNECTION '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=XX_HOST_NAME)(PORT=XX_PORT_NUMBER))(CONNECT_DATA=(SERVICE_NAME=SERVICE_NAME)))' -LOB_TYPE TEMPLATE -LOB_CODE XX_TEMPLATE -XDO_FILE_TYPE RTF -FILE_NAME $RTF_FILE_PATH/$RTF_FILE_NAME.rtf -APPS_SHORT_NAME XXCUST -NLS_LANG en -TERRITORY US -LOG_FILE $LOG_FILE_NAME

 

13. 客户化Personalization
--- ---------------------------------------------------------- 
FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/affrmcus.lct PTIAN_CUSTOM_FUC.ldt FND_FORM_CUSTOM_RULES function_name="INV_INVTOMAI"

 

FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/affrmcus.lct PTIAN_CUSTOM_FUC.ldt


上传的时候遇到“An entity definition is required to define values of type”错误

如果上传的时候,在日志里看到“An entity definition is required to define values of type”的错误,说明你上传指定的$FND_TOP/patch/115/import/xxx文件不正确,重新指定文件,再上床应该就能够成功了。比如我之前上传是遇到这个错误,就是因为我上传的客户化程序,需要制定为affrmcus.lct,但我却用成了afsload.lct

+---------------------------------------------------------------------------+
Application Object Library: Version : 12.0.0

Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.

 module: 
+---------------------------------------------------------------------------+

Current system time is 

+---------------------------------------------------------------------------+

Uploading from the data file PT_CUSTOM_FUC.ldt
Altering database NLS_LANGUAGE environment to AMERICAN
Dump from LCT/LDT files (/slot/ems1112/appmgr/apps/apps_st/appl/fnd/12.0.0/patch/115/import/afsload.lct(120.2.12010000.1), PT_CUSTOM_FUC.ldt) to stage tables
Dump LCT file /slot/ems1112/appmgr/apps/apps_st/appl/fnd/12.0.0/patch/115/import/afsload.lct(120.2.12010000.1) into FND_SEED_STAGE_CONFIG
Dump LDT file PT_CUSTOM_FUC.ldt into FND_SEED_STAGE_ENTITY
An error occurred at line 95 in file PT_CUSTOM_FUC.ldt
An entity definition is required to define values of type FND_FORM_CUSTOM_RULES

 

转载请注明出处:http://blog.csdn.net/pan_tian/article/details/7714269

上一篇:git常用指令


下一篇:Git命令