SQL Queries

How to Find underscore_parameters in a database during Audit process

Impact: Unknown underscore parameters without proper advice from metalink, would impact the database. Solution: We need to ensure that we have proper advises from Oracle Support on those underscore parameters…

Read More

Script to Find Apex Page hits

Below script is for finding the Apex page hits ********************************************************************************************************** /home/oracle/backup/scripts/pagehits.sh . /home/oracle/db.env export SC_LOG=/Backup/pagehits/fms_`date +%d_%b_%H_%M_%Y`.log sqlplus -s <<EOF >>/usr/tmp/tmp1.log connect /as sysdba spool \$SC_LOG select flow_id,step_id,count(*) from FLOWS_030100.WWV_FLOW_ACTIVITY_LOG where…

Read More

Script to Find Apex Page Time

Below script is for finding the Apex Page Time ********************************************************************************************************** /home/oracle/backup/scripts/pagetime.sh . /home/oracle/db.env export SC_LOG=/Backup/pagetime/fms_`date +%d_%b_%Y_%H_%M`.log sqlplus -s <<EOF >>/usr/tmp/tmp2.log connect /as sysdba spool \$SC_LOG select flow_id,step_id,sum(elap)/count(*) “Average” from FLOWS_030100.WWV_FLOW_ACTIVITY_LOG…

Read More

Script to move files to FTP server

We can use the below script for moving files (like export dumps/RMAN backups) to FTP server for safety purpose. ******************************************************************************************************************** cat /TESTDB/app/bkp_scripts/test_sunday_to_ftp.sh . /home/oracle/test.env USERNAME=”—-Enter your username here—-” PASSWORD=”—-Enter your…

Read More

Query to get HCM Extract Input Values in BI Report

Introduction This Post Provides the SQL Query that returns HCM Extract Input Values in BI Report   Query SELECT TO_DATE (par_val.flow_param_value, ‘YYYY-MM-DD’) FROM pay_flow_instances flow, pay_flow_parameters flw_par, pay_flow_param_values par_val WHERE…

Read More

Employee’s Supervisor Details Query

Introduction This Post Provides the SQL Query that returns Employee’s Supervisor Details   Query SELECT papf.person_number employee_number, ppnf.full_name employee_name, papf_s.person_number manager_emp_number, ppnf_s.full_name manager_name FROM per_all_people_f papf, per_person_names_f ppnf, per_all_assignments_m paam,…

Read More

Getting HCM Extract Input Values in Fast Formula

Introduction This Post Provides the Detail to get HCM Extract Input Values in Fast Formula   Sample Fast Formula PERSON_NUMBER_PARAM = GET_PARAMETER_VALUE(‘PERSON_NUMBER’) CHANGES_ONLY_PARAM = GET_PARAMETER_VALUE(‘CHANGES_ONLY’) EFFECTIVE_DATE_PARAM = GET_PARAMETER_VALUE(‘EFFECTIVE_DATE’) L_VALUE =…

Read More

Query to get Last Run Parameter Value in BI Report

Introduction This Post Provides the SQL Query to get Last Run Parameter Value in BI Report   Query SELECT TO_DATE (SUBSTR (rpj.VALUE, INSTR (rpj.VALUE, ‘”}’) – 10, 10), ‘MM-DD-YYYY’) eff_date…

Read More

Employee Assignment Details Query

Introduction This Post Provides the SQL Query that returns the Assignment Details of the Employees   Query SELECT peo.person_number employee_number, loc.internal_location_code location_code, loc.location_name LOCATION, per_name.last_name, per_name.first_name, per_name.middle_names middle_name, pa.address_line_1, pa.address_line_2,…

Read More

Query to Fetch Invoice details, HSN Code, Third party Registration number and GST Details.

The below query fetches the details of an Invoice along with the HSN Code of  a respective item present in an Invoice. GST details can also be fetched. SELECT a.org_id,a.customer_trx_id,a.trx_number…

Read More