在 SharePoint Server 中將資料庫備份至快照Back up databases to snapshots in SharePoint Server

摘要: 了解如何使用 SQL Server 企業版將資料庫備份至 SharePoint Server 2016 和 SharePoint Server 2013 中的快照集。Summary: Learn how to back up databases to snapshots in SharePoint Server 2016 and SharePoint Server 2013 by using SQL Server Enterprise.

您只能使用 SQL Server 企業版工具將資料庫備份至 SharePoint Server 的快照集。You can only back up databases to snapshots in SharePoint Server by using SQL Server Enterprise tools.

開始之前Before you begin

建議您定期備份整個伺服器陣列。定期備份伺服器陣列可減少因硬體故障、電力中斷或其他問題而遺失資料的情況。此程序非常簡單,並且可協助確保在需要時,所有伺服器陣列資料與設定均可用於復原。如需詳細資訊,請參閱<在 SharePoint Server 中備份伺服器陣列>。不過,IT 需求可能會需要您備份資料庫至快照集。雖然您可以備份任何的伺服器陣列資料庫至快照集,但通常是備份內容資料庫。We recommend that you regularly back up the complete farm. Regularly backing up the farm reduces data losses that might occur from hardware failures, power outages, or other problems. It is a simple process and helps make sure that all the farm data and configurations are available for recovery, if that is required. For more information, see Back up farms in SharePoint Server. However, IT requirements might require you to backup databases to snapshots. Although you can back up any farm database to a snapshot, you typically back up content databases.

重要

資料庫快照集並不會取代備份及還原策略。若要完整保護 SharePoint Server 環境,建議您定期執行備份以保護伺服器陣列,以免失敗後需要還原資料。Database snapshots do not replace a backup and restore strategy. To fully protect your SharePoint Server environment we advise you to perform regular backups to protect your farm in case you need to restore data after a failure..

開始這項作業之前,請先檢閱下列資訊:Before you begin this operation, review the following information:

  • 您必須先在資料庫伺服器上建立備份檔案的資料夾。如果要將快照集儲存在其他位置,可以在作業完成後將備份檔案移到網路上的備份資料夾中。You must first create a folder on the database server for your backup files. If you want to store the snapshots at another location, you can move the backup files to a backup folder on the network after the operation is completed.

  • 資料庫快照集會提供來源資料庫在快照集建立那一刻的唯讀靜態檢視,但不包含任何未交付的異動。未交付異動會在新建立的資料庫快照中受到回復,因為資料庫引擎會在建立快照集後執行復原 (資料庫中的異動不受影響)。如需資料庫快照集的詳細資訊,請參閱<資料庫快照集 (SQL Server)>。A database snapshot provides a read-only, static view of a source database as it existed at snapshot creation, minus any uncommitted transactions. Uncommitted transactions are rolled back in a newly created database snapshot because the Database Engine runs recovery after the snapshot was created (transactions in the database are not affected). For more information about database snapshots, see Database Snapshots (SQL Server).

使用 SQL Server 工具將資料庫備份至 SharePoint Server 的快照集Use SQL Server tools to back up a database to a snapshot in SharePoint Server

將資料庫備份至快照集,必須使用 SQL Server 工具。與伺服器陣列相關聯的資料庫由伺服器陣列上已安裝的服務應用程式和功能來決定。If you want to back up databases to snapshots, you must use SQL Server tools. The databases that are associated with the farm are determined by the service applications and features that you have installed on the farm.

使用 SQL Server 工具將資料庫備份至快照集To back up a database to a snapshot by using SQL Server tools

  1. 確認執行此程序的使用者帳戶是 SQL Server db_owner 固定資料庫角色的成員。Verify that the user account that is performing this procedure is a member of the SQL Server db_owner fixed database role.

  2. 開啟 SQL Server Management Studio 並連線至資料庫伺服器。Open SQL Server Management Studio and connect to the database server.

  3. 在 [物件總管] 中,展開 [資料庫]*In Object Explorer, expand *Databases.

  4. 選取您想備份的資料庫,然後按一下 [新增查詢]*Select the database that you want to back up, and then click *New Query.

  5. 複製下列文字,然後將其貼在 [查詢] 窗格中。Copy the following text, and then paste it to the query pane.

    CREATE DATABASE <snapshot name>
    ON
    (
    NAME=<logical name of the database file>,
    FILENAME = 'c:\WSS_Backup1.ss')
    AS SNAPSHOT OF <database name>;
    

另請參閱See also

其他資源Other Resources

資料庫快照集 (SQL Server)Database Snapshots (SQL Server)

資料庫快照集與 AlwaysOn 可用性群組 (SQL Server)Database Snapshots with AlwaysOn Availability Groups (SQL Server)