Visual Basic Foro

Programación => Bases de Datos => Mensaje iniciado por: obethermy en Octubre 09, 2015, 03:09:15 pm

Título: TAMAÑOS DE LAS BASES DE DATOS MYSQL
Publicado por: obethermy 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;