Monday, January 31, 2022

How to search for a text from files in a directory on Linux

 find -type f -name "*.xml" -exec grep -l 'searchtext' {} +


Use the above command to find all files (in this case xnl) containing specific text 'searchtext' on Linux


Thursday, April 9, 2020

How to test read/write permissions on UTL directory (in UNIX) from database or backend


Below is the sample script which can be run from TOAD/SQL*PLUS to test the read write permissions on UTL directory from database or backend
DECLARE
  l_file utl_file.file_type;
BEGIN
  l_file := utl_file.fopen( 'DBA_UTL_DIR_NAME', 'test_file_name.txt', 'W' );
  utl_file.put_line( l_file, 'Here is sample text' );
  utl_file.fclose( l_file );
END;
  • Direcory name (DBA_UTL_DIR_NAME) should exists in DBA_DIRECTORIES table
  • Make sure that the UTL_FILE directory path exists in UNIX
select * from DBA_DIRECTORIES where directory_name = 'DBA_UTL_DIR_NAME'

Wednesday, February 12, 2020

About this Page Personalization Profile Option Values

Set the values of following profiles to enable Personalization Page link in OAF Pages

  • FND: Personalization Region Link Enabled    Yes
  • Personalize Self-Service Defn                    Yes
  • Disable Self-Service Personal                    No

Wednesday, May 15, 2019

Set FORMS_PATH in Oracle R12

When you face below errors while compiling the custom form:
identifier 'APP_WINDOW.CLOSE_FIRST_WINDOW' must be declared
Bad bind variable parameter.G_query_find

Run the below command to set the FORMS_PATH:
export FORMS_PATH=$AU_TOP/resource:$AU_TOP/forms/US:$AU_TOP/resource/US
Compile the form using the below command:
frmcmp_batch userid=apps/pwd module=$XX_TOP/forms/US/XXFORMfmb output_file=$XX_TOP/forms/US/XXFORM.fmx module_type=form batch=no compile_all=special

Thursday, February 7, 2019

Employee Supervisor Hierarchy Query Oracle R12

SELECT   e.*
      FROM (SELECT DISTINCT
      papf.employee_number,
                            papf.full_name "EMPLOYEE_FULL_NAME",
                            papf1.employee_number "SUPERVISOR_EMP_NUMBER",
                            papf1.full_name "SUPERVISOR_FULL_NAME",
       papf.person_id,
                            paaf.supervisor_id
                       FROM apps.per_all_people_f papf,
                            apps.per_all_assignments_f paaf,
                            apps.per_all_people_f papf1,
                            apps.per_person_types ppt
                      WHERE papf.person_id = paaf.person_id
                        AND papf1.person_id = paaf.supervisor_id
                        AND papf.business_group_id = paaf.business_group_id
                        AND TRUNC (SYSDATE) BETWEEN papf.effective_start_date
                                                AND papf.effective_end_date
                            AND TRUNC (SYSDATE) BETWEEN papf1.effective_start_date
                                                AND papf1.effective_end_date                     
                        AND TRUNC (SYSDATE) BETWEEN paaf.effective_start_date
                                                AND paaf.effective_end_date
                        AND ppt.person_type_id = papf.person_type_id
                        AND ppt.user_person_type <> 'Ex-employee') e
CONNECT BY PRIOR person_id = supervisor_id
START WITH person_id = :Person_id ; -- List the person id to know who all report under him like Manager id or person id of VP

Thursday, November 29, 2018

Query to find Concurrent Requests Ran count by Template/Layout Name for Each Month

SELECT user_concurrent_program_name program_name,
         xtt.template_name,
         hou.name operating_unit,
         TO_CHAR (actual_start_date, 'MON-YYYY') program_ran_month,
         --fu.user_name,
         --frt.responsibility_name,
         COUNT (1) COUNT
    FROM apps.fnd_concurrent_programs_tl fcpt,
         apps.fnd_concurrent_programs fcp,
         apps.fnd_concurrent_requests fcr,
         apps.fnd_user fu,
         apps.fnd_responsibility_tl frt,
         apps.hr_operating_units hou,
         apps.fnd_conc_pp_actions fcpa,
         apps.xdo_templates_b xtb,
         apps.xdo_templates_tl xtt
   WHERE     1 = 1
         AND fcp.concurrent_Program_id = fcpt.concurrent_program_id
         AND fcp.concurrent_program_id = fcr.concurrent_program_id(+)
         AND fu.user_id = fcr.requested_by
         AND frt.responsibility_id = fcr.RESPONSIBILITY_ID
         AND fcr.org_id = hou.organization_id
         AND fcr.request_id = fcpa.concurrent_request_id
         AND xtb.template_code = fcpa.ARGUMENT2
         AND xtb.template_code = xtt.template_code
         AND user_concurrent_program_name LIKE 'XX Conc Program Name%'
GROUP BY user_concurrent_program_name,
         hou.name,
         TO_CHAR (actual_start_date, 'MON-YYYY'),
         xtt.template_name
ORDER BY TO_DATE (TO_CHAR (actual_start_date, 'MON-YYYY'), 'MON-YYYY') DESC

Tuesday, July 24, 2018

Oracle R12 SQL Query for Supplier Addresses on the Address Book Suppliers Entry/Update Screen

SELECT DISTINCT pv.segment1 vendor_number,
                  pv.vendor_name,
                  hps.party_site_name address_name,
                  hou.name operating_unit,
                  hcp2.email_address,
                  DECODE (hps.status,  'A', 'Active',  'I', 'Inactive') status
    FROM apps.po_vendors pv,
         apps.po_vendor_sites_all pvsa,
         apps.hr_operating_units hou,
         apps.hz_contact_points hcp2,
         apps.hz_party_sites hps
   WHERE     1 = 1
         AND pv.vendor_id = pvsa.vendor_id
         AND pvsa.org_id = hou.organization_id
         AND hcp2.owner_table_id(+) = pvsa.party_site_id
         AND hcp2.contact_point_type(+) = 'EMAIL'
         AND hcp2.status(+) = 'A'
         AND hcp2.owner_table_name(+) = 'HZ_PARTY_SITES'
         AND pvsa.party_site_id = hps.party_site_id
         AND (pv.end_date_active IS NULL OR pv.end_date_active > SYSDATE)
ORDER BY pv.segment1

SQL Query to Find Oracle Web ADI Importer Package Procedure Name

 SELECT ba.attribute2     wed_adi_package_procedure_name   FROM apps.bne_attributes      ba,        apps.bne_param_lists_b   bplb,        ap...