Monday, September 24, 2018

tot_siz_db

--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;
col "Database Size" format a20
 col "Free space" format a20
 col "Used space" format a20
 select round(sum(used.bytes) / 1024 / 1024 / 1024 ) || ' GB' "Database Size"
 , round(sum(used.bytes) / 1024 / 1024 / 1024 ) -
 round(free.p / 1024 / 1024 / 1024) || ' GB' "Used space"
 , round(free.p / 1024 / 1024 / 1024) || ' GB' "Free space"
 from (select bytes
 from v$datafile
 union all
 select bytes
 from v$tempfile
 union all
 select bytes
 from v$log) used
 , (select sum(bytes) as p
 from dba_free_space) free
 group by free.p;

No comments:

Post a Comment

[ERROR]: The value of s_patch_service_name is not set correctly in atleast one of the context files.

[ERROR]: The value of s_patch_service_name is not set correctly in atleast one of the context files. I got the issue below wh...