Best way to monitor SQL Azure database server - azure-sql-database

I've been getting some warnings about high utilization on our SQL Azure database server. What is the best way to monitor the utilization of that machine and try to analyze what is causing the high utilization spikes?

Log into the Azure management portal http://manage.windowsazure.com
Select your SQL Database that you interested in getting details on.
Select monitor
Let’s say you want to monitor your DTU %. Click on that line item.
Select ADD RULE
Name the rule and describe it
Specify who you want to receive the alerts.
This flow with screen shots can be found here:
http://blogs.msdn.com/b/mschray/archive/2015/09/04/monitoring-your-sql-database-in-azure.aspx

sys.resouce_stats and sys.resource_usage can be used for monitoring the resource usage. Query store feature in SQL DB v12 helps you debugging the performance issues:
http://azure.microsoft.com/en-us/blog/query-store-a-flight-data-recorder-for-your-database/

Using Dynamic Management Views
Azure SQL Database enables a subset of dynamic management views to diagnose performance problems
take look here DMV sql azure

Related

Azure SQL Database vs Azure SQL on VM

We are finding Azure SQL Database very slow. Its probably about 10x slower than the same spend on a SQL on an Azure VM.
However a VM based solution requires maintenance and backups and im concerned I'll loose the VM and data if something horrible goes wrong.
Thus the SQL Azure solution seems safer to me. So I have two specific questions.
Are you seeing this speed difference and if so is there a solution
Is there any nice solution for ensure the SQL on VM is backed up automatically and offsite.
Azure SQL database is slightly slower than SQL Server on Azure Virtual Machine. However, we didn't find it as slow as 10X. May be you should try Premium tier, which delivers more powerful and predictable performance, in case your database is in some other tier.
Regarding SQL Server on Azure Virtual Machine, there is support available for automated backup and patching. Please visit the below link for more details.
http://azure.microsoft.com/blog/2015/01/29/automated-everything-with-sql-server-on-iaas-vms/
While performance analysis, it is worth checking for ASYNC_NETWORK_IO wait type. Make Sure your client application is deployed close to your database in Azure.

Azure SQL Elastic Performance Scale

I have Standard S1 SQL database which is fine for most tasks. However I have an overnight task that needs much more computing power.
I am wondering if anyone has experience of using scheduling to scale up the database in terms of Service Tier and Performance Level, executing one or more specific SQL tasks, and then scaling back down to the original level.
I wrote the following Azure Automation workflow for your exact scenario [Azure SQL Database: Vertically Scale]. In full disclosure, there is an open issue running the script against SQL Database v12 right now. I am actively working on it and will post on the script center page when resolved.
(2/28) Update, the issue has been mitigated and the detailed steps for the temporary workaround have been posted on the main script center page.

MSSQL Automated Jobs

I have been recently reading about configuring jobs within SQL Server and that they can be configured to do specific tasks.
I recently had issues whereby all the DB indexes where > 75% fragmented and I wondered if there was a way to have SQL Server automatically manage itself.
Now when reading about setting up and configuring jobs it mentions the SQL Server Agent.
In the DB Server I was looking at the SQL Server Agent was switched off.
This made me think that having a "job" to handle the rebuilding/reorganising of indexes may not be great if this agent can simply be disabled...
Is there anything at a DB level which can be configured to do this, or is this still really in the hands of a "DBA"?
So to summarise, my question is, what is the best way to handle rebuilding/reorganising indexes?
A job calling some stored procedures could be your answer.
Automation of this task depends on your DB: volume of data, fragmentation degree, batch updates, etc.
I recommend you to check regularly your index fragmentation, before applying an automatized solution.
Also, you can programmatically check if SQL Server Agent is running.

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.