Solved

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

Posted on 2012-04-02
4
407 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Join & Write a Comment

How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

707 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now