Oracle EBS环境下查找数据源(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页面中对应的后台数据库对象):

​​​​​​​

?[Copy to clipboard]View Code SQL

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

SELECT podocumenttypeseo.document_type_code,

       podocumenttypeseo.org_id,

       podocumenttypeseo.document_subtype,

       podocumenttypeseo.document_template_code,

       podocumenttypeseo.contract_template_code,

       xtv1.template_name AS document_types_layout,

       xtv2.template_name AS contract_terms_layout,

       plc1.displayed_field || ' ' || plc2.displayed_field AS TYPE,

       decode(podocumenttypeseo.document_type_code,

              'RFQ',

              decode(podocumenttypeseo.document_subtype,

                     'STANDARD',

                     'DeleteDisabled',

                     'CATALOG',

                     'DeleteDisabled',

                     'BID',

                     'DeleteDisabled',

                     'DeleteEnabled'),

              'QUOTATION',

              decode(podocumenttypeseo.document_subtype,

                     'STANDARD',

                     'DeleteDisabled',

                     'CATALOG',

                     'DeleteDisabled',

                     'BID',

                     'DeleteDisabled',

                     'DeleteEnabled'),

              'DeleteDisabled') AS delete_switcher,

       podocumenttypeseo.type_name

  FROM po_document_types_all_vl podocumenttypeseo,

       xdo_templates_vl         xtv1,

       xdo_templates_vl         xtv2,

       po_lookup_codes          plc1,

       po_lookup_codes          plc2

 WHERE xtv1.template_code(+) = podocumenttypeseo.document_template_code

   AND xtv2.template_code(+) = podocumenttypeseo.contract_template_code

   AND podocumenttypeseo.document_type_code = plc1.lookup_code

   AND plc1.lookup_type = 'DOCUMENT TYPE'

   AND podocumenttypeseo.document_subtype = plc2.lookup_code

   AND plc2.lookup_type = decode(podocumenttypeseo.document_type_code,

                                 'REQUISITION',

                                 'REQUISITION TYPE',

                                 'RFQ',

                                 'RFQ SUBTYPE',

                                 'QUOTATION',

                                 'QUOTATION SUBTYPE',

                                 'DOCUMENT SUBTYPE')

   AND podocumenttypeseo.org_id = :1

二、使用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,进入诊断模式
    正在上传…重新上传取消
  2. 以预置文件设置的同一用户登录首页,在页面的顶部点击Global按钮 Diagnostics
    正在上传…重新上传取消
  3. 根据需要,选择Trace打头的几个选项来进入SQL Trace模式,点击Save按钮
    正在上传…重新上传取消
  4. 进入PO Document Types页面更新Forward Method后保存
    正在上传…重新上传取消
  5. 再次进入Diagnostics关闭Trace,记录下生成的最后一个Trace ID号码16456
    正在上传…重新上传取消
  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语句

?[Copy to clipboard]View Code SQL

1

2

3

4

5

6

7

8

UPDATE po_document_types_all_b podocumenttypeeo

   SET last_update_date     = :1,

       last_updated_by      = :2,

       forwarding_mode_code = :3,

       last_update_login    = :4

 WHERE org_id = :5

   AND document_type_code = :6

   AND document_subtype = :7

 

猜你喜欢

转载自blog.csdn.net/2301_76957510/article/details/129925122