SQL Server Dedicated Administrator Connection (DAC)

Hi friends,

Here i just want to inform you the power of SQL Server Dedicated Administrator Connection (DAC).

SQL Server provides a special type of connection only for administrators when standard connections to your sql server instance are not possible. This DAC connection can be made through sqlcmd utility as well as SQL Server management studio.

There are many restrictions also with DAC. Some of them are listed below:

1-The connection is only allowed from a client running on the server.

2-Only one DAC connection is allowed at a time.

3-You can’t execute Backup and Restore commands.

Now I am just sharing a problem for which DAC works as a solution.

Problem:

I installed a SQL Server named instance on a developer system WIN-MT83DWDEO82\SQLSTAND2008R2B with mixed mode authentication (along with windows user account and SA login). But after the installation developer delete the windows user account from sql server, and also set the default database TEST1 for user SA. After some days he deleted that database TEST1 from SSMS. Next time when he wants to open SSMS with SA login but he failed, error comes again and again “default database can’t access”. Now there is only one administrator account in sql server which is SA.

1_SQL_Server_Dedicated_Administrator_Connection_(DAC)_in_SQL_Server

Solution:

To solve the above problem I used DAC- Dedicated Administer Connection

Step 1: Go to Start -> Run then Type

sqlcmd -SADMIN:WIN-MT83DWDEO82\SQLSTAND2008R2B -dmaster -Usa -Psql2008

then press Enter, this will open up sqlcmd utility connected with given SQL Server Instance.

   

2_SQL_Server_Dedicated_Administrator_Connection_(DAC)_in_SQL_Server

Step 2: In sqlcmd change the default database for that user

ALTER LOGIN [SA] WITH DEFAULT_DATABASE=[master]
GO
EXIT

3_SQL_Server_Dedicated_Administrator_Connection_(DAC)_in_SQL_Server

Now the problem is solved , user can open SSMS with SA login because now the default database for that user is master.

 

Regards

Prince Rastogi

Like us on FaceBook Follow us on Twitter | Join the fastest growing SQL Server group on FaceBook

Follow me on TwitterFollow me on FaceBook

   

About Prince Rastogi

Prince Rastogi is working as Database Administrator at Elephant Insurance, Richmond. He is having more than 8 years of experience and worked in ERP Domain, Wealth Management Domain. Currently he is working in Insurance domain. In the starting of his career he was working on SQL Server, Internet Information Server and Visual Source Safe. He is post graduate in Computer Science. Prince is ITIL certified professional. Prince likes to explore technical things for Database World and Writing Blogs. He is Technical Editor and Blogger at SQLServerGeeks.com. He is a regular speaker at DataPlatformDay events in Delhi NCR. He has also presented some in depth sessions about SQL Server in SQL Server Conferences in Bangalore.

View all posts by Prince Rastogi →

2 Comments on “SQL Server Dedicated Administrator Connection (DAC)”

Leave a Reply

Your email address will not be published.