在SQL Server2000以前,如果数据库的CPU使用率突然达到100%,可能会令DBA束手无策,平时强大的企业管理器和查询分析器甚至根本无法再连入服务器,无奈之下也许只有强行重启服务,但重启服务造成的系统中断可能会让你的Boss相当不满,而失去的现场信息可能给排查原因造成困难。
微软也意识到了这个问题,SQL Server 2005中提供了一个叫做Dedicated Administration Connection(DAC)的特性,可以让你在这种情况下连进服务器。
该特性在新提供的命令行工具sqlcmd(使用-A选项)和图形管理工具SQL Server Management Studio中都可以使用。
默认情况下,只能在服务器所在的机器上进行连接。使用Surface Area Configuration配置(Enable remote DAC)后,可以通过网络使用DAC连接服务器。
通过SSMS使用DAC连接服务器的步骤如下(引自MSDN):
In SQL Server Management Studio, with no other DACs open, on the toolbar, click Database Engine Query.
In the Connect to Database Engine dialog box, in the Server name box, type ADMIN: followed by the name of the server instance. For example, to connect to a server instance named ACCTPAYABLE, type ADMIN:ACCTPAYABLE.
Complete the Authentication section, providing credentials for a member of the sysadmin group, and then click Connect.
The connection is made.
If the DAC is already in use, the connection will fail with an error indicating it cannot connect.
DAC是在紧急情况下能够连入服务器的一种连接方式,所以也有很多的限制:
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/193161/viewspace-50335/ ,如需转载,请注明出处,否则将追究法律责任。