Autor Tema: TAMAÑOS DE LAS BASES DE DATOS MYSQL  (Leído 1827 veces)

0 Usuarios y 1 Visitante están viendo este tema.

obethermy

  • Megabyte
  • ***
  • Mensajes: 116
  • Reputación: +6/-7
    • Ver Perfil
TAMAÑOS DE LAS BASES DE DATOS MYSQL
« en: Octubre 09, 2015, 03:09:15 pm »
Código: (SQL) [Seleccionar]
select
    table_schema "DATABASE",
    convert(sum(data_length+index_length)/1048576,decimal(6,2)) "SIZE (MB)"
from
    information_schema.tables
where
    table_schema!="information_schema"
group by
    table_schema;
SELECT table_schema "Base de datos",
       ROUND(SUM(data_length+index_length)/1024/1024,3) "Tamaño (MB)"
       FROM information_schema.TABLES
       GROUP BY table_schema;
/*espacio libre para optimize */
SELECT table_schema "Base de datos",
       sum( data_length + index_length ) / 1024 / 1024 "Tamaño (MB)",
       sum( data_free )/ 1024 / 1024 "Espacio libre (MB)"
       FROM information_schema.TABLES
       GROUP BY table_schema;
SELECT TABLE_SCHEMA,TABLE_NAME
FROM TABLES WHERE TABLE_SCHEMA NOT IN ("information_schema","mysql") AND
Data_free > 0;