quinta-feira, julho 11, 2013

How to format date with getdate() function result

How to format date with getdate() function result:

SELECT replace(convert(varchar, getdate(), 111), '/', '-')  + ' 00:00:00' AS EndDate, replace(convert(varchar, getdate()-1, 111), '/', '-') + ' 00:00:00' AS StartDate


http://anubhavg.wordpress.com/2009/06/11/how-to-format-datetime-date-in-sql-server-2005/

terça-feira, julho 09, 2013

SCOM Reporting - How To get Performance counters by Day instead of Hour


To get Performance counters by Day instead of Hour:

SELECT FullName, InstanceName, DateTime, AverageValue, MaxValue, MinValue
FROM OperationsManagerDW.dbo.vManagedEntity,
OperationsManagerDW.dbo.vPerformanceRule,
OperationsManagerDW.dbo.vPerformanceRuleInstance,
OperationsManagerDW.Perf.vPerfDaily
WHERE vPerfDaily.ManagedEntityRowId = vManagedEntity.ManagedEntityRowId
AND vPerfDaily.PerformanceRuleInstanceRowId = vPerformanceRuleInstance.PerformanceRuleInstanceRowId
AND vPerformanceRuleInstance.RuleRowId = vPerformanceRule.RuleRowId
AND vPerformanceRule.ObjectName = 'Processor'
AND vPerformanceRule.CounterName = '% Processor Time'
AND DateTime > '2013-06-01'
AND DateTime < '2013-07-01'
ORDER BY FullName, InstanceName, DateTime

sexta-feira, julho 05, 2013

SCOM Reporting - How to get Performance Counter

http://capacitas.wordpress.com/2012/12/05/retrieving-data-from-the-scom-database/

You can now construct a query to get back, for instance, CPU data for every server between two dates (knocked together quickly to show how it all links up, you could probably write one more elegantly):
SELECT FullName, InstanceName, DateTime, AverageValue
FROM OperationsManagerDW.dbo.vManagedEntity,
OperationsManagerDW.dbo.vPerformanceRule,
OperationsManagerDW.dbo.vPerformanceRuleInstance,
OperationsManagerDW.Perf.vPerfHourly
WHERE vPerfHourly.ManagedEntityRowId = vManagedEntity.ManagedEntityRowId
AND vPerfHourly.PerformanceRuleInstanceRowId = vPerformanceRuleInstance.PerformanceRuleInstanceRowId
AND vPerformanceRuleInstance.RuleRowId = vPerformanceRule.RuleRowId
AND vPerformanceRule.ObjectName = ‘Processor’
AND vPerformanceRule.CounterName = ‘% Processor Time’
AND DateTime > ’2012-11-01′
AND DateTime < ’2012-11-08′
ORDER BY FullName, InstanceName, DateTime

quarta-feira, julho 03, 2013

APPFabric - A nova tecnologia de Caching

Cache Administration with Windows PowerShell (Windows Server AppFabric Caching)

           
By using Windows PowerShell, you can administer the cache cluster, cache hosts, and the cache itself. If you are using a computer with the Cache Administration feature installed, there are two ways of using Windows PowerShell for managing the caching features of AppFabric. On the Start Menu, go to Administrative Tools, and then select Windows PowerShell Modules. Or you can go to the Start Menu, click All Programs, Windows Server AppFabric, and then click Caching Administration Windows PowerShell.

Commands

http://msdn.microsoft.com/en-us/library/ff718177(v=azure.10).aspx

How to know if the caching is healthy


http://msdn.microsoft.com/en-us/library/ff921010(v=azure.10).aspx

Throttling Troubleshooting (Windows Server AppFabric Caching)


http://msdn.microsoft.com/en-us/library/ff921030(v=azure.10).aspx