Oracle - ¿Cómo puedo saber el crecimiento de los tablespace en un determinado tiempo?

 
Vista:
sin imagen de perfil
Val: 2
Ha aumentado su posición en 14 puestos en Oracle (en relación al último mes)
Gráfica de Oracle

¿Cómo puedo saber el crecimiento de los tablespace en un determinado tiempo?

Publicado por Alex (1 intervención) el 28/11/2018 18:36:14
Quisiera saber si existe una consulta que me permita ver el crecimiento que hubo de los tablespace por un determinado tiempo (ya sea por dia, semana, mes o año), también si existe alguna consulta que me permita ver los cambios que han generado crecimiento sobre la base de datos.

Lo que hago para poder ver el tamaño actual de los tablespace es el siguiente:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
SELECT  df.tablespace_name "Tablespace",
   df.bytes / (1024 * 1024) "Size (MB)",
   SUM(fs.bytes) / (1024 * 1024) "Free (MB)",
   Nvl(Round(SUM(fs.bytes) * 100 / df.bytes),1) "% Free",
   Round((df.bytes - SUM(fs.bytes)) * 100 / df.bytes) "% Used"
FROM dba_free_space fs,
   (SELECT tablespace_name,SUM(bytes) bytes
      FROM dba_data_files
     GROUP BY tablespace_name) df
WHERE fs.tablespace_name (+)  = df.tablespace_name
GROUP BY df.tablespace_name,df.bytes
UNION ALL
SELECT df.tablespace_name tspace,
   fs.bytes / (1024 * 1024),
   SUM(df.bytes_free) / (1024 * 1024),
   Nvl(Round((SUM(fs.bytes) - df.bytes_used) * 100 / fs.bytes), 1),
   Round((SUM(fs.bytes) - df.bytes_free) * 100 / fs.bytes)
FROM dba_temp_files fs,
   (SELECT tablespace_name,bytes_free,bytes_used
      FROM v$temp_space_header
     GROUP BY tablespace_name,bytes_free,bytes_used) df
WHERE fs.tablespace_name (+)  = df.tablespace_name
GROUP BY df.tablespace_name,fs.bytes,df.bytes_free,df.bytes_used
ORDER BY 4 DESC;
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
sin imagen de perfil
Val: 499
Oro
Ha mantenido su posición en Oracle (en relación al último mes)
Gráfica de Oracle

¿Cómo puedo saber el crecimiento de los tablespace en un determinado tiempo?

Publicado por Rafael (328 intervenciones) el 29/11/2018 09:02:10
Hola:

Yo uso la siguiente para obtener un crecimiento por DATAFILE que realmente me interesa mas...
1
2
3
4
5
6
select	name,
	to_char(creation_time, 'RRRR Month') "Mes",
	round(sum(bytes)/(1048576*1024)) "Crecimiento (Gb)"
from V$Datafile
group by name, to_char(creation_time, 'RRRR Month')
order by 1, 2;

Pero mediante un join podrias obtener lo mismo por tablespace ...
Algo tal que asi:
1
2
3
4
5
6
7
Select T.NAME "Tablespace",
	to_char(D.CREATION_TIME, 'RRRR Month') "Mes",
	round(sum(D.BYTES)/1048576) CRECANYMB
From V$Datafile D, V$Tablespace T
Where	D.TS#=T.TS#
Group By T.NAME, to_char(D.CREATION_TIME, 'RRRR Month')
Order By 1, 2


Ahora bien para efectos de calcular un pronostico yo uso esto, que me sirve para determinar el espacio que necesito a futuro...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
select tsname,
    round(tablespace_size*t2.block_size/1024/1024/1024,2) "Tamaño Actual GB",
    round(tablespace_usedsize*t2.block_size/1024/1024/1024,2) "Espacio Usado GB",
    round((tablespace_size-tablespace_usedsize)*t2.block_size/1024/1024/1024,2) "Espacio Libre GB",
    round(val2*t2.block_size/1024/1024/1024,2) "Proy. Diario GB",
    round(val3*t2.block_size/1024/1024/1024,2) "Proy. Semanal GB",
    round(val4*t2.block_size/1024/1024/1024,2) "Proy. Mensual GB",
    round((tablespace_usedsize/tablespace_size)*100, 2) "% Usado",
    round((val2/tablespace_size)*100, 2) "% Proy. Diario",
    round((val3/tablespace_size)*100, 2) "% Proy. Semanal",
    round((val4/tablespace_size)*100, 2) "% Proy. Mensual"
from (select distinct tsname,
rtime,
tablespace_size,
tablespace_usedsize,
tablespace_usedsize-first_value(tablespace_usedsize)
over (partition by tablespace_id order by rtime rows 1 preceding) val1,
tablespace_usedsize-first_value(tablespace_usedsize)
over (partition by tablespace_id order by rtime rows 24 preceding) val2,
tablespace_usedsize-first_value(tablespace_usedsize)
over (partition by tablespace_id order by rtime rows 168 preceding) val3,
tablespace_usedsize-first_value(tablespace_usedsize)
over (partition by tablespace_id order by rtime rows 720 preceding) val4
from (select t1.tablespace_size, t1.snap_id, t1.rtime,t1.tablespace_id,
             t1.tablespace_usedsize-nvl(t3.space,0) tablespace_usedsize
     from dba_hist_tbspc_space_usage t1,
          dba_hist_tablespace_stat t2,
          (select ts_name,sum(space) space
           from recyclebin group by ts_name) t3
     where t1.tablespace_id = t2.ts#
      and  t1.snap_id = t2.snap_id
      and  t2.tsname = t3.ts_name (+)) t1,
dba_hist_tablespace_stat t2
where t1.tablespace_id = t2.ts#
and t1.snap_id = t2.snap_id) t1,
dba_tablespaces t2
where t1.tsname = t2.tablespace_name
and rtime = (select max(rtime) from dba_hist_tbspc_space_usage)
order by "Proy. Diario GB" desc,"Proy. Semanal GB" desc,"Proy. Mensual GB" desc

Saludos

Pd. Si te sirve la info a mi me sirve un +1
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
1
Comentar

¿Cómo puedo saber el crecimiento de los tablespace en un determinado tiempo?

Publicado por german (1 intervención) el 15/01/2020 00:02:36
buenas tardes
Al ejecuta el script para el pronostico no me trae filas, (no rows selected.) donde puedo ingresar el nombre del tablespace, o que estoy haciendo mal? mil gracias por tu colaboración
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
sin imagen de perfil
Val: 499
Oro
Ha mantenido su posición en Oracle (en relación al último mes)
Gráfica de Oracle

¿Cómo puedo saber el crecimiento de los tablespace en un determinado tiempo?

Publicado por Rafael (328 intervenciones) el 15/01/2020 10:49:05
Hola:

El query (que no script) de pronostico se ejecuta sobre las tablas del historico, dba_hist_tbspc_space_usage, dba_hist_tablespace_stat, etc.

Estas tablas se van alimentando con el tiempo ... cada cuanto?
1
select dbid,SNAP_INTERVAL,RETENTION from dba_hist_wr_control;

Con esto puedes saber como esta configurado...

Ahora bien dependiendo de la version de Oracle que tengas instalado, y los paquetes que hayas instalado puede o NO, estar licenciado el Diagnostics Pack, si este no lo esta... pues nunca se informaran las tablas...

Para saber que tienes puedes hacer esta query
1
2
Select *
from   V$VERSION


Saludos
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

Como calcular un pronostico a futuro de tablespace temp

Publicado por Julieth (1 intervención) el 18/08/2022 17:25:29
tal y cual asi pero con tablespace temporales:
select tsname,
round(tablespace_size*t2.block_size/1024/1024/1024,2) "Tamaño Actual GB",
round(tablespace_usedsize*t2.block_size/1024/1024/1024,2) "Espacio Usado GB",
round((tablespace_size-tablespace_usedsize)*t2.block_size/1024/1024/1024,2) "Espacio Libre GB",
round(val2*t2.block_size/1024/1024/1024,2) "Proy. Diario GB",
round(val3*t2.block_size/1024/1024/1024,2) "Proy. Semanal GB",
round(val4*t2.block_size/1024/1024/1024,2) "Proy. Mensual GB",
round((tablespace_usedsize/tablespace_size)*100, 2) "% Usado",
round((val2/tablespace_size)*100, 2) "% Proy. Diario",
round((val3/tablespace_size)*100, 2) "% Proy. Semanal",
round((val4/tablespace_size)*100, 2) "% Proy. Mensual"
from (select distinct tsname,
rtime,
tablespace_size,
tablespace_usedsize,
tablespace_usedsize-first_value(tablespace_usedsize)
over (partition by tablespace_id order by rtime rows 1 preceding) val1,
tablespace_usedsize-first_value(tablespace_usedsize)
over (partition by tablespace_id order by rtime rows 24 preceding) val2,
tablespace_usedsize-first_value(tablespace_usedsize)
over (partition by tablespace_id order by rtime rows 168 preceding) val3,
tablespace_usedsize-first_value(tablespace_usedsize)
over (partition by tablespace_id order by rtime rows 720 preceding) val4
from (select t1.tablespace_size, t1.snap_id, t1.rtime,t1.tablespace_id,
t1.tablespace_usedsize-nvl(t3.space,0) tablespace_usedsize
from dba_hist_tbspc_space_usage t1,
dba_hist_tablespace_stat t2,
(select ts_name,sum(space) space
from recyclebin group by ts_name) t3
where t1.tablespace_id = t2.ts#
and t1.snap_id = t2.snap_id
and t2.tsname = t3.ts_name (+)) t1,
dba_hist_tablespace_stat t2
where t1.tablespace_id = t2.ts#
and t1.snap_id = t2.snap_id) t1,
dba_tablespaces t2
where t1.tsname = t2.tablespace_name
and rtime = (select max(rtime) from dba_hist_tbspc_space_usage)
order by "Proy. Diario GB" desc,"Proy. Semanal GB" desc,"Proy. Mensual GB" desc
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

Como calcular un pronostico a futuro de crecimiento de un Diskgroup de ASM en oracle 11g

Publicado por nPEREZ (1 intervención) el 30/11/2022 12:20:44
Hola, estoy intentando sacar una estimación de crecimiento de un disco de asm de DATA, existe alguna consulta? o formula? agradecería la ayuda.


GROUP_NUMBER NAME STATE TYPE TOTAL_MB FREE_MB PRTJ_OCUPADO PRTJ_LIBRE
------------ ------------------------- ----------- ------ ---------- ---------- ------------ ----------
1 DATA CONNECTED EXTERN 10239000 835891 91.84 8.16
2 FLASH CONNECTED EXTERN 2047708 192800 90.58 9.42
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar