Recently,
I needed to configure Liferay with SQL Server 2005 Express edition and I wanted to calculate the total database size of lportal database.
The query below gives me exact results.
Results
dbname log_size_mb row_size_mb total_size_mb
lportal 1.50 19.19 20.69
Hope this helps someone. :)
Cheers!!!
I needed to configure Liferay with SQL Server 2005 Express edition and I wanted to calculate the total database size of lportal database.
The query below gives me exact results.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
database_name = DB_NAME(database_id) | |
, log_size_mb = CAST(SUM(CASE WHEN type_desc = 'LOG' THEN size END) * 8. / 1024 AS DECIMAL(8,2)) | |
, row_size_mb = CAST(SUM(CASE WHEN type_desc = 'ROWS' THEN size END) * 8. / 1024 AS DECIMAL(8,2)) | |
, total_size_mb = CAST(SUM(size) * 8. / 1024 AS DECIMAL(8,2)) | |
FROM sys.master_files WITH(NOWAIT) | |
WHERE database_id = DB_ID() -- for current db | |
GROUP BY database_id |
Results
dbname log_size_mb row_size_mb total_size_mb
lportal 1.50 19.19 20.69
Hope this helps someone. :)
Cheers!!!
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.