適用於:SQL Server
Azure SQL Database
Azure SQL 受控實例
Microsoft Fabric 中的 SQL 資料庫
您可以使用 SQL Server Management Studio 中的 [刪除資料層應用程式精靈] 來刪除已註冊的數據層應用程式。 您可以指定相關聯的資料庫是否保留、中斷連結或卸載。
- 開始之前:限制及限制條件、許可權
- To delete a DAC :The Register Data-tier Application Wizard
開始之前
當您刪除已註冊的數據層應用程式 (DAC) 實例時,您可以選擇三個選項之一,以指定與資料層應用程式相關聯的資料庫所要執行的工作。 這三個選項都會從資料庫刪除 DAC 定義元數據。 這些選項在處理與數據層應用程式關聯的資料庫方面有所不同。 精靈不會刪除任何與 DAC 或資料庫相關聯的實例層級物件,例如登入。
選項 | 資料庫動作 |
---|---|
刪除註冊 | 相關聯的資料庫會保持不變。 |
卸離資料庫 | 相關聯的資料庫已中斷連結。 Database Engine 的實例無法參考資料庫,但數據和記錄檔保持不變。 |
刪除資料庫 | 已刪除相關聯的資料庫。 刪除資料和記錄檔。 |
限制與限制條件
在您刪除 DAC 之後,沒有自動機制可還原 DAC 定義元數據或資料庫。 如何手動重建 DAC 實例取決於刪除選項。
選項 | 如何重建 DAC 實例 |
---|---|
刪除註冊 | Register a DAC from the database left in place. |
卸離資料庫 | 使用 sp_attachdb 或 SQL Server Management Studio 重新附加資料庫,然後從資料庫註冊新的 DAC 實例。 |
刪除資料庫 | 從刪除 DAC 之前建立的完整備份還原資料庫,然後從資料庫註冊新的 DAC 實例。 |
警告
Rebuilding a DAC instance by registering a DAC from a restored or reattached database doesn't recreate some parts of the original DAC, such as the server selection policy.
權限
DAC 只能由 系統管理員成員 或 serveradmin 固定伺服器角色或資料庫擁有者刪除。 名為 sa 的內建 SQL Server 系統管理員帳戶也可以啟動精靈。
Use the Delete Data-tier Application Wizard
To Delete a DAC Using a Wizard
- In Object Explorer, expand the node for the instance containing the DAC to be deleted.
- Expand the Management node.
- Expand the Data-tier Applications node.
- 以滑鼠右鍵按下要刪除的 DAC,然後選取 [刪除資料層應用程式...
- 完成嚮導對話框:
簡介頁面
此頁面描述刪除資料層應用程式的步驟。
不要再顯示此頁面。 - 選取複選框,以阻止頁面在未來顯示。
Next > - Proceeds to the Choose Method page.
Cancel - Ends the wizard without deleting a data-tier application or database.
Choose Method Page
使用此頁面指定選項,以處理與要刪除之 DAC 相關聯的資料庫。
刪除註冊 - 移除定義數據層應用程式的元數據,但讓相關聯的資料庫保持不變。
分離資料庫 - 移除定義資料層應用程式的元數據,並分離相關的資料庫。
資料庫無法供該 Database Engine 實例參考,但數據和記錄檔會保持不變。
刪除資料庫 - 移除定義 DAC 的元數據,並卸除相關聯的資料庫。
資料庫的數據和記錄檔會永久刪除。
< Previous - Returns to the Introduction page.
Next > - Proceeds to the Summary page.
取消 - 結束精靈而不刪除 DAC 或資料庫。
摘要頁面
使用此頁面來檢閱精靈在刪除 DAC 實例時採取的動作。
檢閱選取摘要 - 檢閱方塊中顯示的 DAC、資料庫和刪除方法。 如果資訊正確,請選取 [下一步 ] 或 [完成 ] 以刪除 DAC。 如果 DAC 和資料庫資訊不正確,請選取 [取消],然後選取正確的 DAC。 如果刪除方法不正確,請選取 [上一個],返回 [選擇方法] 頁面,然後選取不同的方法。
< 上一個 - 返回 選擇方法 頁面,以選擇不同的刪除方法。
[下一步] > - 使用您在上一頁選擇的方法刪除 DAC 實例,然後前往 [刪除數據層應用程式] 頁面。
Cancel - Ends the wizard without deleting the DAC instance.
刪除資料層應用程式頁面
此頁面會報告刪除作業的成功或失敗。
刪除 DAC - 報告刪除 DAC 實例所採取之每個動作的成功或失敗。 檢閱資訊,以判斷每個動作的成功或失敗。 Any action that encountered an error has a link in the Result column. 選取連結以檢視該動作的錯誤報告。
[儲存報表] - 選取此按鈕以將刪除報表儲存至 HTML 檔案。 檔案會報告每個動作的狀態,包括任何動作所產生的所有錯誤。 默認資料夾是 Windows 帳戶 [檔] 資料夾中 SQL Server Management Studio\DAC Packages
資料夾。
Finish - Ends the wizard.