博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Oracle EBS中查询Profile的各种SQL【转载】
阅读量:5314 次
发布时间:2019-06-14

本文共 4596 字,大约阅读时间需要 15 分钟。

1.List E-Business Suite Profile Option Values For All Levels

SELECT p.profile_option_name SHORT_NAME,

       n.user_profile_option_name NAME,
       decode(v.level_id,
              10001,
              'Site',
              10002,
              'Application',
              10003,
              'Responsibility',
              10004,
              'User',
              10005,
              'Server',
              10006,
              'Org',
              10007,
              decode(to_char(v.level_value2),
                     '-1',
                     'Responsibility',
                     decode(to_char(v.level_value), '-1', 'Server', 'Server+Resp')),
              'UnDef') LEVEL_SET,
       decode(to_char(v.level_id),
              '10001',
              '',
              '10002',
              app.application_short_name,
              '10003',
              rsp.responsibility_key,
              '10004',
              usr.user_name,
              '10005',
              svr.node_name,
              '10006',
              org.name,
              '10007',
              decode(to_char(v.level_value2),
                     '-1',
                     rsp.responsibility_key,
                     decode(to_char(v.level_value),
                            '-1',
                            (SELECT node_name
                               FROM fnd_nodes
                              WHERE node_id = v.level_value2),
                            (SELECT node_name
                               FROM fnd_nodes
                              WHERE node_id = v.level_value2) || '-' ||
                            rsp.responsibility_key)),
              'UnDef') "CONTEXT",
       v.profile_option_value VALUE
  FROM fnd_profile_options       p,
       fnd_profile_option_values v,
       fnd_profile_options_tl    n,
       fnd_user                  usr,
       fnd_application           app,
       fnd_responsibility        rsp,
       fnd_nodes                 svr,
       hr_operating_units        org
WHERE p.profile_option_id = v.profile_option_id(+)
   AND p.profile_option_name = n.profile_option_name
   AND upper(p.profile_option_name) IN
       (SELECT profile_option_name
          FROM fnd_profile_options_tl
         WHERE upper(user_profile_option_name) LIKE
               upper('%&user_profile_name%'))
   AND usr.user_id(+) = v.level_value
   AND rsp.application_id(+) = v.level_value_application_id
   AND rsp.responsibility_id(+) = v.level_value
   AND app.application_id(+) = v.level_value
   AND svr.node_id(+) = v.level_value
   AND org.organization_id(+) = v.level_value
ORDER BY short_name,
          user_profile_option_name,
          level_id,
          level_set;

2.How to Search all of the Profile Options for a Specific Value

SELECT p.profile_option_name profile_option_name,

       n.user_profile_option_name user_profile_option_name,
       DECODE(v.level_id,
              10001,
              'Site',
              10002,
              'Application',
              10003,
              'Responsibility',
              10004,
              'User',
              10005,
              'Server',
              'UnDef') LEVEL_SET,
       DECODE(TO_CHAR(v.level_id),
              '10001',
              '',
              '10002',
              app.application_short_name,
              '10003',
              rsp.responsibility_key,
              '10005',
              svr.node_name,
              '10006',
              org.name,
              '10004',
              usr.user_name,
              'UnDef') "CONTEXT",
       v.profile_option_value VALUE
  FROM fnd_profile_options       p,
       fnd_profile_option_values v,
       fnd_profile_options_tl    n,
       fnd_user                  usr,
       fnd_application           app,
       fnd_responsibility        rsp,
       fnd_nodes                 svr,
       hr_operating_units        org
WHERE p.profile_option_id = v.profile_option_id(+)
   AND p.profile_option_name = n.profile_option_name
   AND usr.user_id(+) = v.level_value
   AND rsp.application_id(+) = v.level_value_application_id
   AND rsp.responsibility_id(+) = v.level_value
   AND app.application_id(+) = v.level_value
   AND svr.node_id(+) = v.level_value
   AND org.organization_id(+) = v.level_value
   AND v.PROFILE_OPTION_VALUE LIKE '%'
ORDER BY level_set;

3.How To Find All Users With A Particular Profile Option Set?

SELECT p.profile_option_name SHORT_NAME,

       n.user_profile_option_name NAME,
       decode(v.level_id,
              10001,
              'Site',
              10002,
              'Application',
              10003,
              'Responsibility',
              10004,
              'User',
              10005,
              'Server',
              'UnDef') LEVEL_SET,
       decode(to_char(v.level_id),
              '10001',
              '',
              '10002',
              app.application_short_name,
              '10003',
              rsp.responsibility_key,
              '10005',
              svr.node_name,
              '10006',
              org.name,
              '10004',
              usr.user_name,
              'UnDef') "CONTEXT",
       v.profile_option_value VALUE
  FROM fnd_profile_options       p,
       fnd_profile_option_values v,
       fnd_profile_options_tl    n,
       fnd_user                  usr,
       fnd_application           app,
       fnd_responsibility        rsp,
       fnd_nodes                 svr,
       hr_operating_units        org
WHERE p.profile_option_id = v.profile_option_id(+)
   AND p.profile_option_name = n.profile_option_name
   AND usr.user_id(+) = v.level_value
   AND rsp.application_id(+) = v.level_value_application_id
   AND rsp.responsibility_id(+) = v.level_value
   AND app.application_id(+) = v.level_value
   AND svr.node_id(+) = v.level_value
   AND org.organization_id(+) = v.level_value
   AND Upper(n.user_profile_option_name) LIKE upper('INV:Debug Level')
ORDER BY short_name;

where you will prompt for the User_Profile_Option_Name you want to check and you will put the Profile name that you want to check, for example: Apps Servlet Agent 
If you want to check on the users level then you can append a condition : and v.level_id = 10004,  same goes for Responsibility level then append the condition v.level_id = 10003. 

If you want for a certain user, then you can append a condition: and usr.user_name = '&User_Name'  where you will prompt for the User_Name and then you will put the user you want to check, for  example: SYSADMIN

原文地址:http://www.cnblogs.com/benio/archive/2013/03/12/2955963.html

转载于:https://www.cnblogs.com/echochen/p/3145197.html

你可能感兴趣的文章
博弈论
查看>>
Redis sentinel & cluster 原理分析
查看>>
我的工作习惯小结
查看>>
把word文档中的所有图片导出
查看>>
浏览器的判断;
查看>>
ubuntu 18.04取消自动锁屏以及设置键盘快捷锁屏
查看>>
Leetcode 589. N-ary Tree Preorder Traversal
查看>>
机器学习/深度学习/其他开发环境搭建记录
查看>>
xml.exist() 实例演示
查看>>
判断是否为空然后赋值
查看>>
zabbix监控日志文件
查看>>
正则表达式
查看>>
pip install torch on windows, and the 'from torch._C import * ImportError: DLL load failed:' s...
查看>>
java基础(一):我对java的三个环境变量的简单理解和配置
查看>>
arcgis api 4.x for js 结合 Echarts4 实现散点图效果(附源码下载)
查看>>
YTU 2625: B 构造函数和析构函数
查看>>
apache自带压力测试工具ab的使用及解析
查看>>
C#使用Xamarin开发可移植移动应用(2.Xamarin.Forms布局,本篇很长,注意)附源码
查看>>
jenkins搭建
查看>>
C#中使用Split分隔字符串的技巧
查看>>