Showing posts with label ORACLE DATABASE. Show all posts
Showing posts with label ORACLE DATABASE. Show all posts

Monday, May 25, 2026

Step-by-Step HugePages Configuration (Oracle 19c on Linux)

 

 Step-by-Step HugePages Configuration (Oracle 19c on Linux)


🔹 Step 1: Check Current HugePages Status

grep Huge /proc/meminfo

Key parameters:

  • HugePages_Total
  • HugePages_Free
  • Hugepagesize (usually 2 MB)

🔹 Step 2: Disable Transparent HugePages (THP)

Oracle recommends disabling THP.

Check status:

cat /sys/kernel/mm/transparent_hugepage/enabled

Disable temporarily:

echo never > /sys/kernel/mm/transparent_hugepage/enabled
echo never > /sys/kernel/mm/transparent_hugepage/defrag

Disable permanently:

Edit:

vi /etc/default/grub

Add:

transparent_hugepage=never

Then apply:

grub2-mkconfig -o /boot/grub2/grub.cfg
reboot

🔹 Step 3: Calculate Required HugePages

3.1 Check Oracle SGA size

From SQL:

show parameter sga_target;

or:

show parameter memory_target;


3.2 Use Oracle Script (Recommended)

$ORACLE_HOME/bin/hugepages_settings.sh

If not available, download from Oracle MOS.


3.3 Manual Calculation

Formula:

HugePages = Total_SGA_Size / HugePage_Size

Example:

  • SGA = 64 GB
  • Page size = 2 MB
64 * 1024 MB / 2 MB = 32768 HugePages

🔹 Step 4: Configure HugePages in Kernel

Edit:

vi /etc/sysctl.conf

Add/update:

vm.nr_hugepages=32768

Apply:

sysctl -p


🔹 Step 5: Configure memlock for Oracle User

Edit:

vi /etc/security/limits.conf

Add:

oracle soft memlock 67108864
oracle hard memlock 67108864

👉 Value should match SGA size (in KB)

Example:

64 GB = 67108864 KB

🔹 Step 6: Disable AMM (Very Important)

HugePages does NOT work with AMM.

Check:

show parameter memory_target;

If > 0, disable:

ALTER SYSTEM SET memory_target=0 SCOPE=SPFILE;
ALTER SYSTEM SET memory_max_target=0 SCOPE=SPFILE;

Instead, use ASMM:

ALTER SYSTEM SET sga_target=64G SCOPE=SPFILE;
ALTER SYSTEM SET pga_aggregate_target=8G SCOPE=SPFILE;

Restart DB:

shutdown immediate;
startup;

🔹 Step 7: Restart Server

reboot

🔹 Step 8: Validate HugePages Usage

grep Huge /proc/meminfo

Check:

  • HugePages_Total → should match configured value
  • HugePages_Free → should decrease after DB start
  • HugePages_Rsvd → reserved pages

🔹 Step 9: Verify Oracle is Using HugePages

grep -i huge /proc/meminfo

Also check alert log:

grep HugePages $ORACLE_BASE/diag/rdbms/*/*/trace/alert*.log

Expected message:

Huge Pages allocation successful

✅ Best Practices

✔ Always leave some RAM for OS (not 100% HugePages)
✔ Use static SGA (ASMM)
✔ Set HugePages slightly higher than requirement
✔ Monitor with:

vmstat
free -g

⚠️ Common Mistakes

❌ Using AMM (memory_target)
❌ Not setting memlock
❌ THP not disabled
❌ Underestimating number of HugePages


🚀 Quick Example Summary

For a 64 GB SGA:

SettingValue
HugePage size2 MB
Required pages32768
memlock67108864 KB
vm.nr_hugepages32768




Oracle Script for huge_page setting 

vi hugepages_settings.sh 


#!/bin/bash 
# hugepages_settings.sh 
# Linux bash script to compute values for the 
# recommended HugePages/HugeTLB configuration 
# on Oracle Linux 
# Note: This script does calculation for all shared memory 
# segments available when the script is run, no matter it 
# is an Oracle RDBMS shared memory segment or not. 
# This script is provided by KB151310 from My Oracle Support 
# http://support.oracle.com 

# Welcome text 
echo " 
This script is provided by KB151310 from My Oracle Support 
(http://support.oracle.com) where it is intended to compute values for 
the recommended HugePages/HugeTLB configuration for the current shared 
memory segments on Oracle Linux. Before proceeding with the execution please note following: 
 * For ASM instance, it needs to configure ASMM instead of AMM. 
 * The 'pga_aggregate_target' is outside the SGA and 
   you should accommodate this while calculating the overall size. 
 * In case you changes the DB SGA size, 
   as the new SGA will not fit in the previous HugePages configuration, 
   it had better disable the whole HugePages, 
   start the DB with new SGA size and run the script again. 
And make sure that: 
 * Oracle Database instance(s) are up and running 
 * Oracle Database Automatic Memory Management (AMM) is not setup 
   (See KB83222) 
 * The shared memory segments can be listed by command: 
     # ipcs -m 


Press Enter to proceed..." 

read 

# Check for the kernel version 
KERN=`uname -r | awk -F. '{ printf("%d.%d\n",$1,$2); }'` 

# Find out the HugePage size 
HPG_SZ=`grep Hugepagesize /proc/meminfo | awk '{print $2}'` 
if [ -z "$HPG_SZ" ];then 
    echo "The hugepages may not be supported in the system where the script is being executed." 
    exit 1 
fi 

# Initialize the counter 
NUM_PG=0 

# Cumulative number of pages required to handle the running shared memory segments 
for SEG_BYTES in `ipcs -m | cut -c44-300 | awk '{print $1}' | grep "[0-9][0-9]*"` 
do 
    MIN_PG=`echo "$SEG_BYTES/($HPG_SZ*1024)" | bc -q` 
    if [ $MIN_PG -gt 0 ]; then 
        NUM_PG=`echo "$NUM_PG+$MIN_PG+1" | bc -q` 
    fi 
done 

RES_BYTES=`echo "$NUM_PG * $HPG_SZ * 1024" | bc -q` 

# An SGA less than 100MB does not make sense 
# Bail out if that is the case 
if [ $RES_BYTES -lt 100000000 ]; then 
    echo "***********" 
    echo "** ERROR **" 
    echo "***********" 
    echo "Sorry! There are not enough total of shared memory segments allocated for 
HugePages configuration. HugePages can only be used for shared memory segments 
that you can list by command: 

    # ipcs -m 

of a size that can match an Oracle Database SGA. Please make sure that: 
 * Oracle Database instance is up and running 
 * Oracle Database Automatic Memory Management (AMM) is not configured" 
    exit 1 
fi 

# Finish with results 
    echo "Recommended setting: vm.nr_hugepages = $NUM_PG"; 

# End



Friday, April 24, 2026

Oracle Database Upgrade Matrix (Practical & Current)

 

Oracle Database Upgrade Matrix (Practical & Current)

1. Supported Direct Upgrade Paths (Official & Safe)

✅ = Supported
⚠️ = Supported but not recommended
❌ = Not supported

1.1 Core Upgrade Matrix

Source Version19c21c23ai26ai
11.2.0.4
12.1.0.2
12.2.0.1
18c
19c⚠️
21c⚠️
23ai✅*

* 23ai → 26ai is NOT a traditional upgrade; it is a release‑update transition.


2. Recommended Upgrade Paths (Real‑World Best Practice)

✅ Oracle‑Recommended Enterprise Path

11g / 12c / 18c
        ↓
      19c (Stabilize)
        ↓
      23ai (LTS, Foundation)
        ↓
      26ai (AI‑native)

Why This Path Works

  • 19c = last “classic” LTS, extremely stable
  • 23ai = first AI‑native LTS, introduces major SQL & engine changes
  • 26ai = continuation of 23ai with AI deeply embedded

3. What Is NOT Recommended (But Technically Possible)

PathWhy Not Recommended
19c → 21c → 23ai21c is innovation‑only
19c → 26ai directlySkips required AI foundation
12c → 23aiToo many dictionary + optimizer jumps
11g → 23aiUnsupported, high risk

4. Upgrade Method Matrix (How You Upgrade)

MethodWhen to UseVersions
AutoUpgradeDefault choice11g → 23ai
DBUASmall DBs only≤19c
Data PumpPlatform changeAny
GoldenGateZero‑downtime19c+
RU Transition23ai → 26ai

AutoUpgrade is mandatory for serious environments


5. CDB / PDB Requirement Matrix

VersionNon‑CDB AllowedCDB Mandatory
11g
12.1
12.2+⚠️
19c⚠️ (deprecated)✅ (recommended)
23ai
26ai

👉 23ai and beyond = CDB‑only strategy


6. RAC & Data Guard Compatibility Matrix

SourceTargetRACData Guard
19c → 23ai
23ai → 26ai
19c → 26ai

Standby must be upgraded in lockstep


7. Cloud vs On‑Prem Upgrade Rules

On‑Prem / Exadata

  • Full control
  • Two‑step upgrade mandatory
  • Longer stabilization windows

OCI / Autonomous

  • 23ai → 26ai often managed automatically
  • Version naming exposed later
  • AI features opt‑in

8. AI Feature Availability Matrix

Feature19c23ai26ai
Vector Data Type
AI Vector Search
Select AI (NL → SQL)
JSON Duality
AI Agents
RAG Pipelines⚠️

9. One‑Page Executive Upgrade Matrix (Slide‑Ready)

Legacy (11g/12c/18c)
        ↓
     Oracle 19c  ←– Stability Anchor
        ↓
     Oracle 23ai ←– AI Foundation (LTS)
        ↓
     Oracle 26ai ←– AI‑Native Platform

Key Rule:
👉 Never introduce AI features until 23ai is stable.


10. Common Interview / Review Question (With Correct Answer)

Q: Can we upgrade from Oracle 19c directly to 26ai?
Correct Answer:

No. Oracle 26ai is a continuation of the 23ai code line. Enterprises should upgrade 19c → 23ai first, stabilize, then transition to 26ai via release update.



 

Oracle Database Upgrade Matrix (Enterprise / LTS Focus)

 

Oracle Database Upgrade Matrix (Enterprise / LTS Focus)

1️⃣ Direct Upgrade Support Matrix

Legend
✅ Supported & recommended
⚠️ Supported but not recommended
❌ Not supported

Source → Target19c21c23ai26ai
11.2.0.4
12.1.0.2
12.2.0.1
18c
19c⚠️
21c⚠️
23ai✅*

* 23ai → 26ai is not a classic upgrade
It is a Release Update (RU) transition, same code line.


2️⃣ Recommended Enterprise Upgrade Paths (What Actually Works)

✅ Best‑Practice Path (Most Enterprises)

11g / 12c / 18c
        ↓
       19c    ← Stability Anchor (LTS)
        ↓
      23ai    ← AI Foundation (LTS)
        ↓
      26ai    ← AI‑Native Platform

✅ If Already on 19c

19c → 23ai → (RU) → 26ai

🚫 Not Recommended (Even If “Technically Possible”)

PathReason
19c → 26aiSkips AI foundation
12c → 23aiToo many dictionary jumps
19c → 21c → 23ai21c is innovation‑only
11g → 23aiUnsupported

3️⃣ AutoUpgrade Support Matrix (Execution‑Level)

SourceTargetAutoUpgradeNotes
11.2.0.419cMost common path
12.119cDirect supported
18c19cMinor effort
19c23aiPreferred method
23ai26aiRU, not AutoUpgrade

AutoUpgrade is mandatory for serious environments
(DBUA only for small/non‑critical DBs)


4️⃣ CDB / PDB Compatibility Matrix

VersionNon‑CDBCDB
11g
12.1
12.2 / 18c⚠️
19c⚠️ (deprecated)
23ai
26ai

👉 23ai and above = CDB‑only architecture


5️⃣ RAC & Data Guard Upgrade Compatibility

PathRACData Guard
18c → 19c
19c → 23ai
23ai → 26ai
19c → 26ai

✅ Standby must be upgraded in lockstep


6️⃣ Zero‑Downtime Upgrade Matrix (GoldenGate)

ScenarioRecommended Approach
19c → 23aiGoldenGate logical replication
23ai → 26aiNot required (RU change)
Platform changeGoldenGate
DB size > 10 TBGoldenGate

Typical flow:

19c (Prod)
 ↓ GG Replication
23ai (Target)
 ↓ Cutover

7️⃣ AI Feature Availability Matrix

Capability19c23ai26ai
VECTOR data type
AI Vector Search
JSON Relational Duality
Select AI (NL → SQL)
AI Agents
Built‑in RAG⚠️

AI features are optional, not mandatory


8️⃣ Executive One‑Slide Summary (Paste Directly)

Upgrade Rule of Thumb:

• 19c = Last Classic LTS
• 23ai = Mandatory AI Foundation
• 26ai = AI‑Native Platform

Never jump 19c → 26ai directly.
Always stabilize on 23ai first.

9️⃣ Interview / Architecture Review Ready Answer

Q: Why can’t we upgrade 19c directly to 26ai?
Correct Answer:

Oracle 26ai is a continuation of the 23ai code line delivered via release update. Enterprises must first upgrade to 23ai to establish SQL, optimizer, and AI foundations, then transition safely to 26ai.

Oracle Database – Detailed History

 

Oracle Database – Detailed History

1. Origins of Oracle Database (1977–1982)

The Relational Database Idea

  • The foundation of Oracle Database comes from Dr. Edgar F. Codd’s relational model (1970, IBM).
  • IBM published research but did not commercialize it immediately.

Oracle Corporation Formation

  • 1977: Larry Ellison, Bob Miner, and Ed Oates founded Software Development Laboratories (SDL).
  • Objective: build a commercial relational database, inspired by IBM’s System R paper.
  • Key difference: Oracle targeted multiple platforms, while IBM focused on mainframes.

2. Oracle Version 2 – First Commercial RDBMS (1979)

There was no Oracle Version 1 (marketing choice).

Key Highlights

  • Oracle V2 (1979) was the first commercially available SQL-based RDBMS.
  • Written in assembly language.
  • Ran on Digital VAX/VMS systems.
  • Supported basic SQL (SELECT, INSERT, UPDATE, DELETE).

Importance

✅ First mover advantage
✅ SQL as a public standard
✅ Database independent of hardware


3. Oracle Version 3 – Portability Revolution (1983)

Major Advancements

  • Rewritten entirely in C language.
  • Enabled platform portability (UNIX, VMS, later Windows).
  • Introduced the concept of Oracle being OS-independent.

Strategic Impact

✅ Oracle could run everywhere
✅ Faster customer adoption
✅ Differentiated sharply from IBM DB2


4. Oracle Version 4 & 5 – Client/Server Era Begins (1984–1987)

Oracle V4

  • Added basic transaction consistency
  • Improved data dictionary

Oracle V5

  • Introduced Client/Server architecture
  • SQL*Net allowed remote DB access
  • Enabled database connectivity over networks

5. Oracle Version 6 – Enterprise Scalability (1988)

Game-Changing Features

  • Row-level locking (vs table-level locking)
  • Online backups
  • Read consistency using rollback segments
  • First steps toward enterprise reliability

✅ Enabled high-concurrency OLTP systems
✅ Became viable for large enterprises


6. Oracle 7 – The Enterprise Database (1992)

Widely regarded as Oracle’s first truly mature enterprise database.

Major Innovations

  • Cost-Based Optimizer (CBO) introduced
  • Stored procedures
  • Triggers
  • Declarative referential integrity
  • Shared SQL area
  • Improved redo and recovery

Business Impact

✅ Massive enterprise adoption
✅ Oracle became dominant in banking, telecom, ERP systems


7. Oracle 8 & 8i – Object & Internet Age (1997–2000)

Oracle 8

  • Object-relational features
  • User-defined types
  • Partitioning introduced
  • Support for large objects (LOBs)

Oracle 8i (“Internet”)

  • Native Java inside the database
  • JVM running inside Oracle
  • XML support
  • Improved scalability for web applications

✅ Positioned Oracle as Internet-scale database


8. Oracle 9i – Grid Computing Foundations (2001)

Key Milestones

  • Real Application Clusters (RAC) reintroduced
  • Flashback Query
  • Data Guard (physical & logical standby)
  • Automatic undo management

Strategic Shift

  • Oracle introduced Grid Computing:

    “A pool of low-cost servers instead of big iron.”

✅ High availability
✅ Horizontal scalability


9. Oracle 10g – Grid Computing Matures (2003)

The “g” literally stood for Grid.

Major Additions

  • Automatic Storage Management (ASM)
  • AWR, ADDM
  • Automatic Memory Management
  • Data Pump (expdp/impdp)
  • Enterprise Manager Grid Control

✅ Reduced DBA manual effort
✅ Strong focus on manageability


10. Oracle 11g – Self-Managing Database (2007)

Among the most widely used Oracle versions ever.

Key Features

  • Adaptive Cursor Sharing
  • SecureFiles (advanced LOBs)
  • Active Data Guard
  • Result Cache
  • Improved partitioning
  • Edition-Based Redefinition

Sub-Release 11gR2

  • RAC improvements
  • SCAN listeners
  • Better scalability

✅ Extremely stable
✅ Long enterprise lifecycle


11. Oracle 12c – Cloud & Multitenancy (2013)

The “c” stands for Cloud.

Biggest Architectural Change Ever

Multitenant Architecture

  • CDB (Container Database)
  • PDB (Pluggable Databases)
  • Database consolidation at scale

Other Enhancements

  • Heat Map
  • Automatic Data Optimization (ADO)
  • In-Memory Column Store
  • JSON support

✅ Cloud-ready architecture
✅ License optimization via consolidation


12. Oracle 18c & 19c – Autonomous Direction (2018–2019)

Oracle 18c

  • Essentially 12.2 rebranded
  • Minor functional changes
  • Marked shift to continuous release model

Oracle 19c (Long-Term Support)

  • Most stable 12c-based release
  • Automatic Indexing
  • Hybrid Partitioned Tables
  • High adoption worldwide

✅ Widely accepted as production standard


13. Oracle 21c – Innovation Release (2021)

Key Features

  • Blockchain tables
  • Native JSON data type
  • SQL Macros
  • In-Memory enhancements

⚠️ Short-term innovation release
⚠️ Not widely used for mission-critical production


14. Oracle 23c / 23ai – Modern Data Platform (2023–Present)

Focus Areas

  • AI/ML integration
  • JSON-Relational Duality
  • Sharding improvements
  • Microservices-friendly architecture
  • Vector data support
  • Cloud-native optimization

Strategic Direction

  • Autonomous Database
  • Oracle Cloud Infrastructure (OCI) first
  • Database as a managed service

✅ Designed for AI-driven and cloud-native workloads


15. Oracle Database Today – Strategic Position

Key Strengths

  • Mission-critical OLTP
  • High availability (RAC, Data Guard, Autonomous)
  • Security & compliance
  • Extreme scalability

Challenges

  • Competition from:
    • PostgreSQL
    • MySQL
    • Cloud-native databases
  • Licensing complexity

16. Transition to the AI-Native Database Era

Oracle historically names database releases after major technology shifts:

ReleaseMeaning
9iInternet
10gGrid computing
12cCloud computing
23aiArtificial Intelligence
26aiAI‑native, agentic, multimodal data


17. Oracle Database 23ai (2024–Present)

Formerly Oracle Database 23c
Renamed to 23ai to reflect AI as a core capability, not an add-on

Release Classification

  • Long-Term Support (LTS) release
  • Premier Support until 2031
  • Successor to 19c in production roadmap


Summary Timeline

EraFocus
1979–1987Relational foundation
1988–1996Enterprise OLTP
1997–2003Internet & RAC
2004–2012Grid & automation
2013–2018Cloud & multitenant
2019–NowAutonomous, AI, cloud-native

Setup and design database architecture to meet SLA - 99.9 , 99.99 , 99.999

Achieving distinct Service Level Agreements (SLAs) for a database requires scaling redundancy and infrastructure complexity.  The three-nine...