top of page
Learn T-SQL

What Is The Remote DAC And Why You Should Use It

Updated: Mar 23

The remote Dedicated Administrator Connection (DAC) is a feature in SQL Server that allows a database administrator to connect to a SQL Server instance remotely, even if the instance is unresponsive or experiencing other issues that would prevent a normal connection.

The remote DAC connection is designed to provide a reliable and secure way for administrators to troubleshoot and diagnose problems on a SQL Server instance, even if the instance is experiencing high CPU usage, memory pressure, or other issues that would normally prevent a remote connection.

To establish a remote DAC connection, an administrator can use SQL Server Management Studio (SSMS) or a command-line tool, such as sqlcmd, and specify the -A parameter to enable the remote DAC option. Once connected, the administrator can execute T-SQL commands and run diagnostic tools to identify and resolve any issues on the SQL Server instance.

It's important to note that the remote DAC connection should be used with caution, as it provides direct access to the SQL Server instance and can potentially cause more harm than good if not used correctly. Additionally, the remote DAC connection should only be used for diagnostic and troubleshooting purposes, and not for routine database administration tasks.

By default, the remote DAC connection is disabled on SQL Server instances. To enable the remote DAC connection, you can use the sp_configure stored procedure with the remote admin connections option:

sp_configure 'remote admin connections', 1;
GO
RECONFIGURE;
GO

Once enabled, the remote DAC connection can be used by administrators to connect to the SQL Server instance remotely, even if the instance is unresponsive or experiencing other issues.


How can I tell if remote DAC is enabled

You can check if the remote Dedicated Administrator Connection (DAC) is enabled on a SQL Server instance in SQL Server Management Studio (SSMS) by performing the following steps:

  • Open SSMS and connect to the SQL Server instance you want to check.

  • Open a new query window and execute the following T-SQL command:

SELECT value, value_in_use
FROM sys.configurations
WHERE name = 'remote admin connections'
  • If the value column is 1, then remote DAC is enabled on the SQL Server instance. If the value column is 0, then remote DAC is disabled.

  • The value_in_use column indicates whether the current configuration is being used. If the value_in_use column is 1, then the current configuration is in use. If the value_in_use column is 0, then the current configuration is not in use and a restart of the SQL Server service may be required to apply the change.

Alternatively, you can also check if remote DAC is enabled by attempting to connect to the instance using the DAC endpoint. To do this, open a new query window in SSMS and type admin: before the server name in the Connect to Server dialog box. For example, if your server name is MyServer, type admin:MyServer in the Server Name field. If remote DAC is enabled and the connection is successful, you will be prompted to enter your login credentials.


How do you connect to SQL Server using the Remote DAC?


To connect to a SQL Server instance using the remote Dedicated Administrator Connection (DAC), you can follow these steps:

  • Open SQL Server Management Studio (SSMS).

  • In the Connect to Server dialog box, type admin: before the server name in the Server Name field. For example, if your server name is MyServer, type admin:MyServer in the Server Name field.

  • Click Connect.

  • If remote DAC is enabled on the SQL Server instance, you will be prompted to enter your login credentials. Enter your credentials and click Connect.

  • Once connected, you can use the remote DAC connection to run diagnostic queries and troubleshoot issues on the SQL Server instance.

6 views0 comments
bottom of page