升級複寫的資料庫Upgrade Replicated Databases

SQL Server 2014SQL Server 2014 支援從舊版 [SQL Server]SQL Server 升級複寫資料庫。升級節點時,不需要停止其他節點上的活動。supports upgrading replicated databases from previous versions of [SQL Server]SQL Server; it is not required to stop activity at other nodes while a node is being upgraded. 請確定您遵守有關拓撲中支援之版本的規則:Ensure that you adhere to the rules regarding which versions are supported in a topology:

  • 散發者可以是任何版本,只要其高於或等於發行者版本 (在許多情況下,散發者與發行者為同一執行個體)。A Distributor can be any version as long as it is greater than or equal to the Publisher version (in many cases the Distributor is the same instance as the Publisher).

  • 發行者可以是任何版本,只要它小於或等於散發者版本即可。A Publisher can be any version as long as it less than or equal to the Distributor version.

  • 訂閱者版本視發行集的類型而定:Subscriber version depends on the type of publication:

    • 交易式發行集的訂閱者可以是兩個發行者版本內的任何版本。A Subscriber to a transactional publication can be any version within two versions of the Publisher version. 例如:執行中的 SQL Server 2008SQL Server 2008 發行者可以有 SQL Server 2014SQL Server 2014 訂閱者,而 SQL Server 2014SQL Server 2014 發行者可以有 SQL Server 2008SQL Server 2008 訂閱者。For example: a SQL Server 2008SQL Server 2008 Publisher running can have SQL Server 2014SQL Server 2014 Subscribers; and a SQL Server 2014SQL Server 2014 Publisher can have SQL Server 2008SQL Server 2008 Subscribers.

    • 合併式發行集的訂閱者可以是小於或等於發行者版本的任何版本。A Subscriber to a merge publication can be any version less than or equal to the Publisher version.

注意

有關這個主題,請參閱「安裝說明」文件集和《 [SQL Server]SQL Server 線上叢書》。This topic is available in the Setup Help documentation and in [SQL Server]SQL Server Books Online. 在「安裝說明」文件集中,以粗體文字表示的主題連結只會參考線上叢書中的主題。Topic links that appear as bold text in the Setup Help documentation refer to topics that are only available in Books Online.

在升級之前執行異動複寫的記錄讀取器代理程式Run the Log Reader Agent for Transactional Replication Before Upgrade

在升級至 SQL Server 2014SQL Server 2014之前,您必須確定所有來自已發行資料表的認可交易都已經由記錄讀取器代理程式進行過處理。Before you upgrade to SQL Server 2014SQL Server 2014, you must make sure that all committed transactions from published tables have been processed by the Log Reader Agent. 若要確定已經處理過所有交易,請針對每個包含交易式發行集的資料庫執行下列步驟:To make sure that all transactions have been processed, perform the following steps for each database that contains transactional publications:

  1. 確定已在針對資料庫執行記錄讀取器代理程式。Make sure that the Log Reader Agent is running for the database. 依預設,代理程式會持續執行。By default, the agent runs continuously.

  2. 停止在已發行資料表上的使用者活動。Stop user activity on published tables.

  3. 提供時間讓記錄讀取器代理程式將交易複製到散發資料庫,然後再停止代理程式。Allow time for the Log Reader Agent to copy transactions to the distribution database, and then stop the agent.

  4. 執行 sp_replcmds 以確認已處理所有的交易。Execute sp_replcmds to verify that all transactions have been processed. 這個程序中所產生的結果集應該是空的。The result set from this procedure should be empty.

  5. 執行 sp_replflush 以關閉 sp_replcmds 的連接。Execute sp_replflush to close the connection from sp_replcmds.

  6. 將伺服器升級至 SQL Server 2014SQL Server 2014Perform the server upgrade to SQL Server 2014SQL Server 2014.

  7. 如果 [SQL Server]SQL Server Agent 和記錄讀取器代理程式在升級之後沒有自動啟動,則將其重新啟動。Restart [SQL Server]SQL Server Agent and the Log Reader Agent if they do not start automatically after the upgrade.

升級之後為合併式複寫執行代理程式Run Agents for Merge Replication After Upgrade

升級之後,請為每一個合併式發行集執行快照集代理程式,並為每一個訂閱執行合併代理程式來更新複寫中繼資料。After upgrade, run the Snapshot Agent for each merge publication and the Merge Agent for each subscription to update replication metadata. 您不必套用新的快照集,因為不需要重新初始化訂閱。You do not have to apply the new snapshot, because it is not necessary to reinitialize subscriptions. 升級之後,第一次執行合併代理程式時會更新訂閱中繼資料。Subscription metadata is updated the first time the Merge Agent is run after upgrade. 這表示在發行者升級時,訂閱資料庫可以持續在線上運作並保持使用中狀態。This means that the subscription database can remain online and active during the Publisher upgrade.

合併式複寫會將發行集與訂閱中繼資料儲存在發行集與訂閱資料庫中的許多系統資料表內。Merge replication stores publication and subscription metadata in a number of system tables in the publication and subscription databases. 執行快照集代理程式會更發行集中繼資料,而執行合併代理程式會更新訂閱中繼資料。Running the Snapshot Agent updates publication metadata and running the Merge Agent updates subscription metadata. 只有要產生發行集快照集時才需要它。It is only required to generate a publication snapshot. 如果合併式發行集使用參數化篩選,則每個資料分割也會有快照集。If a merge publication uses parameterized filters, each partition also has a snapshot. 您不需要更新這些分割快照集It is not necessary to update these partitioned snapshots.

您可以從 SQL Server Management StudioSQL Server Management Studio、複寫監視器或命令列執行代理程式。Run the agents from SQL Server Management StudioSQL Server Management Studio, Replication Monitor, or from the command line. 如需有關執行快照集代理程式的詳細資訊,請參閱下列主題:For more information about running the Snapshot Agent, see the following topics:

如需有關執行合併代理程式的詳細資訊,請參閱下列主題:For more information about running the Merge Agent, see the following topics:

在使用合併式複寫的拓撲中升級 [SQL Server]SQL Server 之後,如果您想要使用新功能,請變更任何發行集的發行集相容性層級。After upgrading [SQL Server]SQL Server in a topology that uses merge replication, change the publication compatibility level of any publications if you want to use new features.

升級至 Standard、Workgroup 或 Express EditionUpgrading to Standard, Workgroup, or Express Editions

SQL Server 2014SQL Server 2014 的一個版本升級到另一個版本之前,請確認您目前使用的功能在您想要升級後的版本中受到支援。Before upgrading from one edition of SQL Server 2014SQL Server 2014 to another, verify that the functionality you are currently using is supported in the edition to which you are upgrading. 如需詳細資訊,請參閱一節中的複寫上支援的 SQL Server 2014 的版本功能For more information, see the section on Replication in Features Supported by the Editions of SQL Server 2014.

合併式複寫的 Web 同步處理Web Synchronization for Merge Replication

合併式複寫的 Web 同步處理選項要求,必須將 [SQL Server]SQL Server Replication Listener (replisapi.dll) 複製到用於同步處理之 Internet Information Services (IIS) 伺服器上的虛擬目錄。The Web synchronization option for merge replication requires that the [SQL Server]SQL Server Replication Listener (replisapi.dll) be copied to the virtual directory on the Internet Information Services (IIS) server used for synchronization. 當您設定 Web 同步處理時,「設定 Web 同步處理精靈」會將檔案複製到虛擬目錄。When you configure Web synchronization, the file is copied to the virtual directory by the Configure Web Synchronization Wizard. 如果您升級安裝在 IIS 伺服器上的 [SQL Server]SQL Server 元件,就必須將 replisapi.dll 從 COM 目錄手動複製到 IIS 伺服器上的虛擬目錄。If you upgrade the [SQL Server]SQL Server components installed on the IIS server, you must manually copy replisapi.dll from the COM directory to the virtual directory on the IIS server. 如需設定 Web 同步處理的詳細資訊,請參閱 設定 Web 同步處理For more information about configuring Web synchronization, see Configure Web Synchronization.

從舊版還原複寫的資料庫Restoring a Replicated Database from an Earlier Version

若要確定從舊版還原複寫資料庫的備份時有保留複寫設定:還原到與建立備份的伺服器和資料庫同名的伺服器和資料庫。To ensure replication settings are retained when restoring a backup of a replicated database from a previous version: restore to a server and database with the same names as the server and database at which the backup was taken.

另請參閱See Also

複寫管理常見問題集 Replication Administration FAQ
複寫回溯相容性 Replication Backward Compatibility
支援的版本與版本升級 Supported Version and Edition Upgrades
升級到 SQL Server 2014Upgrade to SQL Server 2014