SQL Server is blocked by CXPACKET(Wait Type)
2015-02-02 14:29
309 查看
生产环境由SQL Server2000升级到2008 R2,然后某个系统提供 的一个WS挂掉了。
此WS后台直接调用一个SP执行逻辑业务。首先根据页面报错调整了个别sql书写语法,SP可以正常运行了。
后来PM又继续反馈说超时之类的错误,经过DBA进一步确认是SP中的一个DEL语句造成了block。
经过一番sql验证,发现并不是sql语法或者记录过多引起的,最后从DBA的所给的截图中发现这个DEL语句
总是引发wait type=cxpacket,接下来只能靠搜索引擎了。还好,根据这个点找到了一些解释,SQL2008
启用了并行查询,所以在select上(DEL后面跟了Select)经过SQL优化后使用了并行查询,造成了线程等待,
查询结果不能被正确汇集并给出。
![](http://img.blog.csdn.net/20150202150133137?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvZWxsZWZyeQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
解决方法就是在select语句上使用关键字maxdop,强制select单线程运行。
此WS后台直接调用一个SP执行逻辑业务。首先根据页面报错调整了个别sql书写语法,SP可以正常运行了。
后来PM又继续反馈说超时之类的错误,经过DBA进一步确认是SP中的一个DEL语句造成了block。
经过一番sql验证,发现并不是sql语法或者记录过多引起的,最后从DBA的所给的截图中发现这个DEL语句
总是引发wait type=cxpacket,接下来只能靠搜索引擎了。还好,根据这个点找到了一些解释,SQL2008
启用了并行查询,所以在select上(DEL后面跟了Select)经过SQL优化后使用了并行查询,造成了线程等待,
查询结果不能被正确汇集并给出。
解决方法就是在select语句上使用关键字maxdop,强制select单线程运行。
相关文章推荐
- SQL SERVER CXPACKET-Parallelism Wait Type 的惯用解决方案
- SQL SERVER CXPACKET-Parallelism Wait Type 的解决方案
- SQL SERVER CXPACKET-Parallelism Wait Type的惯用解决方案
- Reducing SQL Server CXPACKET Wait Type
- SQL SERVER CXPACKET-Parallelism Wait Type的惯用解决方案
- packet for query is too large <1781> 1024 >. you can change this value on the server by setting the
- [转]sql server profiler only TrueType fonts are supported. this is not a truetype font
- MYSQL维护-java.sql.SQLException: null, message server: "Host 'ora-rac2' is blocked because of many co
- MySQL5中大数据错误:Packet for query is too large (****** > ******). You can change this value on the server by setting the max_allowed_packet' variable.;
- SQL Server Profiler only true fonts are supported. this is not a truetype font
- 从wait_type入手模拟SQL Server Lock
- Troubleshooting SQL Server RESOURCE_SEMAPHORE Waittype Memory Issues
- Packet for query is too large (1986748 > 1048576). You can change this value on the server by setting the max_allowed_pa
- The ENU localization is not supported by this SQL Server media
- Sql server WaitType 日志
- SQL Server error "Xml data type is not supported in distributed queries" and workaround for it
- exit thread normally when it is blocked by pthread_cond_wait
- The ENU localization is not supported by this SQL Server media
- SQLServer ASYNC Network IO waittype
- The ENU localization is not supported by this SQL Server media