Vistas dba_free_space y dba_data_files;
¿Como puedo sacar el espacio total, el espacio libre y el espacio reservado por cada tablespace y datafile?
Me gustaría que me realizasen la consulta oportuna ya que yo he sido incapaz de realizarla.
Gracias
Me gustaría que me realizasen la consulta oportuna ya que yo he sido incapaz de realizarla.
Gracias
Solo crea un escrip con estas lineas y obtendras la infomacion que solicitas
----------------------------------------------------------------------------------------
--
--
--
clear breaks computes
--
--
--
col porc_free format a8
--
--
--
set lines 142 pages 47 newp 0
--
--
--
break on report
--
--
--
compute sum of pices on REPORT
compute sum of bytes_def on REPORT
compute sum of bytes_u on REPORT
compute sum of bytes_l on REPORT
--
--
--
spool t.lst
select b.TABLESPACE_NAME tablespace_name
,substr(b.file_name,1,45) file_name
-- ,count(1) pices
-- ,b.file_id
,round((b.bytes/1024)/1024,2) bytes_def
,round(((b.bytes - sum(a.bytes))/1024)/1024,2) bytes_u
,round((sum(a.bytes)/1024)/1024,2) bytes_l
,' '|| round((((sum(a.bytes)/1024)/1024) * 100) / ((b.bytes/1024)/1024),2)||'%' porc_free
from dba_data_files b, dba_free_space a
where a.file_id = b.file_id
group by substr(b.file_name,1,45),b.TABLESPACE_NAME,b.bytes
order by tablespace_name, porc_free desc
;
spool off
set lines 132 pages 22 newp 1
----------------------------------------------------------------------------------------
--
--
--
clear breaks computes
--
--
--
col porc_free format a8
--
--
--
set lines 142 pages 47 newp 0
--
--
--
break on report
--
--
--
compute sum of pices on REPORT
compute sum of bytes_def on REPORT
compute sum of bytes_u on REPORT
compute sum of bytes_l on REPORT
--
--
--
spool t.lst
select b.TABLESPACE_NAME tablespace_name
,substr(b.file_name,1,45) file_name
-- ,count(1) pices
-- ,b.file_id
,round((b.bytes/1024)/1024,2) bytes_def
,round(((b.bytes - sum(a.bytes))/1024)/1024,2) bytes_u
,round((sum(a.bytes)/1024)/1024,2) bytes_l
,' '|| round((((sum(a.bytes)/1024)/1024) * 100) / ((b.bytes/1024)/1024),2)||'%' porc_free
from dba_data_files b, dba_free_space a
where a.file_id = b.file_id
group by substr(b.file_name,1,45),b.TABLESPACE_NAME,b.bytes
order by tablespace_name, porc_free desc
;
spool off
set lines 132 pages 22 newp 1
