Fanr

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

10 2011 档案

摘要:Deadlockingoccurs when two user processes have locks on separate objects and each process is trying to acquire a lock on the object that the other process has. When this happens, SQL Server identifies the problem and ends the deadlock by automatically choosing one process and aborting the other proc 阅读全文
posted @ 2011-10-31 09:37 Fanr_Zh 阅读(451) 评论(0) 推荐(0) 编辑

摘要:In transactional replication, the transaction log of the database involved in replication is both written to and read from. Without replication, a transaction log is almost always written to, and rarely read from. Because a transaction log is both written to and read from when using transactional re 阅读全文
posted @ 2011-10-28 11:08 Fanr_Zh 阅读(338) 评论(0) 推荐(0) 编辑

摘要:USE AdventureWorksDW2008R2declare @P1 int --游标号码declare @P2 intset @P2=8 --参数[传入参数](可能是游标类型)declare @P3 intset @P3=1 --参数[传入参数](可能是游标锁类型)declare @P4 int --返回行数beginexec sp_cursoropen @P1 output,N'select * from DimCustomer',@P2 output,@P3 output,@P4 outputexec sp_cursorfetch @P1, 16, 1, 100-- 阅读全文
posted @ 2011-10-23 19:41 Fanr_Zh 阅读(315) 评论(0) 推荐(0) 编辑

摘要:Troubleshooting Performance Problems in SQL Server 2005Published: October 1, 2005Writers:Sunil Agarwal, Boris Baryshnikov, Tom Davidson, Keith Elmore, Denzil Ribeiro, Juergen ThomasApplies To:SQL Server 2005Summary:It is not uncommon to experience the occasional slow down of a SQLServer database. A 阅读全文
posted @ 2011-10-22 22:12 Fanr_Zh 阅读(3663) 评论(0) 推荐(0) 编辑

摘要:DBCC CACHESTATSdisplays information about the objects currently in the buffer cache, such as hit rates, compiled objects and plans, etc.Example:DBCC CACHESTATSSample Results (abbreviated):Object Name Hit Ratio————————-Proc0.86420054765378507Prepared0.99988494930394334Adhoc 0.93237136647793051ReplPro 阅读全文
posted @ 2011-10-21 10:41 Fanr_Zh 阅读(459) 评论(0) 推荐(0) 编辑

摘要:背景: 朋友的提问原因: 数据库因机器名被修改无法成功发布问题处理办法: if serverproperty('servername') <> @@servername begin declare @server sysname set @server = @@servername exec sp_dropserver @server = @server set @server = cast(serverproperty('servername') as sysname) exec s... 阅读全文
posted @ 2011-10-12 16:41 Fanr_Zh 阅读(307) 评论(0) 推荐(0) 编辑

摘要:某些查询占用的资源比其他查询占用的资源多。例如,返回大型结果集的查询和那些包含 WHERE 子句(并非唯一子句)的查询总是占用大量资源。与不太复杂的查询相比,查询优化器的智能水平无法消除这些构造的资源开销。SQL Server 使用最佳访问计划,但查询优化会受到可访问内容的限制。尽管如此,您可以执行下列操作来提高查询性能:添加更多内存。当服务器运行许多复杂查询且其中几个查询执行很慢时,此解决方案尤其有用。使用多个处理器。多个处理器允许数据库引擎使用并行查询。有关详细信息,请参阅。重写查询。请注意下列事项:如果查询使用游标,则确定是否可以使用效率更高的游标类型(如快速只进游标)或单个查询编写游标 阅读全文
posted @ 2011-10-12 13:16 Fanr_Zh 阅读(479) 评论(0) 推荐(0) 编辑