OracleMultitenant
Tablespace usage across all PDBs
The tablespace report for every container at once, fullest first, so you don't have to switch into each PDB.
Not yet verified. How scripts are tested
1CLEAR COLUMNS2SET LINESIZE 140 PAGESIZE 200 TRIMOUT ON TAB OFF3COLUMN pdb FORMAT A204COLUMN tablespace_name HEADING "TABLESPACE" FORMAT A255COLUMN used_gb HEADING "USED GB" FORMAT 999,990.996COLUMN max_gb HEADING "MAX GB" FORMAT 999,990.997COLUMN used_pct HEADING "USED %" FORMAT 990.98 9SELECT c.name AS pdb, m.tablespace_name,10 ROUND(m.used_space * t.block_size / POWER(1024, 3), 2) AS used_gb,11 ROUND(m.tablespace_size * t.block_size / POWER(1024, 3), 2) AS max_gb,12 ROUND(m.used_percent, 1) AS used_pct13FROM cdb_tablespace_usage_metrics m14JOIN cdb_tablespaces t ON t.con_id = m.con_id AND t.tablespace_name = m.tablespace_name15JOIN v$containers c ON c.con_id = m.con_id16ORDER BY m.used_percent DESC;Save it as ora-pdb-ts.sql and run it with SQL> @ora-pdb-ts.
More Oracle scripts: Multitenant
- Pluggable databases and their stateEvery PDB with its open mode, whether it's restricted, when it opened and its size. RESTRICTED = YES usually means a plug-in violation.
- Unresolved plug-in violationsWhy a PDB opened in restricted mode: patch mismatches, parameter conflicts and missing options, with Oracle's suggested fix in the message.
- Open PDBs and keep them open after restartOpens every PDB, then saves the state so they reopen automatically when the CDB restarts. The first query shows what's currently saved.