OAF页面查找数据源

在OAF页面的查找后台的数据源相对于在Form中显得更加麻烦,同时也无法像Form中那样能够较为准确的定位,但是也能够查找出大部分的内容。

本文介绍如何使用OAF提供的诊断功能来快速查找OAF页面对应的数据库对象:

  1. 关于本页功能(About this Page)
  2. SQL Trace功能

 

一、使用关于本页功能(About this Page)

前提:在用户层设置预制文件:Personalize Self-Service Defn 的值为Yes 来启动个性化模式

步骤:

  1. 点击OAF页面左下角的“About this Page”链接
  2. 进入关于页面中,展开Page Definition部分的页面结构,页面的结构会随着页面定义有所不同
  3. 或者选择Business Component References Details部分中的View Object定义
  4. 查看View Object列中的信息,组件引用的视图对象会有链接,直接点击链接进入视图对象页面
  5. 视图对象详细信息中的SQL就是创建视图对象的语句,查看它就可以知道页面组件对应的后台数据源
  6. 通过选择不同的视图对象查看对应的定义

实例(找出PO Document Types页面中对应的后台数据库对象):

  1. 点击Document Types页面左下角的About this Page链接
    po_document_types
  2. 进入About Page页面后,展开页面定义部分为如下的结构
    oaf_page_definition
  3. 点击PoAllDocumentTypesVO视图对象链接进入视图对象定义详细页面
    oaf_view_objects_details
  4. 另外也可以在About Page页面中展开Business Component References Details,然后选择下面的视图对象:oracle.apps.po.setup.server.PoAllDocumentTypesVO
    oaf_bc_vo
  5. 通过视图对象详细页面可以得到SQL
     1 SELECT podocumenttypeseo.document_type_code,
     2        podocumenttypeseo.org_id,
     3        podocumenttypeseo.document_subtype,
     4        podocumenttypeseo.document_template_code,
     5        podocumenttypeseo.contract_template_code,
     6        xtv1.template_name AS document_types_layout,
     7        xtv2.template_name AS contract_terms_layout,
     8        plc1.displayed_field || ' ' || plc2.displayed_field AS TYPE,
     9        decode(podocumenttypeseo.document_type_code,
    10               'RFQ',
    11               decode(podocumenttypeseo.document_subtype,
    12                      'STANDARD',
    13                      'DeleteDisabled',
    14                      'CATALOG',
    15                      'DeleteDisabled',
    16                      'BID',
    17                      'DeleteDisabled',
    18                      'DeleteEnabled'),
    19               'QUOTATION',
    20               decode(podocumenttypeseo.document_subtype,
    21                      'STANDARD',
    22                      'DeleteDisabled',
    23                      'CATALOG',
    24                      'DeleteDisabled',
    25                      'BID',
    26                      'DeleteDisabled',
    27                      'DeleteEnabled'),
    28               'DeleteDisabled'AS delete_switcher,
    29        podocumenttypeseo.type_name
    30   FROM po_document_types_all_vl podocumenttypeseo,
    31        xdo_templates_vl         xtv1,
    32        xdo_templates_vl         xtv2,
    33        po_lookup_codes          plc1,
    34        po_lookup_codes          plc2
    35  WHERE xtv1.template_code(+= podocumenttypeseo.document_template_code
    36    AND xtv2.template_code(+= podocumenttypeseo.contract_template_code
    37    AND podocumenttypeseo.document_type_code = plc1.lookup_code
    38    AND plc1.lookup_type = 'DOCUMENT TYPE'
    39    AND podocumenttypeseo.document_subtype = plc2.lookup_code
    40    AND plc2.lookup_type = decode(podocumenttypeseo.document_type_code,
    41                                  'REQUISITION',
    42                                  'REQUISITION TYPE',
    43                                  'RFQ',
    44                                  'RFQ SUBTYPE',
    45                                  'QUOTATION',
    46                                  'QUOTATION SUBTYPE',
    47                                  'DOCUMENT SUBTYPE')
    48    AND podocumenttypeseo.org_id = :1
    49 
    50 

     

 

二、使用SQL Trace功能

只要发生数据库操作,都可以使用SQL Trace功能来跟踪数据库操作统计,OAF页面中也需要进行数据库的增删查操作,因此可以可以使用它来跟踪。

前提:在用户层设置预制文件:FND: Diagnostics 的值为Yes,进入诊断模式

步骤

  1. 选择Diagnostic为Set Trace Level,点击Go按钮
  2. 设置SQL Trace的级别
  3. 进入OAF页面中进行操作,并保证操作有查询、插入、更新或删除动作
  4. 操作完成后,再次进入关闭Trace模式,记录生成的Trace ID号码
  5. 以数据库操作系统用户,如ora02登陆数据库服务器
  6. 使用Tkprof工具格式化Trace结果文件输出
  7. 查看被格式化过的Trace文件
  8. 得出数据源

实例:

  1. 以系统管理员职责,在用户层设置预制文件:FND: Diagnostics 的值为Yes,进入诊断模式。(OAF更改配置文件的,需要清空缓存或重启应用才生效)
    fnd_diagnostics_profile
  2. 以预置文件设置的同一用户登录首页,在页面的顶部点击Global按钮 Diagnostics
    oaf_diagnostics_button
  3. 根据需要,选择Trace打头的几个选项来进入SQL Trace模式,点击Save按钮
    oaf_set_trace_level
  4. 进入PO Document Types页面更新Forward Method后保存
    update_document_type
  5. 再次进入Diagnostics关闭Trace,记录下生成的最后一个Trace ID号码16456
    oaf_disable_trace
  6. 使用下面的SQL查询出trace文件的路径
    SELECT value
    FROM v$parameter
    WHERE name = ‘user_dump_dest’;
    VALUE
    ———————————————————————–
    /d02/db/tech_st/11.1.0/admin/VIS02_ebs006/diag/rdbms/vis02/VIS02/trace
  7. 以数据库操作系统用户(ora02)Telnet到数据库服务器,运行如下命令
    [ora02@ebs006 ~]$ cd /d02/db/tech_st/11.1.0/admin/VIS02_ebs006/diag/rdbms/vis02/VIS02/trace
    [ora02@ebs006 trace]$ ls -al *16456*
    -rw-r–r– 1 ora02 dba 116421 Aug 11 17:48 16456_234_1.output
    -rw-r–r– 1 ora02 dba 502101 Aug 11 17:35 VIS02_ora_16456_234.trc
    -rw-r–r– 1 ora02 dba 17288 Aug 11 17:35 VIS02_ora_16456_234.trm
    [ora02@ebs006 trace]$ tkprof VIS02_ora_16456_234.trc 16456_234_1.output
  8. 上面命令生成16456_234_1.output文件,从服务器下载文件后,找出文件中的UPDATE语句,其中对ICX类型的更新动作无需关注,16456_234_1.output文件样例
  9. 找到如下的UPDATE语句
    1 UPDATE po_document_types_all_b podocumenttypeeo
    2    SET last_update_date     = :1,
    3        last_updated_by      = :2,
    4        forwarding_mode_code = :3,
    5        last_update_login    = :4
    6  WHERE org_id = :5
    7    AND document_type_code = :6
    8    AND document_subtype = :7 
    9 

     

 


 

转载:http://oracleseeker.com/2009/08/12/how_to_find_the_table_view_of_oaf_application_in_oracle_ebs/
posted @ 2010-11-28 19:36  郭振斌  阅读(3393)  评论(0编辑  收藏  举报