Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««123

SQL Overview IV - DBA's Morning Review Expand / Collapse
Author
Message
Posted Friday, July 31, 2009 1:43 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, March 26, 2014 7:24 AM
Points: 182, Visits: 996
Your question got my mind of thinking. I have tested the script on a Lab server to verify it would not blow up. Currently, we do not have any multiple instance servers.

So you are running 12 instances on one Windows Cluster. Is the problem the same drive is being reported twelve times?
Or you want to see only drives listed with its assigned instance?

It will take me some time to think about it. I do not know of any other scripts to collect space on drives. What release of SQL are you using? Maybe 2008 has a DMV.


David Bird

My PC Quick Reference Guide
Post #763362
Posted Friday, July 31, 2009 1:58 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Monday, August 05, 2013 9:59 AM
Points: 307, Visits: 385
David Bird (7/31/2009)
Your question got my mind of thinking. I have tested the script on a Lab server to verify it would not blow up. Currently, we do not have any multiple instance servers.

So you are running 12 instances on one Windows Cluster. Is the problem the same drive is being reported twelve times?
Or you want to see only drives listed with its assigned instance?

It will take me some time to think about it. I do not know of any other scripts to collect space on drives. What release of SQL are you using? Maybe 2008 has a DMV.


Yes but we run as a active active cluster so 6 instance are each node. As the Diskspace script runs, it runs against each instance so all the drives on the node get listed 6 times. So SQLInstance1 list drives d-i and sqlinstance2 d-i and so on.... It would be "nice" if they were listed only once. But it would be better if SQLInstance1 reported on the drives it was assigned, such a D and SQLInstance2 reported drive E and so on.

The other issue was the mount points, which are like drives but are mounted in the folder of a drive instead of haveing a drive letter assigned its a folder. like E:\LOGS. Those do not get reported at all.

We are still using 2005. We have a coulple of 2000 servers but they are about gone.

Hope we can come up with something..

Thanks
Post #763373
Posted Friday, July 31, 2009 2:30 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, March 26, 2014 7:24 AM
Points: 182, Visits: 996
Remove the duplicate drives by deleting them from the table Disk_Space.

You can use the drives letters identified in the Database_info column Filename to identify which drives to keep for the instance. For drives, that are not identified by a database file on them, keep the first and delete the rest. Sorry I do not have time to create any sample Delete SQL.

I have no experience with using mount points on windows. Maybe Microsoft's Doctor Scripto has an answer. Sorry


David Bird

My PC Quick Reference Guide
Post #763390
Posted Friday, July 31, 2009 2:38 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Monday, August 05, 2013 9:59 AM
Points: 307, Visits: 385
Thanks, I'll check it out.
Post #763392
Posted Wednesday, September 01, 2010 8:16 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, November 20, 2012 11:49 AM
Points: 5, Visits: 29
Good stuff,
However, I noticed when you use this on different SQL servers with different level of sensitivities/collations, you may get errors, since columns name is different in create statement and the queries used(some capital some small), same is related to system stored proc sp_MSforeachdb, I had to change to exact name as it's in master database and it let me run it on any of my servers smoothly..
Also for checking disk space is not accurate to use master.dbo.xp_fixedDrives, which is not showing mounting points info.
What I'm using for checking accurate disk space - WMI Data reader task,
this does not require enabling OLA Authomation if you have security restriction ...
There you may use this query:
Select Capacity,FreeSpace,DriveLetter,Label,SystemName From Win32_Volume Where DriveType = 3
and dump info in temporary text file, from which you can load this data in your central location and provide appropriate data massage
Here's query example from destination table:
SELECT [SystemName] as [System Name]
,case len(DriveLetter )
when 0 then 'Mounting Point'
else DriveLetter end as DriveLetter
,[Label] as Label
,round(convert(float,[Capacity])/1024/1024/1024,2) as [Capacity in GB]
,round(convert(float,[FreeSpace])/1024/1024/1024,2) as [Free Space in GB]
,round((convert(float,[FreeSpace])/1024/1024/1024)/
(convert(float,[Capacity])/1024/1024/1024)*100.0,2) as [% of available free space]
FROM [myDB].[dbo].[Disk space report]
Hope this is help..

Found a bug in code so far..
Collect server info in dataflow task:
Load Server Info contain wrong code:
CASE
WHEN Serverproperty('EngineEdition') = 1 THEN 'Integrated security'
WHEN Serverproperty('EngineEdition') = 2 THEN 'Not Integrated security'
Should be:
CASE
WHEN Serverproperty('IsIntegratedSecurityOnly') = 1 THEN 'Integrated security'
WHEN Serverproperty('IsIntegratedSecurityOnly') = 0 THEN 'Not Integrated security'

Cheers,
Vladimir

P.S> If anyone is interested to extend reports and use additional criteria - WMI Data Reader Task may help..



Press any key to continue or any other key to exit...
Post #978808
« Prev Topic | Next Topic »

Add to briefcase «««123

Permissions Expand / Collapse