SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SQL Overview IV - DBA's Morning Review


SQL Overview IV - DBA's Morning Review

Author
Message
David Bird
David Bird
SSChasing Mays
SSChasing Mays (651 reputation)SSChasing Mays (651 reputation)SSChasing Mays (651 reputation)SSChasing Mays (651 reputation)SSChasing Mays (651 reputation)SSChasing Mays (651 reputation)SSChasing Mays (651 reputation)SSChasing Mays (651 reputation)

Group: General Forum Members
Points: 651 Visits: 1224
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
Harold Buckner
Harold Buckner
SSChasing Mays
SSChasing Mays (619 reputation)SSChasing Mays (619 reputation)SSChasing Mays (619 reputation)SSChasing Mays (619 reputation)SSChasing Mays (619 reputation)SSChasing Mays (619 reputation)SSChasing Mays (619 reputation)SSChasing Mays (619 reputation)

Group: General Forum Members
Points: 619 Visits: 420
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
David Bird
David Bird
SSChasing Mays
SSChasing Mays (651 reputation)SSChasing Mays (651 reputation)SSChasing Mays (651 reputation)SSChasing Mays (651 reputation)SSChasing Mays (651 reputation)SSChasing Mays (651 reputation)SSChasing Mays (651 reputation)SSChasing Mays (651 reputation)

Group: General Forum Members
Points: 651 Visits: 1224
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
Harold Buckner
Harold Buckner
SSChasing Mays
SSChasing Mays (619 reputation)SSChasing Mays (619 reputation)SSChasing Mays (619 reputation)SSChasing Mays (619 reputation)SSChasing Mays (619 reputation)SSChasing Mays (619 reputation)SSChasing Mays (619 reputation)SSChasing Mays (619 reputation)

Group: General Forum Members
Points: 619 Visits: 420
Thanks, I'll check it out.
Vladimirm_2
Vladimirm_2
SSC Rookie
SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)

Group: General Forum Members
Points: 27 Visits: 36
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...
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search