博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
EBS 常用 SQL
阅读量:5135 次
发布时间:2019-06-13

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

--用SQL查询各Profile的设置情况SELECT pro.profile_option_name,       pro.user_profile_option_name,       lev.level_type TYPE,       --lev.level_code,       lev.level_name,       prv.profile_option_valueFROM apps.fnd_profile_options_vl pro,     applsys.fnd_profile_option_values prv,     (SELECT 10001 level_id,             'Site' level_type,             0 level_value,             'Site' level_code,             'Site' level_name      FROM dual      UNION ALL      SELECT 10002 level_id,             'App' level_type,             app.application_id level_value,             app.application_short_name level_code,             app.application_name level_name      FROM apps.fnd_application_vl app      UNION ALL      SELECT 10003 level_id,             'Resp' level_type,             resp.responsibility_id level_value,             resp.responsibility_key level_code,             resp.responsibility_name level_name      FROM apps.fnd_responsibility_vl resp      UNION ALL      SELECT 10004 level_id,             'User' level_type,             usr.user_id level_value,             usr.user_name level_code,             usr.user_name level_name      FROM applsys.fnd_user usr) levWHERE pro.profile_option_id = prv.profile_option_id(+)AND prv.level_id = lev.level_id(+)AND prv.level_value = lev.level_value(+)     --参数Profile,下面连个条件用一个即可AND pro.user_profile_option_name LIKE 'CUX%' --Profile名称ORDER BY pro.profile_option_name, lev.level_type, lev.level_name;--Purpose  To verify the ABC Assignment Groups defined.--Description  This query will fetch and list the ABC Assignment Groups for all inventory organizations defined in the system.SELECT haou.NAME "ORGANIZATION_NAME"      ,mp.organization_code      ,maag.assignment_group_name "GROUP"      ,maag.compile_name      ,maag.secondary_inventory "SUBINVENTORY"      ,mac.abc_class_name "CLASS_NAME"      ,to_char (trunc (maag.creation_date), 'DD-MON-YYYY') "CREATION_DATE"FROM   mtl_abc_assignment_groups_v maag      ,mtl_abc_assgn_group_classes_v magc      ,mtl_abc_classes_v mac      ,mtl_parameters mp      ,hr_all_organization_units haouWHERE      mp.organization_id = haou.organization_id       AND mp.organization_id = maag.organization_id       AND mp.organization_id = magc.organization_id       AND mp.organization_id = mac.organization_id       AND maag.assignment_group_id = magc.assignment_group_id       AND magc.abc_class_id = mac.abc_class_idORDER BY 2, 3--Purpose  To verify the Shipping Networks defined.--Description  This query will fetch and list the shipping networks defined in the system.SELECT from_organization_code      ,from_organization_name      ,to_organization_code      ,to_organization_name      ,intransit_type      ,fob_point      ,routing_header_id      , (SELECT    gcc.segment1                || '-'                || gcc.segment2                || '-'                || gcc.segment3                || '-'                || gcc.segment4                || '-'                || gcc.segment5                || '-'                || gcc.segment6         FROM   gl_code_combinations gcc         WHERE  gcc.code_combination_id = interorg_transfer_cr_account)          "TRANSFER_CR_ACCOUNT"      , (SELECT    gcc.segment1                || '-'                || gcc.segment2                || '-'                || gcc.segment3                || '-'                || gcc.segment4                || '-'                || gcc.segment5                || '-'                || gcc.segment6         FROM   gl_code_combinations gcc         WHERE  gcc.code_combination_id = interorg_price_var_account)          "PRICE_VARIANCE_ACCOUNT"      , (SELECT    gcc.segment1                || '-'                || gcc.segment2                || '-'                || gcc.segment3                || '-'                || gcc.segment4                || '-'                || gcc.segment5                || '-'                || gcc.segment6         FROM   gl_code_combinations gcc         WHERE  gcc.code_combination_id = interorg_receivables_account)          "INTER_ORG_RECEIVABLES_ACCOUNT"      , (SELECT    gcc.segment1                || '-'                || gcc.segment2                || '-'                || gcc.segment3                || '-'                || gcc.segment4                || '-'                || gcc.segment5                || '-'                || gcc.segment6         FROM   gl_code_combinations gcc         WHERE  gcc.code_combination_id = interorg_payables_account)          "INTER_ORG_PAYABLES_ACCOUNT"      , (SELECT    gcc.segment1                || '-'                || gcc.segment2                || '-'                || gcc.segment3                || '-'                || gcc.segment4                || '-'                || gcc.segment5                || '-'                || gcc.segment6         FROM   gl_code_combinations gcc         WHERE  gcc.code_combination_id = intransit_inv_account)          "INTRANSIT_INV_ACCOUNT"      ,to_char (trunc (creation_date), 'DD-MON-YYYY') "CREATION_DATE"FROM   mtl_shipping_network_viewORDER BY 1, 3--Purpose  To verify the Organization setup defined.--Description  This query will fetch and list all the Organization setup defined in the system.SELECT mp.organization_code      ,houv.NAME      ,houv.organization_type      ,houv.location_code "LOCATION"      ,houv.attribute1 "STORE_PRICING_ZONE CODE"      ,hl.meaning "ORGANIZATION_CLASSIFICATION"      ,hoiv.org_information_context      ,hoiv.org_information1 "PRIMARY_LEDGER"      ,hoiv.org_information2 "LEGAL_ENTITY"      ,hoiv.org_information3 "OPERATING_UNIT"      ,to_char (trunc (houv.creation_date), 'DD-MON-YYYY') "CREATION_DATE"FROM   hr_organization_units_v houv      ,hr_organization_information_v hoiv      ,hr_lookups hl      ,mtl_parameters mpWHERE      houv.organization_id = hoiv.organization_id(+)       AND houv.organization_id = mp.organization_id       AND hoiv.org_information1 = hl.lookup_code(+)       AND hl.lookup_type(+) = 'ORG_CLASS'ORDER BY 1, 2--Purpose  To verify the Account Aliases defined.--Description -- --This query will fetch and list the account aliases along with their GL code combination, --for all the inventory organizations defined in the system.SELECT mp.organization_id      ,mp.organization_code      ,haoc.NAME "ORGANIZATION_NAME"      ,haoc.TYPE "ORG_TYPE"      ,mgd.segment1 "ACCOUNT_ALIAS"      ,   gcc.segment1       || '-'       || gcc.segment2       || '-'       || gcc.segment3       || '-'       || gcc.segment4       || '-'       || gcc.segment5       || '-'       || gcc.segment6          "GL_CODE_COMBINATION"      ,to_char (trunc (mgd.creation_date), 'DD-MON-YYYY') "CREATION_DATE"FROM   mtl_generic_dispositions mgd   ---Account alias definition table      ,mtl_parameters mp      ,hr_all_organization_units haoc      ,gl_code_combinations gccWHERE      mp.organization_id = haoc.organization_id       AND mp.organization_id = mgd.organization_id       AND gcc.code_combination_id = mgd.distribution_accountORDER BY 1, 5--Purpose  To verify the Subinventories defined.--Description  This query will fetch and list all the subinventories for all the inventory organizations defined in the system.SELECT mp.organization_code      ,haoc.TYPE "ORG_TYPE"      ,haoc.NAME "ORGANIZATION_NAME"      ,miv.secondary_inventory_name "SUBINVENTORY_NAME"      ,miv.subinventory_type      ,miv.description      ,miv.status_code "STATUS"      ,miv.locator_type "LOCATOR_CONTROL"      ,to_char (trunc (miv.creation_date), 'DD-MON-YYYY') "CREATION_DATE"FROM   mtl_secondary_inventories_fk_v miv      ,mtl_parameters mp      ,hr_all_organization_units haocWHERE  miv.organization_id = mp.organization_id       AND haoc.organization_id = mp.organization_idORDER BY 2, 5--Purpose  To verify the Organization Hierarchy defined.--Description  This query will fetch and list the Organization hierarchy defined in the system.SELECT pos.name "ORG HIERARCHY NAME"      ,pose.d_parent_name "PARENT ORG NAME"      ,pos.primary_structure_flag      ,pos.position_control_structure_flg      ,pose.d_child_name "SUBORDINATE ORG NAME"      ,TO_CHAR (TRUNC (pos.creation_date), 'DD-MON-YYYY') "DATE_FROM"FROM   per_organization_structures_v pos, per_org_structure_elements_v poseWHERE  pos.organization_structure_id = pose.org_structure_version_idORDER BY 1, 2, 5--Purpose  To verify the Locators defined.--Description  This query will fetch and list the locators defined in the system for subinventories that are locator controlled.SELECT mp.organization_code      ,haoc.TYPE "ORG_TYPE"      ,haoc.NAME "ORGANIZATION_NAME"      ,miv.secondary_inventory_name "SUBINVENTORY_NAME"      ,mil.segment1 "LOCATOR"      ,to_char (trunc (mil.creation_date), 'DD-MON-YYYY') "CREATION_DATE"FROM   mtl_secondary_inventories miv      ,mtl_parameters mp      ,mtl_item_locations mil      ,hr_all_organization_units haocWHERE      mp.organization_id = miv.organization_id       AND miv.secondary_inventory_name = mil.subinventory_code       AND mp.organization_id = haoc.organization_id       AND mp.organization_id = mil.organization_id       AND miv.locator_type = 2ORDER BY 1, 2, 5--Purpose  To verify the ABC Classes defined.--Description  This query will fetch and list the ABC Classes for all inventory organizations defined in the system.SELECT haou.name "ORGANIZATION_NAME"      ,mp.organization_code      ,mac.abc_class_name "CLASS_NAME"      ,mac.description      ,mac.disable_date      ,TO_CHAR (TRUNC (mac.creation_date), 'DD-MON-YYYY') "CREATION_DATE"FROM   mtl_abc_classes_v mac      ,mtl_parameters mp      ,hr_all_organization_units haouWHERE  mp.organization_id = haou.organization_id       AND mp.organization_id = mac.organization_idORDER BY 2, 3--Purpose  To verify the ABC Compiles defined.--Description  This query will fetch and list the ABC Compiles for all inventory organizations defined in the system.SELECT haou.NAME "ORGANIZATION_NAME"      ,mp.organization_code      ,mach.compile_name      ,mach.description      ,mach.secondary_inventory "SUBINVENTORY"      ,mach.compile_type_description "CRITERION"      ,mach.cost_type_description "COST_TYPE"      ,mach.mrp_forecast_name "FORECAST"      ,mach.mrp_plan_name "PLAN_NAME"      ,mach.start_date "FROM_DATE"      ,mach.cutoff_date "TO_DATE"      ,to_char (trunc (mach.creation_date), 'DD-MON-YYYY') "CREATION_DATE"FROM   mtl_abc_compile_headers_v mach      ,mtl_parameters mp      ,hr_all_organization_units haouWHERE  mp.organization_id = haou.organization_id       AND mp.organization_id = mach.organization_idORDER BY 2, 3---To verify the Cycle Counts defined---- This query will fetch and list the Cycle Counts for all inventory organizations defined in the system.SELECT haou.NAME "ORGANIZATION_NAME"      ,mp.organization_code      ,mcch.cycle_count_header_name "CYCLE_COUNT_NAME"      ,mcch.description      ,mcch.cycle_count_calendar "CALENDAR"      , (SELECT    gcc.segment1                || '-'                || gcc.segment2                || '-'                || gcc.segment3                || '-'                || gcc.segment4                || '-'                || gcc.segment5                || '-'                || gcc.segment6         FROM   gl_code_combinations gcc         WHERE  gcc.code_combination_id = inventory_adjustment_account)          "ADJUSTMENT_ACCOUNT"      ,mcch.disable_date      ,mcch.days_until_late "LATE_COUNT_DAYS"      ,mcch.next_user_count_sequence "STARTING_SEQUENCE"      ,mcch.unscheduled_count_entry "UNSCHEDULED_ENTRIES"      ,mcch.automatic_recount_flag      ,mcch.maximum_auto_recounts      ,mcs.subinventory      ,mcs.disable_flag      ,mcch.serial_count_option_meaning "SERIAL_COUNT"      ,mcch.serial_detail_option_meaning "SERIAL_DETAIL"      ,mcch.serial_adj_option_meaning "SERIAL_ADJUSTMENT"      ,mcch.serial_dis_option_meaning "SERIAL_DISCREPANCY"      ,mcch.autoschedule_enabled_flag      ,mcch.zero_count_flag "COUNT_ZERO_QUANTITY"      ,mcch.header_last_schedule_date "LAST_DATE"      ,mcch.header_next_schedule_date "NEXT_DATE"      ,mcch.approval_tolerance_positive "QUANTITY_VARIANCE (+) %"      ,mcch.approval_tolerance_negative "QUANTITY_VARIANCE (-) %"      ,mcch.cost_tolerance_positive "ADJUSTMNT_VALUE (+) %"      ,mcch.cost_tolerance_negative "ADJUSTMNT_VALUE (-) %"      ,mcch.hit_miss_tolerance_positive "HIT/MISS_ANALYSIS (+) %"      ,mcch.hit_miss_tolerance_negative "HIT/MISS_ANALYSIS (-) %"      ,maag.assignment_group_name "GROUP"      ,mccv.cc_class_name "CLASSES"      ,to_char (trunc (mcch.creation_date), 'DD-MON-YYYY') "CREATION_DATE"FROM   mtl_cycle_count_headers_v mcch      ,mtl_cc_subinventories mcs      ,mtl_abc_assignment_groups_v maag      ,mtl_cycle_count_classes_v mccv      ,mtl_parameters mp      ,hr_all_organization_units haouWHERE      mp.organization_id = haou.organization_id       AND mp.organization_id = mcch.organization_id       AND mp.organization_id = maag.organization_id       AND mp.organization_id = mccv.organization_id       AND mcch.cycle_count_header_id = mccv.cycle_count_header_id       AND mcs.cycle_count_header_id(+) = mcch.cycle_count_header_id       AND mcs.cycle_count_header_id = mccv.cycle_count_header_id       AND maag.assignment_group_id = mcch.abc_assignment_group_idORDER BY 2, 3, 13---获取concurrent trace file的path and nameSELECT req.request_id,       req.logfile_node_name node,       req.oracle_process_id,       req.enable_trace,       dest.value || '/' || lower(dbnm.value) || '_ora_' ||       oracle_process_id || '.trc' trace_filename,       prog.user_concurrent_program_name,       execname.execution_file_name,       execname.subroutine_name,       phase_code,       status_code,       ses.sid,       ses.serial#,       ses.module,       ses.machineFROM fnd_concurrent_requests    req,     v$session                  ses,     v$process                  proc,     v$parameter                dest,     v$parameter                dbnm,     fnd_concurrent_programs_vl prog,     fnd_executables            execnameWHERE 1 = 1AND req.request_id = 146830457/146830520AND req.oracle_process_id = proc.spid(+)AND proc.addr = ses.paddr(+)AND dest.name = 'user_dump_dest'AND dbnm.name = 'db_name'AND req.concurrent_program_id = prog.concurrent_program_idAND req.program_application_id = prog.application_idAND prog.application_id = execname.application_idAND prog.executable_id = execname.executable_id---查询concurrent跑了多久SELECT fcr.request_id request_id,       trunc(((fcr.actual_completion_date - fcr.actual_start_date) /             (1 / 24)) * 60) exec_time,       fcr.actual_start_date start_date,       fcp.concurrent_program_name conc_prog,       fcpt.user_concurrent_program_name user_conc_progFROM fnd_concurrent_programs    fcp,     fnd_concurrent_programs_tl fcpt,     fnd_concurrent_requests    fcrWHERE trunc(((fcr.actual_completion_date - fcr.actual_start_date) /            (1 / 24)) * 60) > nvl('', 45)AND fcr.concurrent_program_id = fcp.concurrent_program_idAND fcr.program_application_id = fcp.application_idAND fcr.concurrent_program_id = fcpt.concurrent_program_idAND fcr.program_application_id = fcpt.application_idAND fcpt.language = userenv('Lang')ORDER BY trunc(((fcr.actual_completion_date - fcr.actual_start_date) /               (1 / 24)) * 60) DESC;

转载于:https://www.cnblogs.com/quanweiru/archive/2013/05/28/3103272.html

你可能感兴趣的文章
JIRA
查看>>
ssl介绍以及双向认证和单向认证原理
查看>>
【BZOJ2441】【中山市选2011】小W的问题(树状数组+权值线段树)
查看>>
小技巧——直接在目录中输入cmd然后就打开cmd命令窗口
查看>>
深浅拷贝(十四)
查看>>
由级别和性格特征将程序员分类 ---看看你属于哪一种
查看>>
HDU 6370(并查集)
查看>>
BZOJ 1207(dp)
查看>>
对我来说,只有一件事情是重要的
查看>>
完整的Socket代码
查看>>
PE知识复习之PE的导入表
查看>>
POJ 3280 Cheapest Palindrome
查看>>
HDU 2076 夹角有多大(题目已修改,注意读题)
查看>>
Objective-C非正式协议与正式协议
查看>>
洛谷P3676 小清新数据结构题(动态点分治)
查看>>
SPOJ DQUERY D-query(主席树 区间不同数个数)
查看>>
八 Civil3d常用显示样式的编辑与创建 ----点标签样式2
查看>>
九校联考-DL24凉心模拟Day2T1 锻造(forging)
查看>>
生产阶段Webpack打包【基础打包】
查看>>
Cortex M3/M4 学习摘要(二)
查看>>