Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

SQL Database Size Report for multiple sql srvers, instances & databases

Posted on 2012-04-02
4
419 Views
Last Modified: 2012-06-27
Hi Friends,
We have multiple sql server boxes used as a back end for a variety of applications such as sharepoint, hyperion, navigon etc.
The question is how best we can collate (a report) which contains list of databases (instace & server names) & the size on disk.
This is just to track database growth for all sql servers from one interface/report.

Have tried out SSMS > Mangement > Management Data warehouse > disk usage reports.
Asking for same as such but for all sql databases, instances & servers in the data centre & report in one instance,database only.

Also, any altenative is most welcome.
In SQL space, we have 2005, 2008, 2008 R2 version.
0
Comment
Question by:Minesh Shah
  • 2
  • 2
4 Comments
 
LVL 5

Assisted Solution

by:25112
25112 earned 500 total points
ID: 37796236
run the below query from central management server http://msdn.microsoft.com/en-us/library/bb934126.aspx (2008 and up only)
For prior version- put the query in SSIS package with a connection string to each instance desired..

SELECT
   (SELECT 'file_type' =  
   CASE  
       WHEN AF.groupid <> 0 THEN 'data'
       WHEN AF.groupid = 0 THEN 'log'
   END) AS 'file_type'
,  DB.name AS 'db_name'
,  AF.name AS 'logical_file_name'
,  AF.filename AS 'physical_file_name'
,  cast((AF.size * 8 / 1024.) as decimal(18,2))  'File_Size_in_MB'
FROM
   sys.databases DB
JOIN
   sys.sysaltfiles  AF ON
database_id = dbid
0
 
LVL 10

Author Comment

by:Minesh Shah
ID: 37823007
hi team,
sorry for delay.
well, above one works. thanks.
ended up in some script which stores data of all these instances in 1 database centrally.

wondering, can we do anything better! your thoughts..
0
 
LVL 5

Accepted Solution

by:
25112 earned 500 total points
ID: 37847709
>>wondering, can we do anything better!
central management server - is it!
0
 
LVL 10

Author Closing Comment

by:Minesh Shah
ID: 37859977
ok
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Encrypting SQL Server 2014 or SQL Server 2016 4 30
SQL Pivot with row total 5 27
Need return values from a stored procedure 8 19
SQL Group By Question 4 19
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question