Posts

Showing posts from May, 2019

SQL SERVER Dedicated Administrator Connection (DAC) enabled and how to connect.

Image
In the SQL Server 2000 and earlier days it was all too often I found myself resorting to a server reboot to get control of my database server or access to a single database that had an issue. One of the best additions to the SQL Server feature set was the Dedicated Administrator Connection (DAC). Prior to this being a part of the platform, an overloaded instance might not even allow a DBA to connect and perform any actions. So lets look at if DAC is enabled and also look at determining who is connecting to your instance with the DAC. In general, the DAC should be left open on your instances and not used. If you have used it in an emergency, it's possible that you might reconnect to that instance as a part of your daily work and use the DAC. If someone else had the need to connect in an emergency, they wouldn't be able to since only one connection is allowed. How to making the Connection to DAC. By default the DAC is only available from the server itself. If you want to al...

Changing DB ownership to sa account for all databases not SA

As we know, when we create database on SQL Server instance, SQL Server engine sets the login that created the database as the default database owner. This gives the user full control on the database, meaning he/she can do whatever they like on that particular database. According to the SQL Server security best practice document, we should grant login with the least amount of privileges. Therefore, it is recommended to set built-in sa account as an owner of all databases on SQL Server instance. This will make database and server more secure. How to identify the ownership of the system and user databases on SQL Server instance? You can use SQL Server Management Studio to view the database owner. Follow these steps to view the database owner using SQL Server 2014 Management Studio: In SQL Server Management Studio, connect to an instance of the SQL Server Database Engine with Object Explorer. In Object Explorer, right-click the database for which you want to check the database owner...