Veeam SQL Server 數據庫發布失敗,出現意外錯誤程式碼 3
因此,我們已經對 Veeam Backup & Replication 進行了一段時間的試驗。我們為 Veeam Backup Server 設置了一個專用虛擬機,該虛擬機執行我們所有基礎架構組件的每日備份。我們還沒有獲得許可證,所以這是我們正在測試的社區版本(版本11a 建構 11.0.1.1261 P20220302)
我們有一些帶有包含數據庫的 SQL Server 實例的 VM。我們使用 Veeam 的應用程序處理選項來備份數據庫並將它們包含在備份文件中。
但是,當我們嘗試從備份文件(無論是在 Veeam Backup Server 機器上還是另一臺本地機器上)執行數據庫恢復時,我們會遇到問題。我們按照Veeam B&R 文件中的說明執行應用程序項目恢復,然後使用 Veeam SQL Explorer 完成將數據發佈到本地(暫存)SQL Server 的步驟。我們嘗試過發布數據庫、恢復 .BAK 文件,甚至直接保存 MDF 和 LDF 文件。所有操作都因缺少權限而失敗(請參閱下面的 Veeam SQL Explorer 日誌)。
11/04/2022 00:17:32 21 (8876) Connecting to SQL Server localhost\SQL2019 using Windows authentication (username: WIN-KB0LJQ6QU6L\Administrator)... 11/04/2022 00:17:32 21 (8876) Connection completed successfully. 11/04/2022 00:17:32 21 (8876) Checking database version compatibility (server: Microsoft SQL Server 2014, database version: 782)... 11/04/2022 00:17:32 21 (8876) Target server (localhost\SQL2019) is identified as Microsoft SQL Server 2019 (version: 904). 11/04/2022 00:17:32 21 (8876) Connecting to SQL Server localhost\SQL2019 using Windows authentication (username: WIN-KB0LJQ6QU6L\Administrator)... 11/04/2022 00:17:32 21 (8876) Connecting to SQL Server localhost\SQL2019 using Windows authentication (username: WIN-KB0LJQ6QU6L\Administrator)... 11/04/2022 00:17:32 21 (8876) Validating account permissions for server 'localhost'... 11/04/2022 00:17:32 21 (8876) Validation completed successfully. 11/04/2022 00:17:33 16 (9136) Publishing database... 11/04/2022 00:17:33 16 (9136) Restore point ID: 3147eb18-d76a-47f1-ab4c-ec5a67dd81f1 11/04/2022 00:17:33 16 (9136) SQL server: localhost\SQL2019 11/04/2022 00:17:33 16 (9136) Database name: bigsoft_33o_vide 11/04/2022 00:17:33 16 (9136) Connecting to SQL Server localhost\SQL2019 using Windows authentication (username: WIN-KB0LJQ6QU6L\Administrator)... 11/04/2022 00:17:34 17 (11180) Getting Instant Recovery sessions... 11/04/2022 00:17:34 17 (11180) New USN value: 5113 11/04/2022 00:17:34 17 (11180) Loaded 0 Instant Recovery sessions 11/04/2022 00:17:34 17 (11180) Loading databases completed 11/04/2022 00:17:37 19 (9280) Getting Instant Recovery sessions... 11/04/2022 00:17:37 19 (9280) New USN value: 5114 ... 11/04/2022 00:18:05 16 (9136) Database publish failed 11/04/2022 00:18:05 16 (9136) Error: Method failed with unexpected error code 3. 11/04/2022 00:18:05 16 (9136) Type: System.InvalidOperationException 11/04/2022 00:18:05 16 (9136) Stack: 11/04/2022 00:18:05 16 (9136) at System.Security.AccessControl.NativeObjectSecurity.CreateInternal(ResourceType resourceType, Boolean isContainer, String name, SafeHandle handle, AccessControlSections includeSections, Boolean createByName, ExceptionFromErrorCode exceptionFromErrorCode, Object exceptionContext) at System.Security.AccessControl.FileSystemSecurity..ctor(Boolean isContainer, String name, AccessControlSections includeSections, Boolean isDirectory) at System.Security.AccessControl.FileSecurity..ctor(String fileName, AccessControlSections includeSections) at System.IO.FileInfo.GetAccessControl(AccessControlSections includeSections) at Veeam.Engine.Security.FileAccess.GetAccessControl(String path, AccessControlSections sections) at Veeam.Engine.Security.FileSystemSecurity.HasFileAccess(String accountName, String path) at Veeam.Engine.FileSystem.LocalAccessChecker.GrantFileAccess(String filePath) at Veeam.SQL.Core.Extensions.AccessCheckerExtension.CheckDatabaseFilesAccess(IAccessChecker accessChecker, IDatabaseFiles databaseFiles, String permissionSourceFolder) at Veeam.SQL.Restore.Publish.RestorePointDatabasePublisher.Publish(ISqlBroker broker, ISqlConnectProvider sqlConnectProvider, IPublishConfig config, Boolean isClustered, ISqlActionsObserver observer, CancellationToken ct) at Veeam.SQL.Restore.Publish.DatabasePublisher.Publish(ISqlBroker sqlBroker, ISqlConnectProvider sqlConnectProvider, IPublishConfig config, ISqlActionsObserver observer, CancellationToken ct) at Veeam.SQL.Restore.Publish.DatabasePublisher.Publish(ISqlConnectProvider sqlConnectProvider, IPublishConfig config, ISqlActionsObserver observer, CancellationToken ct) at Veeam.SQL.Restore.Publish.DatabasePublisher.Publish(IPublishConfig config, ISqlActionsObserver observer, CancellationToken ct) at Veeam.SQL.Restore.Publish.LoggedDatabasePublisher.Publish(IPublishConfig config, ISqlActionsObserver observer, CancellationToken ct) 11/04/2022 00:18:06 1 (6504) Database publish failed 11/04/2022 00:18:06 1 (6504) Error: Method failed with unexpected error code 3. 11/04/2022 00:18:06 1 (6504) Type: System.InvalidOperationException 11/04/2022 00:18:06 1 (6504) Stack: 11/04/2022 00:18:06 1 (6504) at System.Security.AccessControl.NativeObjectSecurity.CreateInternal(ResourceType resourceType, Boolean isContainer, String name, SafeHandle handle, AccessControlSections includeSections, Boolean createByName, ExceptionFromErrorCode exceptionFromErrorCode, Object exceptionContext) at System.Security.AccessControl.FileSystemSecurity..ctor(Boolean isContainer, String name, AccessControlSections includeSections, Boolean isDirectory) at System.Security.AccessControl.FileSecurity..ctor(String fileName, AccessControlSections includeSections) at System.IO.FileInfo.GetAccessControl(AccessControlSections includeSections) at Veeam.Engine.Security.FileAccess.GetAccessControl(String path, AccessControlSections sections) at Veeam.Engine.Security.FileSystemSecurity.HasFileAccess(String accountName, String path) at Veeam.Engine.FileSystem.LocalAccessChecker.GrantFileAccess(String filePath) at Veeam.SQL.Core.Extensions.AccessCheckerExtension.CheckDatabaseFilesAccess(IAccessChecker accessChecker, IDatabaseFiles databaseFiles, String permissionSourceFolder) at Veeam.SQL.Restore.Publish.RestorePointDatabasePublisher.Publish(ISqlBroker broker, ISqlConnectProvider sqlConnectProvider, IPublishConfig config, Boolean isClustered, ISqlActionsObserver observer, CancellationToken ct) at Veeam.SQL.Restore.Publish.DatabasePublisher.Publish(ISqlBroker sqlBroker, ISqlConnectProvider sqlConnectProvider, IPublishConfig config, ISqlActionsObserver observer, CancellationToken ct) at Veeam.SQL.Restore.Publish.DatabasePublisher.Publish(ISqlConnectProvider sqlConnectProvider, IPublishConfig config, ISqlActionsObserver observer, CancellationToken ct) at Veeam.SQL.Restore.Publish.DatabasePublisher.Publish(IPublishConfig config, ISqlActionsObserver observer, CancellationToken ct) at Veeam.SQL.Restore.Publish.LoggedDatabasePublisher.Publish(IPublishConfig config, ISqlActionsObserver observer, CancellationToken ct) at Veeam.SQL.Restore.Publish.AuditedDatabasePublisher.Publish(IPublishConfig config, ISqlActionsObserver observer, CancellationToken ct) at Veeam.SQL.Restore.Publish.StoringDatabasePublisher.Publish(IPublishConfig config, ISqlActionsObserver observer, CancellationToken ct) at Veeam.SQL.Restore.Publish.PublishService.Publish(IPublishConfig config, ISqlActionsObserver observer, CancellationToken ct) at Veeam.SQL.Explorer.Async.Publish.AsyncPublishDatabaseTask.Run(IProcessObserver observer, CancellationToken ct) at Veeam.Presentation.Async.VisualAsyncTask.Execute(IProcessObserver observer)
請注意,Veeam 作為本地系統帳戶安裝在 Veeam Backup Server 上,使用 Windows 身份驗證登錄的使用者屬於管理員組。此外,在我們的本地電腦中,我們導入了備份並測試了在 Windows Server 2019 上以“管理員”使用者身份執行所有內容(Veeam 服務、Veeam 使用者帳戶和 sql explorer 服務),但權限問題仍然存在。
此問題適用於特別熟悉 Veeam 的任何人,或者任何了解一般錯誤消息以及如何通過在 Windows 中提供完整權限來繞過它的人。
聯繫支持後發現,問題在於我的備份中沒有包含 SQL Server DATA 目錄。我認為 Veeam 會為我做這件事,因為它允許我啟動應用程序處理。我不記得在文件中看到任何關於此的細節,否則我可能會錯過它。
這也可以通過選擇整台電腦進行備份或對 C 驅動器進行卷備份來緩解。顯然,無論如何都建議保存完整的機器以進行即時恢復。
只需包含 DATA 目錄,所有模棱兩可的錯誤就消失了。