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

Some Old SQL Snippets

--Visibar_TestSELECT STK_ROOM, BIN, INV_CODE, LOC_DESCFROM LOCATION_DESCRIPTIONWHERE (STK_ROOM IN (@Stock)) AND (BIN IN (@Bins)) -- Query…

Latin1_General_CI_AI vs SQL_Latin1_General_CP1_CI_AS

The SQL_Latin1_General_CP1_CI_AS collation is a SQL collation and the rules around sorting data for unicode…

PowerShell: Automating Microsoft Failover Cluster Maintenance – FileServer, SQL AlwaysOn, Hyper-V Guest VMs, Disks Operations

##################################################################################################### # MsClusterMaintenance_v0.0.2.ps1 # Author: KimConnect.com # License: GPLv3 # Description: this program automates the…