Microsoft SQL Server 需要特定使用者角色,才能執行特定作業。如要在 SQL Server 資料庫上執行 Backup and DR 擷取、還原、解除掛接、刪除和虛擬應用程式掛接作業,您必須提供 Windows 使用者 (本機使用者或網域使用者) 的憑證,該使用者必須具備足夠的 SQL 權限角色,才能執行作業。
本節詳細說明從備份/復原裝置執行擷取、還原、卸載、刪除和虛擬應用程式掛接作業所需的使用者角色。本節列出的建議角色是根據 Microsoft 存取 SQL Server 資料庫的最佳做法。
如要執行擷取、還原、解除掛接刪除和虛擬應用程式掛接作業,必須使用在 SQL 環境中具備足夠權限的 Microsoft Windows 使用者憑證,安裝 Backup and DR 代理程式。必須為 Windows 使用者指派特定角色。Microsoft Windows 使用者可以是新建立的使用者,也可以是現有使用者。
Windows 使用者必須具備的 SQL 角色
指派給 sysadmin 伺服器角色的 Windows 本機管理員使用者,擁有執行 Backup and DR 擷取、還原和虛擬應用程式掛接作業的所有必要權限。
如果 sysadmin 伺服器角色過於寬鬆,請將下列角色指派給 Windows 使用者:
dbcreator 伺服器角色
db_backupoperator 資料庫角色
db_owner 資料庫角色
此外,這類使用者也必須獲派下列可保護資源:
查看任何資料庫
建立任何資料庫
變更任何資料庫
連結 SQL
以下各節詳細說明在何處輸入 Windows 本機管理員的使用者名稱和密碼,以執行特定的 Backup and DR SQL 相關作業。
擷取 SQL Server 資料庫記錄的憑證
將備份計畫政策範本套用至 SQL Server 資料庫時,如果範本包含擷取資料庫記錄的政策,您必須在應用程式的備份計畫應用程式詳細資料和設定中,輸入已在管理主控台中指派適當角色的 Windows 使用者憑證。
還原 Microsoft SQL Server 資料庫的憑證
從管理控制台還原 SQL Server 資料庫時,請在「還原」對話方塊中,輸入已指派適當角色的 Windows 使用者憑證。
將 SQL Server 資料庫掛接為虛擬應用程式的憑證
虛擬應用程式掛接會將 SQL Server 資料庫掛接為虛擬應用程式。從備份/復原裝置執行 SQL Server 資料庫的虛擬應用程式掛接時,使用者必須獲派可掛接及卸載 (分離) SQL Server 資料庫的角色。
執行虛擬應用程式掛接時,請在「Mount」(掛接) 對話方塊的「Advanced options」(進階選項) 中,輸入已獲派適當角色的 Windows 使用者憑證。
備份和災難復原 Microsoft SQL Server DBA 指南
本頁面是系列頁面之一,專門介紹如何使用 Backup and DR 保護及還原 Microsoft SQL Server 資料庫。如需更多資訊,請參閱:
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-04 (世界標準時間)。"],[[["\u003cp\u003eMicrosoft SQL Server operations like backup, restore, and mounting require a Windows user with specific SQL privileges.\u003c/p\u003e\n"],["\u003cp\u003eA Windows user with the \u003ccode\u003esysadmin\u003c/code\u003e server role has all necessary permissions, but if this is deemed too liberal, the roles \u003ccode\u003edbcreator\u003c/code\u003e, \u003ccode\u003edb_backupoperator\u003c/code\u003e, and \u003ccode\u003edb_owner\u003c/code\u003e, along with securables like "View any database," "Create any database," "Alter any database," and "Connect SQL" are an alternative.\u003c/p\u003e\n"],["\u003cp\u003eCredentials for a Windows user with the appropriate roles are necessary when capturing database logs, restoring databases, or mounting a database as a virtual application.\u003c/p\u003e\n"],["\u003cp\u003eThe Backup and DR agent must be installed using the credentials of a Microsoft Windows user who has sufficient privileges in the SQL environment.\u003c/p\u003e\n"],["\u003cp\u003eImproperly defined users or roles can lead to Backup and DR job failures, security violations, and potential data loss, so a qualified administrator must define them.\u003c/p\u003e\n"]]],[],null,["# Prepare SQL Server databases for Backup and DR Service\n\nMicrosoft SQL Server requires specific user roles to perform specific\noperations. To perform Backup and DR capture, restore, unmount,\ndelete, and virtual application mount operations on a SQL Server database, you\nmust provide credentials for a Windows user---a local user or a domain\nuser---who has a role with sufficient SQL privileges to perform the\noperation.\n\nThis section details the user roles required to perform capture, restore,\nunmount, delete, and virtual application mount operations from a\nbackup/recovery appliance. The recommended roles presented in this section are\nbased on Microsoft's best practices for accessing SQL Server databases.\n\nBefore you begin, it's a good idea to review [Backup and DR for SQL\nServer databases](/backup-disaster-recovery/docs/concepts/sql-intro).\n| **Note:** Creating users and assigning roles must be done by qualified system and database administrators. If users are improperly defined, or roles are improperly applied, the result can lead to Backup and DR job failure, security violations, and possible data loss.\n\nWindows local administrator user\n--------------------------------\n\nTo perform capture, restore, unmount delete, and virtual application mounts, the\nBackup and DR agent must be installed with the credentials of a\nMicrosoft Windows user who has sufficient privileges in the SQL environment. The\nWindows user must be assigned a specific role or roles. The Microsoft Windows\nuser can be a newly created or existing user.\n\nRequired SQL roles for the Windows user\n---------------------------------------\n\nA Windows local administrator user assigned to the `sysadmin` server role has\nall necessary permissions to perform Backup and DR capture, restore\nand virtual application mounts.\n\nIf the `sysadmin` server role is deemed too liberal, then assign a\nWindows user the following roles:\n\n- `dbcreator` server role\n\n- `db_backupoperator` database role\n\n- `db_owner` database role\n\nIn addition, such users must also be assigned the following securables:\n\n- View any database\n\n- Create any database\n\n- Alter any database\n\n- Connect SQL\n\nThe following sections detail where to enter the Windows local admin's username\nand password to perform specific Backup and DR SQL related operations.\n| **Note:** In the following procedures, when entering user names, in most cases the domain name and user name---domain or username---format is sufficient. In rare cases, entering the domain name or username returns the error `Logon failure: unknown user name or bad password [1326]` In such cases, use the fully qualified domain name format `(username@fqdn\u003c/span\u003e_)` to address the problem.\n\n### Credentials for capturing SQL Server database logs\n\nWhen applying a backup plan policy template to a SQL Server database, if the\ntemplate contains a policy that captures database logs you must enter\ncredentials of a Windows user assigned the proper roles in the management\nconsole in the application's backup plan application details and settings.\n| **Note:** Credentials are required for logs; they are not required if only databases are being captured.\n\n### Credentials for restoring a Microsoft SQL Server database\n\nWhen restoring SQL Server databases from the management console, in the\n**Restore** dialog, enter credentials of a Windows user assigned the\nproper roles.\n\n### Credentials for mounting a SQL Server database as a virtual application\n\nA virtual application mount mounts a SQL Server database as a virtual\napplication. When performing a virtual application mount of a SQL Server\ndatabase from a backup/recovery appliance, the user must be assigned a role that\nallows both the ability to mount and unmount---detach---the SQL Server\ndatabase.\n\nWhen performing a virtual application mount, in the **Mount** dialog\n**Advanced options**, enter the credentials of a Windows user assigned the\nproper roles.\n\nThe Backup and DR Microsoft SQL Server DBA guide\n------------------------------------------------\n\nThis page is one in a series of pages specific to protecting and recovering\nMicrosoft SQL Server databases with Backup and DR.\nYou can find additional information at:\n\n- [Backup and DR for Microsoft SQL Server Databases](/backup-disaster-recovery/docs/concepts/backupdr-for-sql-server)\n- [Prepare SQL Server databases for Backup and DR Service](/backup-disaster-recovery/docs/configuration/prepare-sql-server)\n- [Add a SQL Server database host and discover databases](/backup-disaster-recovery/docs/configuration/discover-sql-server)\n- [Configure backup plans for Microsoft SQL Server instances and databases](/backup-disaster-recovery/docs/backup/back-up-sql-server)\n- [Application details and settings for Microsoft SQL Server instances and databases](/backup-disaster-recovery/docs/backup/app-details-settings-sql-server)\n- [Mount a SQL Server database](/backup-disaster-recovery/docs/access-data/mount-sql-server)\n- [Mount databases into SQL Always On Availability Groups](/backup-disaster-recovery/docs/access-data/mount-sql-server-aag)\n- [Manage an active mount](/backup-disaster-recovery/docs/access-data/manage-active-mounts)\n- [Migrate a SQL Server database](/backup-disaster-recovery/docs/access-data/mount-and-migrate-sql-server-2)\n- [Clone SQL Server databases](/backup-disaster-recovery/docs/access-data/clone-sql-server)\n- [Recover SQL Server backups](/backup-disaster-recovery/docs/restore-data/restore-sql-server)"]]