--PostgreSQL
SELECT
    pg_size_pretty (
        pg_database_size ('dvdrental')
    );


--MySQL
SELECT
    table_schema "DB Name",
    ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB"
FROM information_schema.tables
GROUP BY table_schema;

--Oracle
--Check the database size physical consume on disk.
select sum(bytes)/1024/1024 size_in_mb from dba_data_files;
--Check the PDB Size of database
select con_id, name, open_mode, total_size from v$pdbs;
--Check the CDB Size of database
select sum(size)/1024/1024/1024 from cdb_data_files;
  • No labels