DAC (Dedicated Admin Connection) SQL Server
DAC (Dedicated Admin Connection) SQL Server
com
Praveen Madupu - +91 98661 30093
Sr SQL Server DBA, Dubai
[email protected]
DAC (Dedicated Administrator Connection) in SQL Server is a special diagnostic connection that allows
database administrators to access a running SQL Server instance to troubleshoot issues, especially when the
server is unresponsive to standard connections. This feature provides a backdoor for administrative tasks when
all other connections are not working due to resource overload, high CPU usage, memory issues, or
misconfigurations.
https://www.sqldbachamps.com
●
●
●
The server has resource exhaustion (memory, CPU).
Deadlocks are causing issues.
Diagnosing configuration or performance problems.
By default, DAC is available only on the local machine, but you can enable remote DAC connections by following
these steps:
RECONFIGURE;
https://www.sqldbachamps.com
Praveen Madupu - +91 98661 30093
Sr SQL Server DBA, Dubai
[email protected]
2. Connecting via DAC
● Using SQLCMD: The easiest way to use DAC is via SQLCMD, a command-line utility, using the -A
option:
SQLCMD -S servername -A
Using SSMS: You can also use SQL Server Management Studio by connecting to the database instance, but
using the ADMIN: prefix before the server name. For example:
ADMIN:localhost
Once connected via DAC, you can run lightweight diagnostic queries such as:
https://www.sqldbachamps.com
● Check currently running queries:
EXEC sp_who2;
You can also execute other queries or procedures to kill problematic processes, free up resources, or review log
files.
Limitations of DAC
● Resource Intensive Queries: DAC is primarily for diagnostic purposes, and its use should be limited to
lightweight queries. Running resource-heavy queries can worsen the server's state.
● Single Connection: Since DAC allows only one connection at a time, it’s possible for another user to
block the use of DAC unintentionally.
● Restricted Features: Some features, such as parallel queries or operations, may not work as expected
when using DAC.
https://www.sqldbachamps.com
Praveen Madupu - +91 98661 30093
Sr SQL Server DBA, Dubai
[email protected]
Example Scenario for DAC Use
1. Scenario: Your SQL Server instance becomes unresponsive due to a resource bottleneck, and the usual
connections (via SSMS or other clients) time out.
2. Steps to Solve:
○ Use SQLCMD to connect to the server via DAC using the -A flag.
○ Run a diagnostic query like sp_who2 to identify the blocking or runaway processes.
○Kill the problematic session or process using the KILL <session_id> command.
○Check server logs or use DMVs (Dynamic Management Views) to further investigate the
underlying issue.
3. Post-DAC Usage: After resolving the issue, make sure to exit the DAC connection, as it’s meant only for
emergency use.
Summary
The DAC connection in SQL Server is an invaluable tool for administrators to troubleshoot critical server issues
when standard connections are failing. It's available locally by default, can be enabled for remote use, and
supports running lightweight diagnostic commands.
https://www.sqldbachamps.com