【发布时间】:2017-02-05 12:38:10
【问题描述】:
下面是我的代码:
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
还有我的问题:
我如何知道是否存在许可或配置问题?
我在两个类似的系统上运行了这段代码,结果相同。一个系统完美同步,另一个在跟踪日志中给出以下警告
System.ArgumentException: SQL Server Change Tracking is not enabled for table 'Users' and stops.
更改跟踪已启用,我已检查过。通过 PerformPostRestoreFixup() 方法,我希望在第二个系统切换到简单恢复模式并返回完整模式后恢复第二个系统的数据库(我认为可能是同步问题的原因)。
【问题讨论】:
标签: sql-server synchronization wcf-data-services change-tracking