Submit a ticketCall us

Don’t fall victim to a ransomware attack
Backups are helpful, but sometimes that’s not enough to protect your business against ransomware. At our live webcast we will discuss how to protect against ransomware attacks with SolarWinds® Patch Manager and how to leverage log data to detect ransomware. Register now for our live webcast.

Home > Success Center > ipMonitor > Monitor the size of database in MS SQL

Monitor the size of database in MS SQL

Table of contents
No headers


Within the ADO-QA Monitor, you can use the following query:

select size as Number_of_8KB_chunks from [database_name].dbo.sysfiles;

***This will give you the number of 8 Kilobyte chunks for the data file ([database_name].mdf)and the transaction log ([database_name].ldf)

select size*8 as Size_in_KB_Each from [database_name].dbo.sysfiles;

***This will give you the number of Kilobytes used by the data file ([database_name].mdf) and the transaction log ([database_name].ldf)


select sum(size)*8 as Size_in_KB_Total from [database_name].dbo.sysfiles;

***This will give you the total Kilobytes used by the data file ([database_name].mdf) and the transaction log ([database_name].ldf) together.

Last modified
21:40, 11 Oct 2015

Tags

Classifications

Public