SQL Server PerfMon Counter Details - sql

I am working on SQL Server 2008R2 and 2012 Denali Monitoring Project in this I want to find out all PerfMon counters and its details I mean which perfmon counter used for what purpose.
I did try on Google and MSDN but i was not able to get that table which provides the details of all SQL Server PerfMon counters.
From following query I got all perfmon counters list but I am not able to find the details of each and every PerfMon counters.
SELECT *
FROM sys.dm_os_performance_counters

What are you trying to monitor? Monitoring everything is not really a feasible plan. Both SQL Server 2008 R2 and Denali come with the management data warehouse(MDW), and if you have enterprise, the utility control point(UCP) is available. These are monitoring tools built into SQL Server to save the information in several of the DMV's(sys.dm_os_performance_counters included). The information is polled at a certain interval (generally 15 seconds, but you can change) and is saved into the respective database for reporting and inspection at your leisure. One of the reasons this information is polled and saved is because the counters are for specific use, meaning some counters increment from the beginning of the install and many others are reset when SQL Server is restarted. CPU ticks is one I know that needs at least 2 points of data to see what the load on the cpu is. Not sure if this will help you in your endeavor, but if it does , then cool
This said, there are hundreds of SQL Server perfomance counters, If you look in perfmon, when you bring up a SQL counter, there is a description available below, telling you what exactly it does. If you can not find the monster list somewhere, I would try to use powershell to extract all sql counters and their respective descriptions. I would not try to get the information from SQL because it isn't there, it is in the BOL, but not as a list that I have ever seen. Plus to add to problem, not all of the counters are very well documented.
This will give you All SQL related counters in perfmon. Hope this helps. Still working on pulling the description. Don't know powershell that well.
Get-Counter -listSet SQL | %{$_.counter}
there are supposed to be asteriks around the word SQL, but it's formatting to italics, and I'm new so I don't know how to get around that yet.

Related

Performance hit on DB2 transactional database after linking to SQL Server 2005

We have an AS400 mainframe running our DB2 transactional database. We also have a SQL Server setup that gets loaded nightly with data from the AS400. The SQL Server setup is for reporting.
I can link the two database servers, BUT, there's concern about how big a performance hit DB2 might suffer from queries coming from SQL Server.
Basically, the fear is that if we start hitting DB2 with queries from SQL Server we'll bog down the transactional system and screw up orders and shipping.
Thanks in advance for any knowledge that can be shared.
Anyone who has a pat answer for a performance question is wrong :-) The appropriate answer is always 'it depends.' Performance tuning is best done via measure, change one variable, repeat.
DB2 for i shouldn't even notice if someone executes a 1,000 row SELECT statement. Take Benny's suggestion and run one while the IBM i side watch. If they want a hint, use WRKACTJOB and sort on the Int column. That represents the interactive response time. I'd guess that the query will be complete before they have time to notice that it was active.
If that seems unacceptable to the management, then perhaps offer to test it before or after hours, where it can't possibly impact interactive performance.
As an aside, the RPG guys can create Excel spreadsheets on the fly too. Scott Klement published some RPG wrappers over the Java POI/HSSF classes. Also, Giovanni Perrotti at Easy400.net has some examples of providing an Excel spreadsheet from a web page.
I'd mostly agree with Buck, a 1000 row result set is no big deal...
Unless of course the system is looking through billions of rows across hundreds of tables to get the 1000 rows you are interested in.
Assuming a useful index exists, 1000 rows shouldn't be a big deal. If you have IBM i Access for Windows installed, there's a component of System i Navigator called "Run SQL Scripts" that includes "Visual Explain" that provides a visual explanation of the query execution plan. View that you can ensure that an index is being used.
On key thing, make sure the work is being done on the i. When using a standard linked table MS SQL Server will attempt to pull back all the rows then do it's own "where".
select * from MYLINK.MYIBMI.MYLIB.MYTABE where MYKEYFLD = '00335';
Whereas this format sends the statement to the remote server for processing and just gets back the results:
select * from openquery(MYLINK, 'select * from mylib.mytable where MYKEYFLD = ''00335''');
Alternately, you could ask the i guys to build you a stored procedure that you can call to get back the results you are looking for. Personally, that's my preferred method.
Charles

Map out SQL Server 2008 usage? (from logs)

All-
I'm trying to determine which SQL databases are currently being used the most (as well as what applications are requesting information from them).
Is there a log analyzing tool? Or something built into SQL server that could help me achieve this?
Ideally I'd like to show a map of server usage and understand which applications are actually hitting them.
Thanks!
sys.dm_db_index_usage_stats shows exactly how many time each index/table was read/scanned/updated since the server started up. This is the most important piece of information since everything else (IO, RAM, CPU) can be ultimately traced to these operations. The one information not revealed from here is blocking and contention, for which a good starting point is sys.dm_os_wait_stats. And finally there is sys.dm_exec_query_stats which will drill down to the individual query CPU and execution times.
If you right-click on the server in Management Studio you will see a 'Reports' option. There are a lot of built in reports which might give you what you need (the 'Server Dashboard' report in particular shows which databases are consuming the most CPU and I/O).
Alternatively the Profiler provides a lot of (perhaps too much) valuable data.

Selecting SQL Server 2008 metrics from a database?

First off, I'm not even sure this is possible. One of my co-workers is requesting that I help him retrieve performance metrics from a Microsoft SQL Server 2008 database using a remote connection and a SQL query.
Specifically, we are looking for stuff like database memory usage and CPU usage. Is this stored in a table somewhere that I can easily just SELECT it from?
I've tried googling this but mainly all I come up with are ads for products that do SQL performance monitoring. I realize we could use perfmon in Windows to get this data, but that's not what he's looking for. Also remote WMI gathering of perfmon metrics is out. It has to be a remote SQL query - some product limitation I won't get into in detail. :)
Even a definitive "This is not possible" is a valid answer.
Thanks in advance.
There is DBCC MEMORYSTATUS to get a ton of memory information.
DBCC statements in general are full with useful information about your SQL Server.
SO Answer on how you can "build" your own taskmon for SQL Server.
Another great source for information about server state are Dynamic Management Views.
Knock yourself out.
To get the sort of info you want, you'll need to use SQL Server's performance/system monitor counters. See the MSDN article Monitoring Resource Usage (System Monitor) for details:
If you are running Microsoft Windows server operating system, use
the System Monitor graphical tool to measure the performance of
SQL Server. You can view SQL Server objects, performance counters,
and the behavior of other objects, such as processors, memory, cache,
threads, and processes. Each of these objects has an associated
set of counters that measure device usage, queue lengths, delays,
and other indicators of throughput and internal congestion.
[And yes...you can access peformance counters remotely (assuming you have the requisite permissions]

Can i monitor performance of particular table in sql server 2008 profiler

I want to monitor all the DML commands that run on a particular table of my database in sql server profiler. Im using sql server 2008 R2
Besides the suggested solutions, you can use a third party tool that reads SQL Server traces.
ApexSQL Comply is a SQL Server auditing tool that used SQL traces, reads relevant information from them, and stores it into its central repository database. It allows you to select the tables and event types you want to monitor. You can specify to monitor different set of events for every database.
It provides various built-in reports, where you can filter by a specific DML operation. It also has custom reports, so you can create your own reports.
You can set the tool to monitor just specific events on the table, or if you monitor all events, you can use the filters on the reports to show just the DML commands.
Disclaimer: I work for ApexSQL as a Support engineer
Yes sure - you might want to check out this video series by Brad McGehee:
Mastering SQL Server Profiler - Video Training Course
It's very useful and teaches you the basics and some more advanced concepts of SQL Server Profiler. Highly recommended.
Or here's the 10-minute short version by Brent Ozar: SQL Server Profiler Tutorial Video
In SQL Server Profiler, when you create a new profile trace, you can define filters. You can limit the stats being collected by a ton of different criteria - one of them being the Object Name , e.g. the table name you want to check for.
See Profiler Filters for more information on that particular topic.
Depending upon your exact needs you might also want to look into extended events. This has several advantages over using SQL Profiler/ SQL Trace in terms of performance, flexibility of filters, and the information available.
If you do decide to investigate this further you might find my answer to another question useful for getting up and running.

SQL query against hardware. Possible?

I need to query the Total Physical Memory, Available Physical Memory and Total Commit Charge of the server. Basically values circled in the picture. Is it possible using SQL Server 2005?
alt text http://www.angryhacker.com/toys/task.png
You can try using the sys.dm_os_sys_info table. Wich returns a miscellaneous set of useful information about the computer, and about the resources available to and consumed by SQL Server.
USE [master];
SELECT * FROM sys.dm_os_sys_info
Bye.
It's not entirely clear what you're asking. You can use a subset of SQL called WQL to get information from WMI, and I'm pretty sure all the data you're asking for is available via WMI, so you should be able to get it all via a SQL query. That SQL query won't be talking to the actual SQL server at the time though, it'll be talking to the WMI provider via the WQL adapter.
I'm not sure about the entire box, but you can use DBCC MemoryStatus to get the consumption of SQL Server itself.
Here's an article about it.
I don't think you really mean SQL as in Database information, it looks to me like you're trying to query the operating system for performance information. Is that right?
You'd need to perform WMI queries for that, instead of SQL queries (which are designed for database access)
Here's an example for getting memory information:
http://www.computerperformance.co.uk/vbscript/wmi_memory.htm#Scenario_-_When_to_use_this_WMI_Memory_Script_
The web site included in the link above has all kinds of samples, and I think you'd be able to get to what you want by researching there.