반응형

1. DB 용량확인(MEGA)

/************************
DB 용량확인(MEGA)
************************/
select f.tname "TableSpace", round(sum(d.bytes)/1024/1024, 0) "Total(M)",round((sum(d.bytes) - sum(f.bytes))/1024/1024, 0) "UsedSpace(M)",
round((sum(d.bytes) - sum(f.bytes))/sum(d.bytes)*100, 0) "Used(%)", round(sum(f.bytes)/1024/1024, 0) "FreeSpace(M)"
from
(select sum(bytes) bytes,tablespace_name tname from dba_free_space group by tablespace_name) f,
(select sum(bytes) bytes,tablespace_name tname from dba_data_files group by tablespace_name) d
where f.tname = d.tname group by f.tname order by f.tname;

 

2. DB 용량확인(GIGA)

/************************
DB 용량확인(GIGA)
************************/
select f.tname "TableSpace", round(sum(d.bytes)/1024/1024/1024, 0) "Total(G)",round((sum(d.bytes) - sum(f.bytes))/1024/1024/1024, 0) "UsedSpace(G)",
round((sum(d.bytes) - sum(f.bytes))/sum(d.bytes)*100, 0) "Used(%)", round(sum(f.bytes)/1024/1024/1024, 0) "FreeSpace(G)" from
(select sum(bytes) bytes,tablespace_name tname from dba_free_space group by tablespace_name) f,
(select sum(bytes) bytes,tablespace_name tname from dba_data_files group by tablespace_name) d
where f.tname = d.tname group by f.tname order by f.tname;

반응형