How to Enable Trace or Debug for APIs executed as SQL Script Outside of the Applications ?
In this Document
Goal |
Solution |
1: How do you enable trace for an API when executed from a SQL script outside of Oracle Applications ? |
2: How do you get debug log for an API when executed from a SQL script outside of Oracle Applications ? |
a) For Inventory APIs |
b) For Bills of Material & Engineering APIs |
c) For Advanced Product Catalog (APC / PIM / EGO) APIs |
References |
APPLIES TO:
Oracle Inventory Management - Version 11.5.10.CU2 to 12.1.3 [Release 11.5.10 to 12.1]
Oracle Bills of Material - Version 11.5.10.2 to 12.1.3 [Release 11.5 to 12.1]
Oracle Engineering - Version 11.5.10.2 to 12.1.3 [Release 11.5 to 12.1]
Oracle Product Hub - Version 11.5.10.2 to 12.1.3 [Release 11.5 to 12.1]
Information in this document applies to any platform.
This document includes all versions of 11.5.10 and R12 and later
GOAL
This document addresses the below questions:
1. How do you enable trace for an API when executed from a SQL script outside of Oracle Applications ?
2. How to get the debug log for APIs when executed from a SQL script outside of Oracle Applications ?
a) Inventory APIs
b) Bills of Material and Engineering APIs
c) Advanced Product Catalog (APC / EGO/ PIM) APIs
Note: Debug profiles are specific to modules, but, trace can be enabled for any API by following the steps provided here.
SOLUTION
1: How do you enable trace for an API when executed from a SQL script outside of Oracle Applications ?
ALTER SESSION SET EVENTS '10046 trace name context forever, level 12';
-- Set the trace file identifier, to locate the file on the server
ALTER SESSION SET TRACEFILE_IDENTIFIER = 'API_TRACE';
-- Execute the API from the SQL script, in the same session.
EXEC <procedure name> ;
-- Once the API completes execution, disable trace
ALTER SESSION SET EVENTS '10046 trace name context off';
-- Locate the trace file based on the tracefile identifier
SELECT VALUE FROM V$PARAMETER WHERE NAME = 'user_dump_dest';
-- Generate the tkprof of the trace file
tkprof <trace_File>.trc <tkprof>.out sys=no explain=apps/<apps pwd>
2: How do you get debug log for an API when executed from a SQL script outside of Oracle Applications ?
a) For Inventory APIs
i. Enable INV Debug profiles at User level for the user who would be running the API.
For example:
INV:Debug level = 15
INV: Debug File = /tmp/invdbg_TAR.dbg
For more information, on INV Debug profiles, Please refer to Note 148651.1
ii. Add the below declarations to the sql script calling the API outside of Oracle Applications.
l_user_id NUMBER := -1;
l_resp_id NUMBER := -1;
l_application_id NUMBER := -1;
l_user_name VARCHAR2(30) := 'MFG'; -- user name
l_resp_name VARCHAR2(30) := 'Inventory'; -- responsibility name
iii. Add the below code before the API is called in the SQL script. This will initialize applications context, and will use the values of the debug profiles set for this user.
SELECT user_id
INTO l_user_id
FROM fnd_user
WHERE user_name = l_user_name;
-- Get the application_id and responsibility_id
SELECT application_id, responsibility_id
INTO l_application_id, l_resp_id
FROM fnd_responsibility_vl
WHERE responsibility_name = l_resp_name;
FND_GLOBAL.APPS_INITIALIZE(l_user_id, l_resp_id, l_application_id); -- Mfg / Mfg & Dist Mgr / INV
dbms_output.put_line('Initialized applications context: '|| l_user_id || ' '|| l_resp_id ||' '|| l_application_id );
iv. Now, go ahead and execute the API from the SQL script, this willl create the debug log file with the file name as provided in the profile "INV: Debug File".
You can review step-by-step video here - Video - Trace
and Debug INV API (2:00)
b) For Bills of Material & Engineering APIs
i. Initialize the below parameters to the API:
p_debug => 'Y',
p_output_dir => '/usr/tmp', -- Directory from utl_file_dir
p_debug_filename => 'bom_api_debug.log' -- Debug log filename
);
ii. Now run the API script or procedure created, This will create the debug log in the directory as mentioned in the parameters.
For example:
p_api_version_number => 1.0,
p_init_msg_list => TRUE,
p_bom_header_rec => l_bom_header_rec,
p_bom_revision_tbl => l_bom_revision_tbl,
p_bom_component_tbl => l_bom_component_tbl,
p_bom_ref_designator_tbl => l_bom_ref_designator_tbl,
p_bom_sub_component_tbl => l_bom_sub_component_tbl,
x_bom_header_rec => x_bom_header_rec,
x_bom_revision_tbl => x_bom_revision_tbl,
x_bom_component_tbl => x_bom_component_tbl,
x_bom_ref_designator_tbl => x_bom_ref_designator_tbl,
x_bom_sub_component_tbl => x_bom_sub_component_tbl,
x_return_status => l_return_status,
x_msg_count => l_msg_count ,
p_debug => 'Y',
p_output_dir => '/usr/tmp',
p_debug_filename => 'bom_api_debug.log'
);
You can review step-by-step video here - Video
- Trace and Debug ECO API (2:00)
c) For Advanced Product Catalog (APC / PIM / EGO) APIs
i. Initialize the below parameters to the API:
p_debug_level => 3 -- 0 - No debug, 3 - finest debug information
);
ii. Now run the API script or procedure created, This will create the debug log in the directory (as in 'utl_file_dir' DB parameter, for ex: /usr/tmp)
For example:
l_api_version
, l_object_name
, l_attributes_row_table
, l_attributes_data_table
, l_pk_column_name_value_pairs
, l_class_code_name_value_pairs
, l_user_privileges_on_object
, l_entity_id
, l_entity_index
, l_entity_code
, l_debug_level
, l_init_error_handler
, l_write_to_concurrent_log
, l_init_fnd_msg_list
, l_log_errors
, l_add_errors_to_fnd_stack
, l_commit
, x_failed_row_id_list
, x_return_status
, x_errorcode
, x_msg_count
, x_msg_data
);
How to Enable Trace or Debug for APIs executed as SQL Script Outside of the Applications ?的更多相关文章
- Trace、Debug和TraceSource的使用以及日志设计 .
[-] Trace 和 Debug区别 什么是Listeners 跟踪开关 使用BooleanSwitch开关 使用TraceSwitch开关 使用TraceSource代替Trace和Debug 设 ...
- C#学习笔记14——TRACE、DEBUG和TRACESOURCE的使用以及日志设计
Trace.Debug和TraceSource的使用以及日志设计 .NET Framework 命名空间 System.Diagnostics 包含用于跟踪执行流程的 Trace.Debug 和 ...
- 【转】 C#学习笔记14——Trace、Debug和TraceSource的使用以及日志设计
[转] C#学习笔记14——Trace.Debug和TraceSource的使用以及日志设计 Trace.Debug和TraceSource的使用以及日志设计 .NET Framework 命名空 ...
- Trace和Debug主要用法
#region 日志记录 //System.Diagnostics.Trace.Listeners.Clear(); //System.Diagnostics.Trace.AutoFlush = tr ...
- Oracle Bills of Material and Engineering Application Program Interface (APIs)
In this Document Goal Solution 1. Sample Notes for BOM APIs 2. Datatypes used in these APIs ...
- Oracle Inventory Management Application Program Interface ( APIs)
In this Document Goal Solution References APPLIES TO: Oracle Inventory Management - Version 12 ...
- Oracle Inventory Management Application Program Interface ( APIs) (Doc ID 729998.1)
In this Document Goal Solution References APPLIES TO: Oracle Inventory Management - Version 12.0.0 a ...
- 如何利用RMAN Debug和10046 Trace来诊断RMAN问题?
学习转摘:https://blogs.oracle.com/Database4CN/entry/%E5%A6%82%E4%BD%95%E5%88%A9%E7%94%A8rman_debug%E5%92 ...
- 如何利用RMAN Debug和10046 Trace来诊断RMAN问题?
在做Support的这些年,我很大的收获是掌握了许多troubleshooting问题的方法和工具,对于每一类问题,都可以大体归类出一些诊断方法.无论问题多么复杂,像扒洋葱一样,一层层去掉无 ...
随机推荐
- FJUT第四周寒假作业[JL]最后的晚餐(动态规划)
题目来源:http://210.34.193.66:8080/vj/Contest.jsp?cid=163#P4 [JL]最后的晚餐 TimeLimit:1000MS MemoryLimit:100 ...
- Java第5次实验提纲(Java图形界面编程)
1. Swing与NetBeans 使用NetBeans编写简单界面.见GUI实验参考文件中的0.第06次实验(图形程序设计.事件处理与Swing).doc 题目1: Swing用户界面组件与事件处理 ...
- ant编译mysql驱动
修改驱动源码后需要重新编译构建,由于mysql编译需要两个jdk版本且还需要hibernate4和junit,这里记录下. 安装ant. 配置两个jdk,5和8.并修改build.xml配置,如下: ...
- ThinkPHP 初探
准备 ThinkPHP下载 Eclipse-for-php 如何使用 放置位置 检验引用效果 效果 路由 调试之模板的使用 前提 生产模式 开发模式 添加完相应的路径以及模板文件后 总结 对国人开发的 ...
- Gazebo機器人仿真學習探索筆記(六)工具和实用程序
Gazebo附带了许多工具和实用程序. 这些教程说明了这些可用的工具,以及如何使用它们. 主要有: 1 记录和播放 2 日志过滤 3 应用力/扭矩 4 HDF5数据集 官网介绍通俗具体,非常容易,请参 ...
- Appium移动自动化测试(三)--安装Android模拟器(建议直接连手机,跳过此步)
转自虫师,亲测有效,留备后用. 本文中如果直接安装时不出现错误,则可以忽略(一.二.三.四.五),我安装的是5.1.1,直接成功,就是有点慢,要有耐心. 如果到最后一步,启动不起来,报错: emula ...
- Android Studio中Git的配置及协同开发
转载请标明出处: http://blog.csdn.net/xmxkf/article/details/51595096 本文出自:[openXu的博客] 目录: 一 Android Stutio配置 ...
- activiti实战系列 并行网关(parallelGateWay)
流程图 13.2:部署流程定义+启动流程实例 13.3:查询我的个人任务 13.4:完成我的个人任务 说明: 1) 一个流程中流程实例只有1个,执行对象有多个 2) 并行网关的功能是基于进入和外出的 ...
- Gazebo機器人仿真學習探索筆記(二)基本使用說明
在完成Gazebo7安裝後,需要熟悉Gazebo,方便之後使用. 部分源代碼可以參考:https://bitbucket.org/osrf/gazebo/src/ 如果還沒有安裝請參考之前內容完成安裝 ...
- x264源代码简单分析:x264命令行工具(x264.exe)
===================================================== H.264源代码分析文章列表: [编码 - x264] x264源代码简单分析:概述 x26 ...