Sql Server 2005 专用管理员连接 (DAC) 使用技巧
Sql Server 2005 专用管理员连接 (DAC) 使用技巧
1 什么是专用管理员连接?
SQL Server 2005 为管理员提供了一种特殊的诊断连接,以供在无法与服务器建立标准连接时使用。
2 专用管理员连接有什么用?
即使在 SQL Server 不响应标准连接请求时,管理员也可以使用这种连接访问 SQL Server,以便执行诊断查询并解决问题。
管理员可以通过 DAC 访问正在运行的 SQL Server Database Engine 实例来排除服务器的故障(即使该服务器已停止响应其他客户端连接)。
3 专用管理员连接使用方法
(1)利用sqlcmd
sqlcmd -Sqiangguoods -A
sqlcmd -Sadmin:qiangguoods
(2)SQL Server Management Studio 查询编辑器启动 DAC
admin:
如:ADMIN:QIANGGUOODS
4 专用管理员连接使用限制
(1)为了保证有可用的连接资源,每个 SQL Server 实例只允许使用一个 DAC。如果 DAC 连接已经激活,则通过 DAC 进行连接的任何新请求都将被拒绝,并出现错误 17810。
(2)DAC 最初尝试连接到与登录帐户关联的默认数据库。连接成功后,可以连接到 master 数据库。如果默认数据库离线或不可用,则连接返回错误 4060。但是,如果使用以下命令覆盖默认数据库,改为连接到 master 数据库,则连接会成功:
sqlcmd –A –d master
由于只要启动数据库引擎 实例,就能保证 master 数据库处于可用状态,因此建议使用 DAC 连接到 master 数据库。
(4)SQL Server 禁止使用 DAC 运行并行查询或命令。例如,如果使用 DAC 执行以下任何命令,都会生成错误 3637。
RESTORE或BACKUP
(5)DAC 只能使用有限的资源。请勿使用 DAC 运行需要消耗大量资源的查询(例如,对大型表执行复杂的联接)或可能造成阻塞的查询。这有助于防止将 DAC 与任何现有的服务器问题混淆。为避免潜在的阻塞情况,当需要运行可能造成阻塞的查询时,
请尽可能在基于快照的隔离级别下运行查询;否则,请将事务隔离级别设置为 READ UNCOMMITTED 和/或将 LOCK_TIMEOUT 值设置为较短的值(如 2000 毫秒)。这可以防止 DAC 会话被阻塞。
但是,根据 SQL Server 所处的状态,DAC 会话可能会在闩锁上被阻塞。可以使用 CNTRL-C 终止 DAC 会话,但不能保证一定成功。如果失败,唯一的选择是重新启动 SQL Server。
为保证连接成功并排除 DAC 故障,SQL Server 保留了一定的资源用于处理 DAC 上运行的命令。通常这些资源只够执行简单的诊断和故障排除功能,如下所示。
为了保留资源,DAC 连接在 SQL Server 2005 Express Edition 中不可用。
5 如何启用远程DAC连接?
只有 SQL Server sysadmin 角色的成员可以使用 DAC 连接。默认情况下,只能从服务器上运行的客户端建立连接。除非通过 sp_configure 使用 remote admin connections 选项进行配置,否则不允许使用网络连接。
DAC 支持加密和 SQL Server 的其他安全性功能。DAC 只允许将用户上下文切换到其他管理用户。
默认情况下,DAC 仅侦听环回 IP 地址 (127.0.0.1) 端口 1434。
remote admin connections 设置的可能值如下:
0 - 指明仅允许本地连接使用 DAC
1 - 指明允许远程连接使用 DAC
--启用远程DAC连接
sp_configure 'remote admin connections', 1;
GO
RECONFIGURE;
GO
注意:配置远程管理连接之后,会立即启用 DAC 侦听器而不必重新启动 SQL Server,并且客户端可以立即远程连接到 DAC。
6 常用脚本
--利用sqlcmd
sqlcmd -Sqiangguoods -A
sqlc

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

The message "Your organization has asked you to change your PIN" will appear on the login screen. This happens when the PIN expiration limit is reached on a computer using organization-based account settings, where they have control over personal devices. However, if you set up Windows using a personal account, the error message should ideally not appear. Although this is not always the case. Most users who encounter errors report using their personal accounts. Why does my organization ask me to change my PIN on Windows 11? It's possible that your account is associated with an organization, and your primary approach should be to verify this. Contacting your domain administrator can help! Additionally, misconfigured local policy settings or incorrect registry keys can cause errors. Right now

Windows 11 brings fresh and elegant design to the forefront; the modern interface allows you to personalize and change the finest details, such as window borders. In this guide, we'll discuss step-by-step instructions to help you create an environment that reflects your style in the Windows operating system. How to change window border settings? Press + to open the Settings app. WindowsI go to Personalization and click Color Settings. Color Change Window Borders Settings Window 11" Width="643" Height="500" > Find the Show accent color on title bar and window borders option, and toggle the switch next to it. To display accent colors on the Start menu and taskbar To display the theme color on the Start menu and taskbar, turn on Show theme on the Start menu and taskbar

By default, the title bar color on Windows 11 depends on the dark/light theme you choose. However, you can change it to any color you want. In this guide, we'll discuss step-by-step instructions for three ways to change it and personalize your desktop experience to make it visually appealing. Is it possible to change the title bar color of active and inactive windows? Yes, you can change the title bar color of active windows using the Settings app, or you can change the title bar color of inactive windows using Registry Editor. To learn these steps, go to the next section. How to change title bar color in Windows 11? 1. Using the Settings app press + to open the settings window. WindowsI go to "Personalization" and then

Taskbar thumbnails can be fun, but they can also be distracting or annoying. Considering how often you hover over this area, you may have inadvertently closed important windows a few times. Another disadvantage is that it uses more system resources, so if you've been looking for a way to be more resource efficient, we'll show you how to disable it. However, if your hardware specs can handle it and you like the preview, you can enable it. How to enable taskbar thumbnail preview in Windows 11? 1. Using the Settings app tap the key and click Settings. Windows click System and select About. Click Advanced system settings. Navigate to the Advanced tab and select Settings under Performance. Select "Visual Effects"

HQL and SQL are compared in the Hibernate framework: HQL (1. Object-oriented syntax, 2. Database-independent queries, 3. Type safety), while SQL directly operates the database (1. Database-independent standards, 2. Complex executable queries and data manipulation).

We all have different preferences when it comes to display scaling on Windows 11. Some people like big icons, some like small icons. However, we all agree that having the right scaling is important. Poor font scaling or over-scaling of images can be a real productivity killer when working, so you need to know how to customize it to get the most out of your system's capabilities. Advantages of Custom Zoom: This is a useful feature for people who have difficulty reading text on the screen. It helps you see more on the screen at one time. You can create custom extension profiles that apply only to certain monitors and applications. Can help improve the performance of low-end hardware. It gives you more control over what's on your screen. How to use Windows 11

Screen brightness is an integral part of using modern computing devices, especially when you look at the screen for long periods of time. It helps you reduce eye strain, improve legibility, and view content easily and efficiently. However, depending on your settings, it can sometimes be difficult to manage brightness, especially on Windows 11 with the new UI changes. If you're having trouble adjusting brightness, here are all the ways to manage brightness on Windows 11. How to Change Brightness on Windows 11 [10 Ways Explained] Single monitor users can use the following methods to adjust brightness on Windows 11. This includes desktop systems using a single monitor as well as laptops. let's start. Method 1: Use the Action Center The Action Center is accessible

In iOS 17, Apple introduced several new privacy and security features to its mobile operating system, one of which is the ability to require two-step authentication for private browsing tabs in Safari. Here's how it works and how to turn it off. On an iPhone or iPad running iOS 17 or iPadOS 17, Apple's browser now requires Face ID/Touch ID authentication or a passcode if you have any Private Browsing tab open in Safari and then exit the session or app to access them again. In other words, if someone gets their hands on your iPhone or iPad while it's unlocked, they still won't be able to view your privacy without knowing your passcode
