Check the Oracle Database size of non CDB, CDB and PDB

Queries for the non-CDB databases-

on Check the Oracle Database size CDB and PDBFollowing Queries for NON-CDB database:

Check the database physical consumed size

select sum(bytes)/1024/1024/1024 size_in_gb from dba_data_files;

Total space used by the data in the database.

select sum(bytes)/1024/1024/1024 size_in_gb from dba_segments;

Check the size of the User or Schema in Oracle database.

select owner, sum(bytes)/1024/1024/1024 Size_GB from dba_segments group by owner;

Find free space and used space in the Oracle database.

select
"Reserved_Space(MB)", "Reserved_Space(MB)" - "Free_Space(MB)" "Used_Space(MB)","Free_Space(MB)"
from(
select
(select sum(bytes/(10141024)) from dba_data_files) "Reserved_Space(MB)", (select sum(bytes/(10241024)) from dba_free_space) "Free_Space(MB)"
from dual );

Check overall size of database,temp and redo file.

select
( select sum(bytes)/1024/1024/1024 data_size from dba_data_files ) +
( select nvl(sum(bytes),0)/1024/1024/1024 temp_size from dba_temp_files ) +
( select sum(bytes)/1024/1024/1024 redo_size from sys.v_$log ) +
( select sum(BLOCK_SIZE*FILE_SIZE_BLKS)/1024/1024/1024 controlfile_size from v$controlfile) "Size in GB"
from
dual;

Queries for CDB and PDB databases-

Check the PDB Size of the databases

select con_id, name, open_mode, total_size/1024/1024/1024 "PDB_SIZE_GB" from v$pdbs;

Check the CDB Size of the databases

select sum(bytes)/1024/1024/1024 from cdb_data_files;

Comments

Popular posts from this blog

Enabling Autostart during server reboot of Oracle Database 19c filesystem on Oracle / Redhat Linux 7

Management of Users and privilleges in Oracle Database 12c / 19c in container & Pluggable database

Oracle Temporary Tablespace Resize