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

Loading the SQL Server Management Objects (SMO)

function loadSMO{ $ErrorActionPreference = "Stop" $sqlpsRegistry="HKLM:\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.SqlServer.Management.PowerShell.sqlps" try{ if (Get-ChildItem $sqlpsRegistry -ErrorAction "SilentlyContinue") { throw "SQL…

Microsoft Dynamics Audit History Data Missing After Org Migration

Issue: We have recently moved some Orgs from CRM version 8.x to 9.x, and audit…

DB2 AS400 to Microsoft SQL Conversion

SQL Ways Wizard: Enter ODBC data source, username, and password >> press Next Set Target…