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问题的方法和工具,对于每一类问题,都可以大体归类出一些诊断方法.无论问题多么复杂,像扒洋葱一样,一层层去掉无 ...
随机推荐
- R语言使用 multicore 包进行并行计算
R语言是单线程的,如果数据量比较大的情况下最好用并行计算来处理数据,这样会获得运行速度倍数的提升.这里介绍一个基于Unix系统的并行程序包:multicore. 我们用三种不同的方式来进行一个简单的数 ...
- Spring完全基于Java配置和集成Junit单元测试
要点: 配置继承WebApplicationInitializer的类作为启动类,相当于配置web.xml文件 使用@Configuration注解一个类,在类中的方式使用@Bean注解,则表名该方法 ...
- CSDN博客投票活动开始了
自己坚持写博客,一方面是为了将自己对知识点的理解做一个总结,另一方面也是因为自己看到了很多无私奉献分享自己知识的小伙伴们,因此自己也想像他们那样尽自己微薄之力把自己对某一知识点的理解分享给大家,或许算 ...
- Linux 中交换空间 (swap)应该分多大才好?
前一段时间,我们机房中一台Linux服务器运行缓慢,系统服务出现间歇性停止响应,让我过去处理一下这一问题,登录到服务器之后,发现此服务器的物理内存是16G,而最初装机的时候,系统管理人员却只分配了4G ...
- rbac 概念
1 权限管理 1.1 什么是权限管理 分享牛原创,分享牛系列.基本上涉及到用户参与的系统都要进行权限管理,权限管理属于系统安全的范畴,权限管理实现对用户访问系统的控制,按照安全规则或者安全策略控制用户 ...
- ROS机器人程序设计(原书第2版)补充资料 (壹) 第一章 ROS系统入门
ROS机器人程序设计(原书第2版)补充资料 (壹) 第一章 ROS系统入门 书中,大部分出现hydro的地方,直接替换为indigo或jade或kinetic,即可在对应版本中使用. 第一章主要包括R ...
- EBS销售订单挑库发放处理程序
来自:http://blog.csdn.net/cunxiyuan108/article/details/6014769 在EBS实施中,经常遇到从外部传进来一个被登记的销售订单,需要通过程序进行销售 ...
- RxJava操作符(02-创建操作)
转载请标明出处: http://blog.csdn.net/xmxkf/article/details/51645348 本文出自:[openXu的博客] 目录: Create Defer Empty ...
- activiti实战系列 排他网关(ExclusiveGateWay)
流程图 12.2:部署流程定义+启动流程实例 12.3:查询我的个人任务 12.4:完成我的个人任务 说明: 1) 一个排他网关对应一个以上的顺序流 2) 由排他网关流出的顺序流都有个 ...
- Findbug在项目中的运用--提高代码质量
FindBugs是一个静态分析工具,它检查类或者 JAR文件,将字节码与一组缺陷模式进行对比以发现可能的问题.有了静态分析工具,就可以在不实际运行程序的情况对软件进行分析 第一 手动安装 在Ec ...