Wednesday, August 28, 2019
Query to view contents of Concurrent Request log and output files in Oracle Apps R12
In this post, we have given a
script which can view the concurrent request log and output files from
database. In this case, we create a function, which will read the file and
return the data in the format of CLOB with basic validations.
DB Diectories:
CREATE OR REPLACE DIRECTORY XX_CONCURRENT_PROGRAM_LOGAS '<concurrent_request_log_dir>'CREATE OR REPLACE DIRECTORY XX_CONCURRENT_PROGRAM_OPAS '<concurrent_request_output_dir>'
Function:
create or replace FUNCTION xx_get_conc_details(piv_file_type IN VARCHAR2,pin_request_id IN NUMBER)RETURN CLOBISlv_dir VARCHAR2(100);lv_file VARCHAR2(100);lc_return CLOB;lv_log_filename VARCHAR2(1000);lv_out_filename VARCHAR2(1000);ln_log_file_size NUMBER;ln_out_file_size NUMBER;BEGINSELECT logfile_name,outfile_name,lfile_size,ofile_sizeINTO lv_log_filename,lv_out_filename,ln_log_file_size,ln_out_file_sizeFROM fnd_concurrent_requestsWHERE request_id = pin_request_id;IF piv_file_type = 'LOG' AND ln_log_file_size = 0THENRETURN 'Log File is 0KB in size';ELSIF piv_file_type = 'OUTPUT' AND ln_out_file_size = 0THENRETURN 'Output File is 0KB in size';ELSIF piv_file_type = 'LOG'THENlv_dir := 'XX_CONCURRENT_PROGRAM_LOG';lv_file := SUBSTR(lv_log_filename,INSTR(lv_log_filename,'/',-1)+1);ELSIF piv_file_type = 'OUTPUT'THENlv_dir := 'XX_CONCURRENT_PROGRAM_OP';lv_file := SUBSTR(lv_out_filename,INSTR(lv_out_filename,'/',-1)+1);ELSERETURN ('INVALID FILE TYPE. IT SHOULD BE LOG OR OUTPUT.');END IF;RETURN DBMS_XSLPROCESSOR.READ2CLOB(lv_dir,lv_file);EXCEPTIONWHEN NO_DATA_FOUND THENRETURN 'Given Request does not exists in FND_CONCURRENT_REQUESTS table';END xxif_get_conc_details;
Query:
selectXX_GET_CONC_DETAILS('LOG','98680') LOG_FILE,XX_GET_CONC_DETAILS('OUTPUT','98680') OUTPUT_FILEfrom DUAL;
Hope it helps!!
Do you think this Article is useful?
Subscribe to:
Post Comments (Atom)
Disclaimer
The ideas, thoughts and concepts expressed here are my own. They, in no way reflect those of my employer or any other organization/client that I am associated. The articles presented doesn't imply to any particular organization or client and are meant only for knowledge Sharing purpose. The articles can't be reproduced or copied without the Owner's knowledge or permission.
0 Responses to “Query to view contents of Concurrent Request log and output files in Oracle Apps R12”
Post a Comment