GO
输出:
Configuration option 'remote admin connections' changed from 0 to 1. Run the RECONFIGURE statement to install.
然后开启SQL Server Browser服务,防火墙允许TCP 1434端口的访问。
我们通过另一台服务器上的SSMS建立DAC查询连接,选择File菜单,下拉菜单选择“New”、“Database Engine Query”。
《SQL Server 2012 Internals》有这么一段话:
“
SQL Server maintains a set of tables that store information about all objects, data types, constraints,confguration options, and resources available to SQL Server. In SQL Server 2012, these tables are called the system base tables. Some of the system base tables exist only in the master database and contain system-wide information; others exist in every database (including master) and contain information about the objects and resources belonging to that particular database. Beginning with SQL Server 2005, the system base tables aren’t always visible by default, in master or any other database. You won’t see them when you expand the tables node in the Object Explorer in SQL Server Management Studio, and unless you are a system administrator, you won’t see them when you execute the sp_help system procedure. If you log on as a system administrator and select from the catalog view called sys.objects (discussed shortly), you can see the names of all the system tables. For example, the following query returns 74 rows of output on my SQL Server 2012 instance:
USE master;
SELECT name FROM sys.objects
WHERE type_desc = 'SYSTEM_TABLE';
But even as a system administrator, if you try to select data from one of the tables returned by the preceding query, you get a 208 error, indicating that the object name is invalid.The only way to see the data in the system base tables is to make a connection using the dedicated administrator connection (DAC), which Chapter 2, “The SQLOS,” explains in the section> ”
例如,在SSMS中连接普通查询连接,输入:
SELECT * FROM sys.sysrmtlgns; 输出:
Msg 208, Level 16, State 1, Line 1
Invalid object name 'sys.sysrmtlgns'.
建立DAC连接,输入:
SELECT net_transport,auth_scheme,client_net_address FROM sys.dm_exec_connections WHERE session_id=@@spid;
SELECT * FROM sys.sysrmtlgns;