Posted On March 31, 2019

MySQL: List Database Size

kimconnect 0 comments
blog.KimConnect.com >> Database >> MySQL: List Database Size
SELECT table_schema "kimconnect",
       ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB"
FROM information_schema.tables
GROUP BY table_schema;
# change the owner of the database to sa
ALTER AUTHORIZATION on DATABASE::{database_name} to sa

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

PowerShell: Obtaining SQL Database Default Paths

# This function returns an array of 3 string values reflecting default Data, Log, and…

T-SQL Msg 3101 Exclusive access could not be obtained because the database is in use

Symptom: Msg 3101, Level 16, State 1, Line 2Exclusive access could not be obtained because…

SQL: Truncate Transaction Logs

Overview: Significance: many small teams lack Database Admin resource to babysit SQL databases; therefore, certain…