恢复数据库然后运行PerformPostRestoreFixup [英] Database Restored then run PerformPostRestoreFixup

查看:102
本文介绍了恢复数据库然后运行PerformPostRestoreFixup的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 SqlConnection serverConn = new SqlConnection(connectionString); 
SqlConnection.ClearPool(serverConn);
serverConn = new SqlConnection(connectionString);
SqlSyncStoreRestore databaseRestore = new SqlSyncStoreRestore(serverConn);
databaseRestore.PerformPostRestoreFixup();
serverConn.Close();
serverConn.Dispose();


我在控制台上运行它并挂起。它会挂在特定的表格上。任何可能导致它失败的特定表设计?
我认为这是一个与表设计相关的问题,因为如果我的范围由没有任何关系的简单表组成,我可以运行PerformPostRestoreFixup。 (没有FK)。
除此之外,它可以支持的范围数量有限制吗?

我启动SQL事件探查器来检查控制台程序调用的T-SQL语句。我发现PerformPostRestoreFixup函数无休止地调用这两个T-SQL语句。


执行sp_executesql N'SELECT [scope_id],[scope_local_id],[scope_sync_knowledge],[scope_tombstone_cleanup_knowledge],[ scope_timestamp],[scope_config_id],[scope_restore_count] FROM [scope_info] WHERE [scope_name] = @ sync_scope_name',N'@ sync_scope_name nvarchar(100)',@ sync_scope_name = N'DependendantRecords'




声明@p9 int
set @ p9 = 0
执行sp_executesql N'UPDATE [scope_info] SET [scope_id] = @sync_scope_id,[scope_sync_knowledge] = @sync_scope_knowledge, [scope_tombstone_cleanup_knowledge] = @sync_scope_cleanup_knowledge,[scope_restore_count] = [scope_restore_count] + 1 WHERE [scope_name] = @sync_scope_name AND(@sync_check_concurrency = 0 OR [scope_timestamp] = @sync_scope_timestamp); SET @sync_row_count = @@ ROWCOUNT',N'@ sync_scope_name nvarchar(100),@ sync_scope_id uniqueidentifier,@ sync_scope_knowledge varbinary(188) ,@ sync_scope_cleanup_knowledge VARBINARY(156),@ sync_check_concurrency INT,@ sync_scope_timestamp BIGINT,@ sync_row_count INT输出",@ sync_scope_name = N'DependendantRecords',@ sync_scope_id = '0348827F-46FD-47BE-8163-7B5956CEE738',@ sync_scope_knowledge = 0x0000000500000000000000040000000000000005000010000000040348827F46FD47BE81637B5956CEE738478BCC932F8F4C97A619E0867E7F462012D57140249C488A9A1C35538​​569A4B374F9020A8C3F423F9D5A5E01A79BEC5A000000180000100128020000010000001500000002000000010000000000000001000000020000000200000000000007D30000000300000000000007D4000000170000000100000016000000010003000000000100000000000000190100000000, @ sync_scope_cleanup_knowledge = 0x0000000500000000000000040000000000000005000010000000040348827F46FD47BE81637B5956CEE738478BCC932F8F4C97A619E0867E7F462012D57140249C488A9A1C35538​​569A4B374F9020A8C3F423F9D5A5E01A79BEC5A0000001800001001280200000100000015000000010000000100000000000000170000000100000016000000010003000000000000000000000000190100000000,@ sync_check_concurr ency = 1,@ sync_scope_timestamp = 2004,@ sync_row_count = @ p9输出
选择@ p9

任何线索有什么问题?

谢谢。

解决方案

当发生这种情况时,能否描述一下简化的表格模式?
如果可能的话,.sql用于创建它们会很有帮助。

感谢。

 SqlConnection serverConn = new SqlConnection(connectionString);
                SqlConnection.ClearPool(serverConn);
                serverConn = new SqlConnection(connectionString);
                SqlSyncStoreRestore databaseRestore = new SqlSyncStoreRestore(serverConn);
                databaseRestore.PerformPostRestoreFixup();
                serverConn.Close();
                serverConn.Dispose();

I ran this on a console and it hang. It would hang on particular tables. Any particular tables design that could cause it to fail?
I think it is a table design related problem because i can run PerformPostRestoreFixup if my scope are made up of simple tables without any relations. (no FK).
Besides that, any limitation on number of scope it can support?

I fire up the SQL profiler to inspect the T-SQL statement called by the console program. And I found the PerformPostRestoreFixup function is endlessly calling these two T-SQL statement.


exec sp_executesql N'SELECT [scope_id], [scope_local_id], [scope_sync_knowledge], [scope_tombstone_cleanup_knowledge], [scope_timestamp], [scope_config_id], [scope_restore_count] FROM [scope_info] WHERE [scope_name] = @sync_scope_name',N'@sync_scope_name nvarchar(100)',@sync_scope_name=N'DependendantRecords'




declare @p9 int
set @p9=0
exec sp_executesql N'UPDATE [scope_info] SET [scope_id] = @sync_scope_id, [scope_sync_knowledge] = @sync_scope_knowledge, [scope_tombstone_cleanup_knowledge] = @sync_scope_cleanup_knowledge, [scope_restore_count] = [scope_restore_count] + 1 WHERE [scope_name] = @sync_scope_name AND (@sync_check_concurrency = 0 OR [scope_timestamp] = @sync_scope_timestamp);SET @sync_row_count = @@ROWCOUNT',N'@sync_scope_name nvarchar(100),@sync_scope_id uniqueidentifier,@sync_scope_knowledge varbinary(188),@sync_scope_cleanup_knowledge varbinary(156),@sync_check_concurrency int,@sync_scope_timestamp bigint,@sync_row_count int output',@sync_scope_name=N'DependendantRecords',@sync_scope_id='0348827F-46FD-47BE-8163-7B5956CEE738',@sync_scope_knowledge=0x0000000500000000000000040000000000000005000010000000040348827F46FD47BE81637B5956CEE738478BCC932F8F4C97A619E0867E7F462012D57140249C488A9A1C35538569A4B374F9020A8C3F423F9D5A5E01A79BEC5A000000180000100128020000010000001500000002000000010000000000000001000000020000000200000000000007D30000000300000000000007D4000000170000000100000016000000010003000000000100000000000000190100000000,@sync_scope_cleanup_knowledge=0x0000000500000000000000040000000000000005000010000000040348827F46FD47BE81637B5956CEE738478BCC932F8F4C97A619E0867E7F462012D57140249C488A9A1C35538569A4B374F9020A8C3F423F9D5A5E01A79BEC5A0000001800001001280200000100000015000000010000000100000000000000170000000100000016000000010003000000000000000000000000190100000000,@sync_check_concurrency=1,@sync_scope_timestamp=2004,@sync_row_count=@p9 output
select @p9

any clue what is the problem?

thanks.



解决方案

Can you please describe the simplified table schema when this happens?
If possible, .sql for creating them would be helpful.

Thanks.


这篇关于恢复数据库然后运行PerformPostRestoreFixup的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆