1.1 DAC- Dedicated Administrator Connection (DAC) – ADMIN: keyword prefix with our id. If you use SQLCMD, you can use the ADMIN: prefix or use the -A switcho sys.endpoints / sys.tcp_endpointso Since each connection uses an endpoint, I can join to this table to find out which connection is using the DAC. The sys.dm_exec_sessions DMV contains a column, endpoint_id, that is useful to join back to this table. With this information, I can write a query such as this:§ One job can monitor daily basis who connected as DAC will be usefulSELECT s.session_id , e.name AS Endpoint , s.login_name , s.nt_domain , s.nt_user_name , s.login_time , s.host_name , s.program_name FROM sys.dm_exec_sessions s INNER JOIN sys.endpoints e ON e.endpoint_id = s.endpoint_id--WHERE e.is_admin_endpoint = 1
|