# EBS中odf文件和xdf文件解释

1、ODF

odf(Object Descriptor File),里边含有数据库对象的描述，用于创建数据库表，视图，索引等等。

[oracle@bej301441 odf]$cd$INV_TOP/patch/115/odf/
[oracle@bej301441 odf]$adodfcmp odffile=invslig.odf userid=inv/inv changedb=yes priv_schema=system/manager mode=indexes touser=apps/apps logfile=invtab.log adodfcmp parameters parameters are required: mode, touser, priv_schema, odffile, userid mode (required) :Determines the type of objects to compare against the ODF.Example tables,indexes touser (required) : Specifies the Oracle username/password of the Oracle Applications product to grant to. In Release 11i/R12 this is usually APPS schema. priv_schema (required) :Specify a schema having DBA privileges, along with its password. You may specify the SYSTEM schema odffile (required) : The name of the object descriptor file (file extension .odf) to compare. userid (required) :The Oracle username/password for the product’s base schema. This is the schema where the product tables, indexes and sequences are located for example inv/inv changedb (opt) No :Set to yes to change the database objects to match the definitions in the object descriptor files. Customizations are not affected because the utility does not delete objects not found in the ODF. Using the default, No, will not make anychanges only produce a log file indicating what changes need to be made. Sample Log ************* Start of ODF Comparison Utility session ************* ODF Comparison Utility version: 12.0.0 ODF Comparison Utility started at: Tue Jul 31 2012 00:21:00 Connecting to SYSTEM......Connected successfully. Connecting to APPS......Connected successfully. Reading objects from ODF file Reading table MTL_CLIENT_PARAMETERS ... Reading table MTL_TXNS_HISTORY ... Reading table MTL_BILLING_SOURCES_B ... Reading table MTL_BILLING_SOURCES_TL ... Reading table MTL_BILLING_RULE_HEADERS_B ... Reading table MTL_BILLING_RULE_HEADERS_TL ... Reading table MTL_BILLING_RULE_LINES ... Reading table MTL_3PL_LOCATOR_OCCUPANCY ... Reading table MTL_ADJUSTMENT_SYNC_TEMP ... Reading table MTL_LSP_ONHAND_BALANCE_TMP ... .... .... ... Start time for statement below is: Tue Jul 31 2012 00:21:03 ALTER TABLE INV.MTL_LSP_ONHAND_BALANCE_TMP STORAGE (FREELISTS 4) Statement executed. ODF Comparison Utility is complete. You should check the file /u01/oracle/instance/apps/apps_st/appl/inv/12.0.0/patch/115/odf/invtab.log for errors. 2、xdf 关于odf文件，写过一篇笔记,见：Oracle Apps ADODFCMP Utility, xdf和odf类似，都是数据库对象的描述文件，用于数据库表，视图，索引等等在不同数据库间的移植。根据NOTE:551325.1的说法，xdf将会逐步取代过去的odf，毕竟xdf的xml格式还是要比文本格式的odf有方便处理些。 xdf对应的执行文件是$JAVA_TOP/oracle/apps/fnd/odf2/FndXdfCmp(一java文件)

odf对应的执行文件是$AD_TOP/bin/adodfcmp(脚本语言) xdf文件放在一般在patch/115/xdf目录下 而odf一般在patch/115/odf/下 xdf包含两个组件：FndXdfGen从源头数据库，生成对应的xdf对象；FndXdfCmp在目标数据库中执行xdf文件。 FndXdfCmp命令的使用 Usage of the Java Utility FndXdfCmp : adjava -mx512m -nojit oracle.apps.fnd.odf2.FndXdfCmp <Oracle_Schema> <Oracle_Password> \ <apps_schema> <apps_password> <jdbc protocol> <JDBC_Connect_String> <Object Type> \ <full path to xdf file> <full path of$FND_TOP/patch/115/xdf/xsl>

possible Object Types are :
table, mview, view, synonym, index, trigger, comment, context, mviewlog, qtable, sequence, type, queue, policy, all

Mandatory Arguments :

• Oracle_Schema : ORACLE schema name of the EBS module, e.g. FND, AD, GL, MFG.
• JDBC_Connect_String : The JDBC connection string to connect to the Database. It must include the <hostname>:<DB_Port>:<SID>

Optional Parameters

• apps_schema / apps_password : The APPS schema name and APPS shcema password needs to be specified if it is not the default value of apps/apps.
• ChangeDb : This Parameter inidcates, if the object definitions are written to the Database. Possible values are y / n (Default is y)
• Logfile : The output is written to standard out. Specify a logfile name if it has to be written to a log file.
• Data_Sec_Vpd : This is used to specify that a service security synonyms or view has to be created dynamically based on the database version. If the database version is 9 then a synonym is created else a view is created. Permitted values are data_sec_vpd=y
Example :
cd $FND_TOP/patch/115/xdf adjava -mx512m -nojit oracle.apps.fnd.odf2.FndXdfCmp fnd <Password> apps <Password> thin \ <hostname>:<db_port>:<db_sid> all fnd_usr_roles.xdf$FND_TOP/patch/115/xdf/xsl

Reference:Metalink Note 551325.1 - How to verify or create a Database Object using a odf (adodfcmp) or xdf (FndXdfCmp) file ?