1
は私のコードです:PerformPostRestoreFixup()メソッドは、例外を与える:Microsoft.Synchronization.Data.DbNotProvisionedException以下
SqlConnection.ClearPool(serverConn);
serverConn = new SqlConnection(Utility.ConnStr_SqlSync_Server);
SqlSyncStoreRestore databaseRestore = new SqlSyncStoreRestore(serverConn);
databaseRestore.CommandTimeout = 1000; //Database is about 300 Gb
databaseRestore.PerformPostRestoreFixup(); //line #31
エラーメッセージ:
Unhandled Exception: Microsoft.Synchronization.Data.DbNotProvisionedException: The current operation could not be completed because the database is not provisioned for sync or you not have permissions to the sync configuration tables.
at Microsoft.Synchronization.Data.SqlServer.SqlManagementUtils.VerifyRuntimeAndSchemaVersionsMatch(SqlConnection connection, SqlTransaction trans, String objectPrefix, String objectSchema, Boolean throwWhenNotProvisioned)
at Microsoft.Synchronization.Data.SqlServer.SqlSyncStoreRestore.PerformPostRestoreFixup()
at FixSyncEnabledDbAfterBackup.Program.Main(String[] args) ..\Visual Studio 2010\Projects\FixSyncEnabledDbAfterBackup\FixSyncEnabledDbAfterBackup\Program.cs:line 31
そして、私の質問:私はどのように
許可またはプロビジョニングの問題があるかどうかを知る
このコードは、2つの類似システムで同じ結果を出して実行しました。 1つのシステムが完全に同期し、その他がトレースログに次の警告を表示します
System.ArgumentException: SQL Server Change Tracking is not enabled for table 'Users' and stops.
変更追跡が有効になっています。 PerformPostRestoreFixup()メソッドを使用して、シンプルなリカバリモデルに切り替えてフルモデルに戻った後に、2番目のシステムのデータベースを回復したいと考えています。