Friday, September 25, 2026
  • About Us
  • Contact
DBAInsight
  • Guides
    • 23ai
    • RMAN
    • 26ai
    • Patch Update
    • RMAN
    • MySQL
    • Oracle GoldenGate
  • Cloud Technology
  • Case Studies
  • Troubleshooting
  • Training & Certification
NEWSLETTER
No Result
View All Result
DBAInsight
Home Troubleshooting

ORA-00018: Maximum Number of Sessions Exceeded — Complete Fix Guide

December 15, 2025
in Troubleshooting
0
ORA-00018: Maximum Number of Sessions Exceeded
0
SHARES
450
VIEWS

Managing sessions in Oracle is like managing seats in a bus: if all seats are taken, no new passenger can get in. Similarly, when your Oracle database hits its session limit, new connections are blocked, and you end up with one of the most common and frustrating Oracle errors:

ORA-00018: Maximum number of sessions exceeded

Table of Contents

Toggle
    • Related posts
    • When datapatch Won’t Finish: An ORA-04021 Lock on DBMS_AQADM_SYS During a 19c RU Apply
    • When “Invalid Objects” Isn’t What It Looks Like: A GSMADMIN_INTERNAL Detective Story
  • What ORA-00018 Really Means
  • Why Does ORA-00018 Occur? (Real-World Causes)
    • 1. Application not closing sessions
    • 2. processes and sessions parameters set too low
    • 3. Background processes consumed the total session count
    • 4. Connection pool misconfiguration
    • 5. Sudden traffic spike
    • 6. Idle session buildup
  • How to Diagnose ORA-00018 (Step-by-Step)
    • 1. Check current sessions
    • 2. Check session limit
    • 3. Check processes parameter
    • 4. Identify users with too many sessions
    • 5. Identify idle sessions
    • 6. View top programs causing session load
  • How to Fix ORA-00018 — Full Solutions
    • Solution 1: Increase SESSIONS and PROCESSES
    • Solution 2: Kill Idle or Hanging Sessions
    • Solution 3: Fix the Application Connection Pool
    • Solution 4: Reduce background process overload
    • Solution 5: Fix session leaking code (developer issue)
    • Solution 6: Temporary emergency fix
  • How to Prevent ORA-00018 in Production
    • ✔ Increase PROCESSES and SESSIONS to modern values
    • ✔ Enforce connection pool limits
    • ✔ Auto-kill idle sessions
    • ✔ Monitor with queries & alerts
    • ✔ Weekly DBA session audits
  • Final Thoughts
    • Related Articles

Related posts

ORA-04021

When datapatch Won’t Finish: An ORA-04021 Lock on DBMS_AQADM_SYS During a 19c RU Apply

September 25, 2026
GSMADMIN_INTERNAL

When “Invalid Objects” Isn’t What It Looks Like: A GSMADMIN_INTERNAL Detective Story

September 24, 2026

This error frequently appears in production systems, especially in high-traffic environments, unstable application servers, or when session management is poorly tuned. The good news? ORA-00018 is very easy to diagnose and fix once you know what’s causing it.

In this guide, we break down the error in plain English, show real reasons why it happens, and walk you through step-by-step solutions that DBAs use in live environments.


What ORA-00018 Really Means

Every Oracle database has limits such as:

  • Maximum number of processes (processes)
  • Maximum number of sessions (sessions)

A session is simply a connection to the database — from an app, script, API, SQL Developer, or the OS.

When the number of sessions reaches the configured maximum, Oracle stops allowing new connections. That’s when you see:

ORA-00018: Maximum number of sessions exceeded

It means:

  • All allowed sessions are used
  • New connections cannot be created
  • Some application users may experience downtime
  • Your database may already be under stress

Why Does ORA-00018 Occur? (Real-World Causes)

Here are the MOST common reasons this error appears:

1. Application not closing sessions

Apps may:

  • Open sessions but not close them
  • Leak connections
  • Create hundreds of idle sessions

2. processes and sessions parameters set too low

Default values in small systems:

processes = 150
sessions  = 248 (calculated automatically)

Modern apps need much more.

3. Background processes consumed the total session count

Oracle itself consumes sessions for:

  • JOB queues
  • Data Guard
  • MMON / SMON / PMON
  • AQ processes

4. Connection pool misconfiguration

Common in:

  • WebLogic
  • Tomcat
  • OAS
  • Microservices

They aggressively open connections without releasing them.

5. Sudden traffic spike

Peak hours or batch jobs can overload the system.

6. Idle session buildup

Developers leave SQL Developer open overnight — and those sessions accumulate.


How to Diagnose ORA-00018 (Step-by-Step)

1. Check current sessions

SELECT COUNT(*) FROM v$session;

2. Check session limit

SHOW PARAMETER sessions;

3. Check processes parameter

SHOW PARAMETER processes;

4. Identify users with too many sessions

SELECT username, COUNT(*)
FROM v$session
GROUP BY username
ORDER BY 2 DESC;

5. Identify idle sessions

SELECT sid, serial#, username, status
FROM v$session
WHERE status = 'INACTIVE';

6. View top programs causing session load

SELECT program, COUNT(*)
FROM v$session
GROUP BY program
ORDER BY 2 DESC;

How to Fix ORA-00018 — Full Solutions

Solution 1: Increase SESSIONS and PROCESSES

The most common fix is to increase:

If you are planning to increase “sessions” parameter you should also plan to increase “processes and “transactions” parameters.

Processes=x
Sessions=x1.1+5
Transactions=sessions1.1

ALTER SYSTEM SET processes = 500 SCOPE=SPFILE;
ALTER SYSTEM SET sessions = 800 SCOPE=SPFILE;

NOTE:
You must restart the database for these changes to take effect.

Restart:

SHUTDOWN IMMEDIATE;
STARTUP;

Solution 2: Kill Idle or Hanging Sessions

Find sessions:

SELECT sid, serial#, username
FROM v$session
WHERE status='INACTIVE';

Kill session:

ALTER SYSTEM KILL SESSION 'sid,serial#' IMMEDIATE;

Solution 3: Fix the Application Connection Pool

Often the REAL fix is on the application side.

Checklist:

  • Reduce max pool size
  • Enable connection timeout
  • Force idle connection cleanup
  • Implement proper session release

WebLogic example:

  • Max capacity: Reduce from 200 → 60
  • Shrink frequency: 15 minutes
  • Test on reserve: Enabled

Solution 4: Reduce background process overload

Too many jobs or AQ processes? Check:

SELECT * FROM dba_scheduler_jobs;

Disable unused jobs:

BEGIN
  DBMS_SCHEDULER.DISABLE('JOB_NAME');
END;
/

Solution 5: Fix session leaking code (developer issue)

Common mistakes:

❌ Opening session inside loop
❌ Not closing session on exceptions
❌ Poor JDBC pool implementation

Best practice:

try {
  Connection conn = datasource.getConnection();
  ...
} finally {
  conn.close();
}

Solution 6: Temporary emergency fix

If you’re locked out, use sysdba locally:

sqlplus / as sysdba

Kill old sessions:

SELECT sid, serial# FROM v$session WHERE username IS NOT NULL;

Then kill:

ALTER SYSTEM KILL SESSION 'sid,serial#' IMMEDIATE;

This gives temporary breathing room.


How to Prevent ORA-00018 in Production

Here are the best practices every DBA should follow:

✔ Increase PROCESSES and SESSIONS to modern values

Example recommended baseline:

processes = 1000
sessions  = 1500

✔ Enforce connection pool limits

Never allow unlimited connections.

✔ Auto-kill idle sessions

Many companies set:

IDLE_TIME = 30

✔ Monitor with queries & alerts

Tools like:

  • OEM Cloud Control
  • Grafana
  • Prometheus
  • Dynatrace

✔ Weekly DBA session audits

Especially for critical apps.


Final Thoughts

The ORA-00018: Maximum Number of Sessions Exceeded error indicates your Oracle database has reached its connection limits. While the error seems severe, the solutions are straightforward once you identify the cause.

Whether it’s:

  • increasing session limits,
  • fixing app-side leaks,
  • tuning connection pools, or
  • clearing idle sessions,

you now have all the tools to resolve ORA-00018 cleanly and prevent it from coming back.


Related Articles

  • ORA-04063 and ORA-00904 on “SYS.DBA_REGISTRY” Has Errors
  • ORA-04031: Unable to Allocate Shared Memory – Causes, Fixes, and Prevention (Oracle DBA Guide)
  • Fixing the “Error in invoking target ‘agent nmhs’ of makefile ins_emagent.mk” During Oracle 11.2.0.4 Installation on Linux
Tags: Maximum number of sessions exceededORA-00018Oracle session limit error
Previous Post

ORA-12514: TNS Listener Does Not Currently Know of Service Requested — Full Fix Guide

Next Post

ORA-01882: Timezone Region Not Found (ORA-02063 from DB Link) — Complete Fix Guide

Next Post
ORA-01882: Timezone Region Not Found

ORA-01882: Timezone Region Not Found (ORA-02063 from DB Link) — Complete Fix Guide

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

POPULAR NEWS

  • Oracle Patch 38632161: Step-by-Step Guide to Upgrade Oracle 19c to Release Update 19.30

    Oracle Patch 38632161: Step-by-Step Guide to Upgrade Oracle 19c to Release Update 19.30

    0 shares
    Share 0 Tweet 0
  • How To Download And Install The Latest OPatch

    0 shares
    Share 0 Tweet 0
  • How to Install Oracle 19c Database on Red Hat Enterprise Linux 9

    0 shares
    Share 0 Tweet 0
  • Oracle Database 19.32 Release Update (RU) Patching Guide – Patch 39472050

    0 shares
    Share 0 Tweet 0
  • Installing Oracle Database 26AI on Red Hat Enterprise Linux 9

    0 shares
    Share 0 Tweet 0
  • About Us
  • Contact

© 2026 DBAInsight - Smarter Databases. Sharper Insights. DBAInsight.

No Result
View All Result
  • Home
  • Cloud & Modern DBs
  • Guides
  • Cloud Technology
  • Case Studies
  • Troubleshooting
  • Training & Certification

© 2026 DBAInsight - Smarter Databases. Sharper Insights. DBAInsight.

Add as a preferred source on Google
Add as preferred source on Google