4.10.26

How to Fix ORA-65114: Space Usage in Container Is Too High (Oracle 19c & 23ai Multi-Tenant)

When managing Oracle Multitenant databases on on-premises ODA (Oracle Database Appliance), Exadata, or Cloud infrastructure (OCI / AWS RDS / Azure), encountering ORA-65114: space usage in container is too high can bring critical pluggable database (PDB) operations to a sudden halt.

This error occurs when a Pluggable Database (PDB) exceeds its allocated storage quota defined by the MAX_PDB_STORAGEparameter or runs out of allocated MAX_SHARED_TEMP_SIZE space.

Below is the complete, production-tested DBA step-by-step resolution playbook to diagnose and resolve ORA-65114without downtime.

1. Quick Root Cause Identification

When ORA-65114 triggers, Oracle blocks any CREATE TABLESPACE, datafile auto-extend, or temporary space allocation inside the target PDB.

First, connect to your CDB or target PDB via SQL*Plus or SQLcl and run the following diagnostic script:

SQL
-- Connect to the target PDB or check from CDB$ROOT
ALTER SESSION SET CONTAINER = your_pdb_name;

-- Check current PDB storage limits vs actual size
SELECT 
    name AS pdb_name,
    open_mode,
    total_size/1024/1024 AS current_size_mb,
    max_size/1024/1024 AS max_size_mb
FROM v$pdbs;

If current_size_mb has reached or surpassed max_size_mb, the container limit has been hit.

2. Step-by-Step Resolution Methods

Method 1: Increase the Container MAXSIZE Limit (Recommended)

The fastest fix for production environments running out of allocated container ceiling space is to adjust the PDB storage attribute:

SQL
-- Connect to CDB$ROOT or directly to the PDB with SYSDBA / PDB_ADMIN privileges
ALTER SESSION SET CONTAINER = your_pdb_name;

-- Increase storage ceiling to 100 Gigabytes
ALTER PLUGGABLE DATABASE STORAGE (MAXSIZE 100G);

-- Alternatively, set to UNLIMITED if storage is governed at the ASM/DG level
ALTER PLUGGABLE DATABASE STORAGE UNLIMITED;

Method 2: Adjust Shared Temporary Space Limits

If the error occurs during heavy batch processing or sorting, the issue may stem from temporary tablespace caps:

SQL
-- Set both MAXSIZE and SHARED TEMP limits concurrently
ALTER PLUGGABLE DATABASE STORAGE (MAXSIZE 200G MAX_SHARED_TEMP_SIZE 20G);

Method 3: Identify & Reclaim Wasted PDB Storage

If hardware or cloud storage limits prevent expanding the container size, reclaim unallocated space inside the PDB:

SQL
-- Find top space-consuming segments inside the PDB
SELECT owner, segment_name, segment_type, bytes/1024/1024 AS size_mb 
FROM dba_segments 
WHERE bytes > 100*1024*1024 
ORDER BY bytes DESC 
FETCH FIRST 10 ROWS ONLY;
  • Execute ALTER TABLE <table_name> SHRINK SPACE; on tables with high high-water marks.

  • Purge recycled objects: PURGE TABLESPACE <tablespace_name>;

3. Automation Script: Prevent ORA-65114 Alerts

Add this Bash / Shell monitoring snippet to your cron jobs or enterprise OEM monitoring scripts to trigger an alert before the PDB hits 90% of its MAX_PDB_STORAGE:

Bash
#!/bin/bash
# PDB Storage Threshold Monitor
ORACLE_SID=your_cdb_sid
export ORACLE_SID

sqlplus -s / as sysdba << 'EOF'
SET HEADINGS OFF FEEDBACK OFF PAGESIZE 0
SELECT name || ' is at ' || ROUND((total_size/NULLIF(max_size,0))*100,2) || '% capacity'
FROM v$pdbs 
WHERE max_size > 0 AND (total_size/max_size) > 0.90;
EOF

🛠️ Need Remote Enterprise Oracle DBA Support?

Struggling with complex Data Guard failovers, RAC performance tuning, ODA migrations, or database emergency troubleshooting?

Contact us for Remote DBA Consulting & On-Call Engineering Services across Asia-Pacific (Hong Kong, Singapore, Australia), EMEA, and North America

0 Comments:

Post a Comment

Really Thanks

Subscribe to Post Comments [Atom]

<< Home