Monday, March 9, 2026

PGA Memory Issue

 

🔴 Problem

Users complain that:

  • Queries are running very slowly

  • Some sessions are consuming very high memory

  • Server memory usage is extremely high

  • Database performance suddenly drops

During investigation, the DBA finds excessive PGA memory usage.

Sometimes errors like:

ORA-04036: PGA memory used by the instance exceeds PGA_AGGREGATE_LIMIT

📌 What is PGA

PGA (Program Global Area) is private memory allocated for each server process.

It is used for:

  • Sorting operations

  • Hash joins

  • Bitmap merge

  • Session memory

  • SQL work areas

Unlike SGA, PGA is not shared between sessions.


🔎 Investigation Steps

1️⃣ Check PGA parameters

show parameter pga;

Example output:

pga_aggregate_target = 2G
pga_aggregate_limit = 4G

2️⃣ Check PGA usage

SELECT name, value
FROM v$pgastat;

Important metrics:

  • total PGA allocated

  • maximum PGA allocated

  • cache hit percentage


3️⃣ Identify sessions consuming high PGA

SELECT
s.sid,
s.serial#,
p.pga_used_mem,
p.pga_alloc_mem
FROM v$session s, v$process p
WHERE s.paddr = p.addr
ORDER BY p.pga_used_mem DESC;

This shows which session is using the most PGA.


4️⃣ Check SQL causing large sorts

SELECT sql_id,
executions,
disk_reads,
buffer_gets
FROM v$sql
ORDER BY disk_reads DESC;

Large sorts or hash joins often consume high PGA.


🛠 Solution

Increase PGA target

ALTER SYSTEM SET pga_aggregate_target=4G SCOPE=BOTH;

If limit is too small:

ALTER SYSTEM SET pga_aggregate_limit=6G SCOPE=BOTH;

⚠️ Important DBA Checks

Before increasing PGA:

  • Verify server RAM availability

  • Identify runaway queries

  • Check parallel queries

  • Check large sorting operations

Example check:

SELECT *
FROM v$sql_workarea_active;

This shows active work areas consuming PGA.


📊 Root Cause (Real Production Case)

In one production system:

  • A reporting query ran with large ORDER BY and GROUP BY

  • Query processed millions of rows

  • Sort operation moved to disk

  • PGA usage increased rapidly

Application server: Oracle WebLogic Server


✅ Final Fix Implemented

1️⃣ Increased PGA

PGA_AGGREGATE_TARGET = 6G

2️⃣ Optimized query with indexes

3️⃣ Reduced unnecessary sorting

4️⃣ Limited parallel query usage


📘 Key Learning for Oracle DBAs

Always monitor:

  • v$pgastat

  • v$process

  • v$sql_workarea

  • v$sql_workarea_active

High PGA usage is usually caused by:

  • Large sorts

  • Hash joins

  • Parallel queries

  • Poorly optimized SQL

SGA Memory Issue in Oracle

 

🔴 Problem

A production database suddenly becomes very slow. Users report:

  • Application taking too long to respond

  • Queries that normally run in seconds taking minutes

  • High wait events in database

The DBA checks the alert log and finds memory-related errors like:

ORA-04031: unable to allocate bytes of shared memory

This error occurs in the SGA (System Global Area).


📌 What is SGA

SGA is the shared memory area used by Oracle to store:

  • Database buffer cache

  • Shared pool

  • Large pool

  • Java pool

  • Redo log buffer

If SGA components are not sized properly, Oracle cannot allocate memory.


🔎 Investigation Steps (DBA Approach)

1️⃣ Check SGA size

show parameter sga;

Example output:

sga_target = 4G
sga_max_size = 4G

2️⃣ Check shared pool usage

SELECT pool, name, bytes
FROM v$sgastat
WHERE pool='shared pool'
ORDER BY bytes DESC;

This helps identify memory allocation in the shared pool.


3️⃣ Check memory dynamic components

SELECT component,
current_size,
min_size,
max_size
FROM v$sga_dynamic_components;

4️⃣ Check for ORA-4031 details

SELECT *
FROM v$sgastat
WHERE name LIKE '%free memory%';

If free memory is very low, the shared pool is exhausted.


🛠 Solution

Increase Shared Pool Size

ALTER SYSTEM SET shared_pool_size=800M SCOPE=BOTH;

OR increase SGA target

ALTER SYSTEM SET sga_target=6G SCOPE=BOTH;

⚠️ Important Checks Before Increasing Memory

DBAs should verify:

  • Server RAM availability

  • Memory fragmentation

  • Hard parsing issues

  • Too many unique SQL statements

Check SQL parsing:

SELECT sql_text, executions
FROM v$sqlarea
ORDER BY executions DESC;

📊 Root Cause (Real Production Case)

In one production environment:

  • Application generated thousands of dynamic SQL queries

  • No bind variables used

  • Shared pool filled quickly

  • Result → ORA-04031 error

Application server involved: Apache Tomcat


✅ Final Fix Implemented

1️⃣ Increased SGA memory

SGA_TARGET = 8G

2️⃣ Increased shared pool

SHARED_POOL_SIZE = 1G

3️⃣ Developers implemented bind variables


📘 Key Learning for DBAs

Always monitor:

  • v$sga

  • v$sgastat

  • v$sga_dynamic_components

  • v$sqlarea

Never just increase memory without identifying the root cause.

Oracle Parameter Issue (OPEN_CURSORS)

 

Problem

A production application suddenly starts throwing errors like:

ORA-01000: maximum open cursors exceeded

Users report:

  • Application pages failing

  • Transactions not completing

  • Database sessions getting stuck

This issue is related to the Oracle Database initialization parameter OPEN_CURSORS.


📌 What is OPEN_CURSORS

OPEN_CURSORS defines the maximum number of cursors a session can have open simultaneously.

Default value in many systems:

OPEN_CURSORS = 300

In high-transaction applications this can be too low.


🔎 Investigation Steps (Real DBA Approach)

1️⃣ Check current parameter value

show parameter open_cursors;

Example result

NAME TYPE VALUE
-------------- ----------- -----
open_cursors integer 300

2️⃣ Identify sessions using many cursors

SELECT sid,
COUNT(*) "OPEN CURSORS"
FROM v$open_cursor
GROUP BY sid
ORDER BY 2 DESC;

This helps find sessions consuming too many cursors.


3️⃣ Check which SQLs are open

SELECT sid, sql_id, COUNT(*)
FROM v$open_cursor
GROUP BY sid, sql_id
ORDER BY 3 DESC;

Sometimes the issue is caused by application cursor leaks.


🛠 Solution

Increase the parameter value.

ALTER SYSTEM SET open_cursors=1000 SCOPE=BOTH;

Explanation:

  • SCOPE=BOTH updates

    • running instance

    • SPFILE parameter file

Verify again:

show parameter open_cursors;

⚠️ Important DBA Check

Before increasing the value, verify memory usage and application behavior.

Also check:

SELECT COUNT(*) FROM v$open_cursor;

If the application is not closing cursors, developers must fix the code.


📊 Root Cause (Real Production Case)

In one real project:

  • A Java application using Oracle WebLogic Server

  • JDBC connections were not closing cursors properly

  • Cursor count kept increasing

  • Database hit OPEN_CURSORS limit


✅ Final Fix Implemented

  1. Increased parameter

open_cursors = 1500
  1. Development team fixed cursor closing in code

  2. Monitored sessions for 48 hours.

System became stable.


📘 Key Learning for Oracle DBAs

Always check before changing parameters:

  • v$parameter

  • v$open_cursor

  • v$session

  • v$sql

Never increase parameters blindly.


Thursday, March 5, 2026

Top 10 Data Guard enhancements from 19c → 23ai → 26ai

 In Oracle AI Database 26ai, several enhancements have been introduced to improve Oracle Data Guard management, automation, and performance. Below are the key new features and improvements.


1. JSON Output for Data Guard Broker (DGMGRL)

Oracle 26ai introduces JSON-formatted output for the Data Guard Broker command-line tool (DGMGRL).

  • Makes Data Guard easier to integrate with automation tools, scripts, and DevOps pipelines.

  • Helps administrators parse and process configuration information programmatically.


2. Faster Switchover and Failover

Role transitions between primary and standby databases are significantly faster.

  • Switchovers and failovers can be up to 400% faster.

  • This improves Recovery Time Objective (RTO) and reduces downtime during disaster recovery operations.


3. Restrict Switchover and Failover Candidates

Oracle 26ai adds the ability to restrict which standby databases are eligible to become primary.

  • A new broker property allows DBAs to define a list of permitted promotion candidates.

  • This gives better control over failover behavior in complex Data Guard environments.


4. Improved PDB-Level Data Guard Management

Enhancements are made for multitenant environments (CDB/PDB).

  • Simplified setup and management for Data Guard protection of individual PDBs.

  • DBCA now supports creating and cloning PDBs in a Data Guard environment.

  • New DBMS_DG APIs are introduced to perform common Data Guard PDB operations.


5. SQLcl Support for Data Guard Broker

Oracle 26ai allows DBAs to run Data Guard broker commands directly from SQLcl.

  • Provides a lightweight, script-friendly alternative to traditional tools.

  • Simplifies command execution and automation workflows.


6. Better Active Data Guard DML Redirection

Active Data Guard performance is improved for DML redirection.

  • Inserts, updates, and deletes from standby environments are handled more efficiently.

  • Enables more realistic workloads on standby databases such as reporting, analytics, backups, and batch operations.


In summary, the major Data Guard improvements in Oracle 26ai focus on:

  • Automation and DevOps integration (JSON output, SQLcl support)

  • Faster switchover and failover

  • Better control over failover candidates

  • Enhanced PDB-level Data Guard management

  • Improved Active Data Guard workload handling


If you want, I can also explain “Top 10 Data Guard enhancements from 19c → 23ai → 26ai”, which is very useful for DBA interviews and upgrade discussions.

Top 10 Data Guard enhancements from 19c → 23ai → 26ai

Here are the Top 10 Oracle Data Guard enhancements from
Oracle Database 19cOracle Database 23aiOracle AI Database 26ai.
These versions gradually improved automation, performance, multitenant support, and cloud readiness.


Top 10 Data Guard Enhancements (19c → 23ai → 26ai)

1️⃣ Faster Switchover & Failover

  • 19c: Standard role transition performance.

  • 23ai: Improved automation with better broker handling.

  • 26ai: Up to 4x faster switchover/failover, reducing downtime and improving RTO. ⚡


2️⃣ Data Guard Broker Improvements

  • 19c: Stable broker with CLI management.

  • 23ai: Better broker validation and monitoring.

  • 26ai: JSON output support in DGMGRL for automation and DevOps pipelines.


3️⃣ SQLcl Support for Data Guard

  • 19c: Managed mainly using DGMGRL.

  • 23ai: Limited scripting improvements.

  • 26ai: Data Guard Broker commands supported in SQLcl, simplifying scripting and automation.


4️⃣ Active Data Guard DML Redirection

  • 19c: Read-only standby with limited DML redirection.

  • 23ai: Improved redirection performance.

  • 26ai: More efficient DML redirection, enabling reporting and workloads directly on standby. 📊


5️⃣ Multitenant (CDB/PDB) Data Guard Enhancements

  • 19c: Basic support for CDB-level Data Guard.

  • 23ai: Improved PDB management.

  • 26ai: Better PDB-level Data Guard management and APIs for automation.


6️⃣ Data Guard per-PDB Operations

  • 19c: Mostly CDB-level management.

  • 23ai: Initial PDB-level recovery improvements.

  • 26ai: Enhanced APIs (DBMS_DG) for PDB-level Data Guard operations.


7️⃣ Restricting Failover Candidates

  • 19c: Any standby could become primary.

  • 23ai: Limited control.

  • 26ai: DBAs can define which standby databases are allowed to become primary. 🔐


8️⃣ Improved Monitoring & Observability

  • 19c: Basic monitoring views.

  • 23ai: Better diagnostic views.

  • 26ai: Enhanced broker status reporting and automation-friendly outputs.


9️⃣ Cloud & Hybrid Integration

  • 19c: Designed mainly for on-premise environments.

  • 23ai: Better integration with Oracle Cloud.

  • 26ai: Cloud-native Data Guard architecture supporting hybrid and multi-region setups. ☁️


🔟 Automation & DevOps Integration

  • 19c: Mostly manual DBA-driven operations.

  • 23ai: Some scripting improvements.

  • 26ai: Strong focus on automation, APIs, JSON output, and scripting support.


Summary

VersionMajor Focus
19cStability and long-term support
23aiMultitenant and automation improvements
26aiAI-era database with faster recovery, automation, and cloud-native Data Guard

💡 Tip for DBAs / Interviews:
If asked about Data Guard evolution, the best short answer is:

“From 19c to 26ai, Oracle Data Guard evolved toward **automation, faster failover, multitenant PDB protection, and DevOps-friendly management with JSON and SQLcl support.”

Reference :- ChatGPT 

Key Focus Areas of Oracle AI Database 26ai

 Key Focus Areas of Oracle AI Database 26ai

Oracle AI Database 26ai represents a significant step toward transforming traditional databases into intelligent, AI-native platforms. The primary goal of Oracle 26ai is to integrate artificial intelligence capabilities directly into the database engine so that AI workloads can run alongside traditional data processing. By bringing AI closer to the data, organizations can reduce data movement, improve performance, and simplify application architectures.

Below are the key focus areas that define Oracle AI Database 26ai.

1. AI-Native Database Architecture

One of the most important aspects of Oracle 26ai is its AI-native database architecture. AI functionality is built directly into the core database engine rather than being added through external tools or services. This allows the database to handle AI operations more efficiently.

Oracle 26ai supports vector data types, embeddings, and similarity search, which are essential for modern AI applications. With these capabilities, AI models and large language model (LLM) workloads can operate directly where the data resides. This significantly reduces the need to move data to external AI platforms and helps improve both performance and security.

2. AI Vector Search

Another major focus area is native vector search. Vector search enables semantic and similarity-based queries, allowing users to search data based on meaning rather than exact keywords.

This feature is particularly useful for several modern AI use cases, including Retrieval-Augmented Generation (RAG), recommendation systems, semantic search, and fraud detection. By enabling databases to understand relationships and similarities in data, Oracle 26ai makes it easier to build intelligent applications powered by AI.

3. Unified Data Platform

Oracle 26ai also emphasizes a unified data platform that can manage multiple data types within a single database engine. Instead of relying on separate systems for different data formats, Oracle allows organizations to store and manage various types of data together.

These include relational data, JSON documents, graph data, spatial data, time-series data, and vector or AI data. This unified approach simplifies system architecture, reduces operational complexity, and eliminates the need for multiple specialized databases.

4. AI-Driven Performance and Automation

Performance optimization and automation are further enhanced in Oracle 26ai through AI-driven capabilities. The database uses intelligent algorithms to optimize SQL queries, automatically tune performance, and improve resource utilization.

Features such as self-learning query optimizers and automatic SQL rewriting help the system continuously improve its performance over time. This reduces the need for manual tuning by database administrators and allows organizations to maintain high performance with less operational effort.

5. Advanced Security and Quantum-Safe Encryption

Security remains a core focus of Oracle 26ai. The database includes advanced security features designed to protect sensitive data and prevent cyber threats.

One example is the SQL Firewall, which helps protect against SQL injection attacks by monitoring and controlling suspicious database queries. Additionally, Oracle is preparing for future security challenges by introducing quantum-resistant encryption algorithms, ensuring that data remains protected even as computing technologies evolve.

6. Cloud-Native and Distributed Database Capabilities

Oracle 26ai is designed with cloud environments in mind. It provides strong support for cloud-native deployments as well as hybrid and multi-cloud architectures.

The database also improves globally distributed database capabilities, enabling multi-region replication and high availability. These features ensure that applications can remain resilient, scalable, and accessible across different geographic locations.

Conclusion

Oracle AI Database 26ai marks a major shift in how databases support modern applications. By embedding AI directly into the database engine, Oracle enables organizations to process data, run AI models, and build intelligent applications on a single unified platform.

In summary, the main focus areas of Oracle 26ai include AI integration within the database, vector search for semantic AI workloads, unified data management, AI-driven automation and performance optimization, advanced security with quantum-safe encryption, and strong support for cloud-native distributed environments. These capabilities position Oracle 26ai as a powerful platform for the next generation of AI-powered data solutions.

Tuesday, February 10, 2026

Oracle Enterprise Manager (OEM) 13c – Core Components Explained

 Oracle Enterprise Manager (OEM) 13c is Oracle’s centralized monitoring and management framework used to manage databases, hosts, middleware, applications, and enterprise infrastructure from a single console.

Understanding the core components of OEM is essential for DBAs and system administrators to effectively deploy, monitor, and troubleshoot the environment.

OMS – Oracle Management Service

The Oracle Management Service (OMS) is a web-based application that acts as the brain of the OEM architecture.

OMS orchestrates communication with the Management Agents and plug-ins to discover targets, monitor and manage them, and store the collected information in a repository for future analysis.

  • Receives data from Management Agents
  • Coordinates monitoring activities
  • Processes alerts and incidents
  • Serves data to the OEM Console
  • Runs as WebLogic managed server

OMR – Oracle Management Repository

The Oracle Management Repository (OMR) is the central storage location where all monitoring data is stored.

It is a database schema that contains:

  • Database jobs
  • Packages and procedures
  • Views and tables
  • Historical performance data
  • Target configuration details

OMR is typically hosted on a dedicated Oracle Database (19c recommended) for better performance and stability.

Management Agent

The Management Agent is a lightweight software component installed on every host that needs to be monitored.

It converts an unmanaged host into a managed host within the OEM ecosystem.

  • Collects metrics from targets
  • Executes jobs and scripts
  • Communicates with OMS

Types of Management Agents

  • Central Agent: Installed automatically with OMS and used to monitor the OMS host itself.
  • Standalone Target Agent: Installed on remote hosts to monitor databases, applications, and servers.

Targets

Targets are the entities that can be monitored within an enterprise.

Managed targets include:

  • Hosts
  • Databases
  • Application servers
  • Applications
  • Listeners

BI Publisher

Oracle BI Publisher is the primary reporting tool used in OEM.

  • Highly formatted reports
  • Dashboards and summaries
  • Compliance and audit reports

Connectors

Connectors allow OEM to integrate with third-party tools.

They act as a mediator between OEM and external systems such as:

  • BMC Remedy
  • ServiceNow
  • Other ticketing systems

Connectors enable automatic ticket generation from OEM incidents.

JVMD Engine

The Java Virtual Machine Diagnostics (JVMD) Engine helps diagnose performance issues in Java applications.

  • Thread analysis
  • Memory usage
  • Garbage collection behavior

OEM Console

The OEM Console is the graphical user interface of the Enterprise Manager system.

It provides a single-pane-of-glass view for:

  • Monitoring all targets
  • Viewing alerts and incidents
  • Analyzing performance metrics
  • Managing jobs and patches

EMCLI

The Enterprise Manager Command Line Interface (EM CLI) enables automation and scripting.

emcli login -username=sysman
emcli login
emcli sync
emcli logout
emcli list_targets
emcli get_targets
emcli add_target
emcli get_supported_platforms
emcli create_job
emcli get_jobs
emcli get_blackout_details

EMCTL

EMCTL is used to control OMS and Management Agents.

emctl start oms
emctl stop oms
emctl start agent
emctl start agent
emctl stop agent
emctl stop agent
emctl status agent
emctl upload agent
emctl reload agent
emctl clearstate agent
emctl start blackout Blackout_name
emctl secure agent
emctl unsecure agent

Plug-ins

Plug-ins extend OEM capabilities to manage different technologies.

By default, OEM 13c includes:

  • Oracle Database
  • Oracle Fusion Middleware
  • Oracle Exadata
  • Oracle Cloud Framework
  • Oracle System Infrastructure

Additional plug-ins can be installed as required.

Without plug-ins, OEM cannot discover or manage specific target types.

Conclusion

Oracle Enterprise Manager 13c provides a powerful and modular architecture for enterprise monitoring. Each component plays a critical role in ensuring visibility, automation, and proactive management of IT systems.