The DAC, what is it? It is the Dedicated Administrator Console. Basically it is a way to connect to your SQL Server when all the other connections are tied up. But it takes a little bit of pre-planning so that you can use it when things go bad with your SQL Server. Let’s enable it so you can test using it and know that it is there in the future.
EXEC sp_configure 'remote admin connections', 1; GO RECONFIGURE GO
I was always afraid to use the DAC because I thought I had to use the command line and I am terrible with cmd. But did you know, you can connect to it through Management Studio? Now I can feel right at home when I trouble shoot a sick server. To connect to a server using the DAC put “admin:” in front of the name of the server like this:
I use my elevated windows login for this point, but you can use what ever sys admin account that you have.
There are a few words of caution. You can only have one connection to your DAC on each server at a time. So don’t try to connect Object explorer to it. I have SQLPrompt and noticed that my server would send an alert on Severity Error 20 because SQL Prompt was trying to connect at the same time and was failing. Just be aware that you might get an error, but if everything is correct you can look down at the connection at the bottom of the query window and see you are connected. If someone else is using the DAC, you won’t be able to use the connection, so it is a good idea to always close it when you are done.
Kendra Little b|t has a fantastic post for Brent Ozar Unlimited about the DAC and most importantly to me, how to tell who is connected. This is the code that she wrote to help identify who is connected:
SELECT CASE WHEN ses.session_id= @@SPID THEN 'It''s me! ' ELSE '' END + coalesce(ses.login_name,'???') as WhosGotTheDAC, ses.session_id, ses.login_time, ses.status, ses.original_login_name from sys.endpoints as en join sys.dm_exec_sessions ses on en.endpoint_id=ses.endpoint_id where en.name='Dedicated Admin Connection'
Now when SQL Server Breaks on you, there is a tool that prevents us from shattering like glass.
[…] Andrea Allred shows us how to use the DAC: […]