Skip to main content

Oracle APEX Useful Queries Every Developer Should Know

 

 Introduction

In real-world Oracle APEX applications, developers often face challenges diagnosing performance issues, auditing components, and monitoring activity.

Oracle APEX provides a rich set of internal views that can help diagnose, monitor, and optimize applications. This guide transforms commonly used queries into practical, real-world solutions with insights and best practices.

1) Identify Slow Pages

Problem

Users report that some pages are slow, but it's unclear which ones are causing performance issues.

Solution

SELECT APPLICATION_ID,

       PAGE_ID,

       COUNT(*)                        AS EXECUTIONS,

       ROUND(AVG(ELAPSED_TIME), 2)     AS AVG_SECONDS,

       ROUND(MAX(ELAPSED_TIME), 2)     AS MAX_SECONDS

FROM   APEX_WORKSPACE_ACTIVITY_LOG

WHERE  VIEW_DATE >= SYSDATE - 30

GROUP BY APPLICATION_ID, PAGE_ID

ORDER BY AVG_SECONDS DESC

FETCH FIRST 20 ROWS ONLY;

2) Application & Workspace Info

 APEX applications in workspace

SELECT APPLICATION_ID,

       APPLICATION_NAME,

       ALIAS,

       LAST_UPDATED_ON,

       LAST_UPDATED_BY,

       VERSION

FROM   APEX_APPLICATIONS

ORDER BY APPLICATION_ID;

  APEX version installed

SELECT VERSION_NO,

       API_COMPATIBILITY,

       PATCH_APPLIED

FROM   APEX_RELEASE;

 All workspaces Detail

SELECT WORKSPACE_ID,

       WORKSPACE,

       WORKSPACE_DISPLAY_NAME

FROM   APEX_WORKSPACES;

3)   Pages & Components

All Pages in an Application

Note : Get App_id from query APEX applications in workspace in our example we use app_id =102

SELECT PAGE_ID,

       PAGE_NAME,

       PAGE_ALIAS,

       PAGE_MODE,

       AUTHORIZATION_SCHEME,

       LAST_UPDATED_BY,

       LAST_UPDATED_ON

FROM   APEX_APPLICATION_PAGES

WHERE  APPLICATION_ID =:APP_ID

ORDER BY PAGE_ID;


All Interactive Reports in an Application

Note : Get App_id from query APEX applications in workspace in our example we use app_id =102

SELECT PAGE_ID,

       REGION_NAME,

       SQL_QUERY

FROM   APEX_APPLICATION_PAGE_IR

WHERE  APPLICATION_ID = :APP_ID;

 

 All page items (fields/inputs)

Note : Get App_id from query APEX applications in workspace in our example we use app_id =102

 SELECT PAGE_ID,

       ITEM_NAME,

       DISPLAY_AS,

       ITEM_DEFAULT

FROM   APEX_APPLICATION_PAGE_ITEMS

WHERE  APPLICATION_ID = :APP_ID

ORDER BY PAGE_ID, ITEM_NAME;

4) Activity Monitoring

Most Visited Pages (Last 20 Days)

SELECT APPLICATION_ID,

       PAGE_ID,

       COUNT(*)        AS HITS,

       MAX(VIEW_DATE)  AS LAST_VISITED

FROM   APEX_WORKSPACE_ACTIVITY_LOG

WHERE  VIEW_DATE >= SYSDATE - 20

GROUP BY APPLICATION_ID, PAGE_ID

ORDER BY HITS DESC

FETCH FIRST 20 ROWS ONLY;

5) Page Validations 

 Note : Get App_id from query APEX applications in workspace in our example we use app_id =102

  All validations

SELECT PAGE_ID,

       VALIDATION_NAME,

       VALIDATION_TYPE,

       VALIDATION_EXPRESSION1,

       ERROR_MESSAGE

FROM   APEX_APPLICATION_PAGE_VAL

WHERE  APPLICATION_ID = :APP_ID

ORDER BY PAGE_ID;

 6) List of Values (LOVs)

Note : Get App_id from query APEX applications in workspace in our example we use app_id =102

All LOVs in an application

SELECT LIST_OF_VALUES_NAME,

       LIST_OF_VALUES_QUERY,

       SOURCE_TYPE

FROM   APEX_APPLICATION_LOVS

WHERE  APPLICATION_ID = :APP_ID

ORDER BY LIST_OF_VALUES_NAME;

Conclusion

 Oracle APEX's internal views unlock a level of visibility that most developers need. Whether you're diagnosing slow page renders, auditing session state, or tracking workspace activity, these views give you direct access to the data APEX itself relies on.

                      

 







Comments

Popular posts from this blog

Oracle EBS R12 General Ledger (GL) Module – Practical SQL Queries

Introduction Oracle E-Business Suite (EBS) R12 General Ledger (GL) is the core Financial module in Oracle EBS R12. It is used to manage journal entries, accounting periods, balances, and financial reporting. The GL module integrates with Payables (AP), Receivables (AR), Fixed Assets (FA), Purchasing (PO), and Inventory (INV). The main purpose of a general ledger system is to record financial activity of a company and to produce financial and management reports to help the organization make decisions. Below are real-world SQL queries commonly used.   1) View configured Ledgers      Purpose: Fetch Ledger Configuration Details SELECT       ledger_id,      name  AS   ledger_name ,    short_name ,   currency_code FROM     gl_ledgers ORDER BY     ledger_id ;   2) Ledger Information Query Purpose: Fetch Ledger Configuration Details SELECT     gl.name   ...

Exploring AI in Oracle APEX 26.1

Artificial Intelligence (AI) is transforming the way organizations and developers work. Businesses and professionals are increasingly adopting AI tools to improve productivity, automate processes, and build smarter applications. Oracle APEX introduces a significant evolution in application development by integrating governed Generative AI capabilities directly into the low-code platform. This enables developers to build intelligent, conversational applications while maintaining enterprise-grade security and control. In this article we explore AI capabilities in Oracle APEX 26.1 What is AI Agents AI Agents can be created to reason over user requests and take actions through approved AI Tools. Each tool exposes a specific application capability the agent is allowed to invoke, such as retrieving data, running server-side PL/SQL, or executing client-side JavaScript. APEX manages the execution flow by preparing context, dispatching tool calls, executing tools, handling results, and...

Oracle R12 Inventory Configuration: Key points to Avoid Mistakes

Most Oracle ERP R12 inventory problems are not system failures they are process and configuration failures. The same categories of mistakes surface repeatedly across implementations: Focusing on master data control, disciplined transactions, proper OU setup, and strong internal controls prevents operational and financial discrepancies.   This article walks through the four most critical areas where Oracle R12 inventory implementations go wrong, explains why each mistake is costly, and provides recommendations to prevent them. Each section includes the relevant navigation path and configuration screenshots for hands-on reference   1.       Improper Item Master Configuration in Oracle R12   Oracle E‑Business Suite R12 , the Item Master Configuration serves as the foundation of the Inventory module. Two critical components under this configuration umbrella are: Define Master Item Setup Define Item Status Both setups control how items ...