发现每天sqlservr.exe进程占用内存巨大,平时都是300多M,有一次竟然占到1.5G!
sql server2005上设着几个定时,都是执行sql的,因为还没公开使用,所以几乎没有什么访问量!
每天的定时里面凡建了临时表的,到最后肯定都drop掉,似乎没有什么程序上占用资源未释放的地方!
请教各位大哥大姐,有什么优化的方法不?
6 个解决方案
#1
sp_who active --看看有沒有阻塞,blk
sp_lock --看看锁住了那个资源id,objid ,select object_name(objid) 得到
dbcc inputbuffer(@blk) -- 看看是那个语句
sp_lock --看看锁住了那个资源id,objid ,select object_name(objid) 得到
dbcc inputbuffer(@blk) -- 看看是那个语句
#2
执行sp_who active,返回
1|0|background|sa||0|NULL|RESOURCE MONITOR|0
2|0|background|sa||0|NULL|LAZY WRITER |0
3|0|suspended |sa||0|NULL|LOG WRITER |0
4|0|background|sa||0|NULL|LOCK MONITOR|0
5|0|background|sa||0|master|SIGNAL HANDLER |0
6|0|sleeping |sa||0|master|TASK MANAGER|0
7|0|background|sa||0|master|TRACE QUEUE TASK|0
8|0|sleeping |sa||0|NULL|UNKNOWN TOKEN |0
9|0|background|sa||0|master|BRKR TASK |0
10|0|background|sa||0|master|TASK MANAGER|0
11|0|suspended |sa||0|master|CHECKPOINT |0
12|0|sleeping |sa||0|master|TASK MANAGER|0
13|0|sleeping |sa||0|master|TASK MANAGER|0
14|0|sleeping |sa||0|master|TASK MANAGER|0
15|0|sleeping |sa||0|master|TASK MANAGER|0
16|0|sleeping |sa||0|master|TASK MANAGER|0
17|0|sleeping |sa||0|master|TASK MANAGER|0
18|0|sleeping |sa||0|master|TASK MANAGER|0
19|0|sleeping |sa||0|master|TASK MANAGER|0
21|0|background|sa||0|master|BRKR EVENT HNDLR|0
22|0|background|sa||0|master|BRKR TASK |0
53|0|runnable |sa|CLIC-IBM2|0|master|SELECT |0
,好像都是sleeping\background之类的,
有一个runnable,查看的时候是我刚才执行dbcc inputbuffer(@blk)的语句,
楼上的大哥,能再给讲讲不?
1|0|background|sa||0|NULL|RESOURCE MONITOR|0
2|0|background|sa||0|NULL|LAZY WRITER |0
3|0|suspended |sa||0|NULL|LOG WRITER |0
4|0|background|sa||0|NULL|LOCK MONITOR|0
5|0|background|sa||0|master|SIGNAL HANDLER |0
6|0|sleeping |sa||0|master|TASK MANAGER|0
7|0|background|sa||0|master|TRACE QUEUE TASK|0
8|0|sleeping |sa||0|NULL|UNKNOWN TOKEN |0
9|0|background|sa||0|master|BRKR TASK |0
10|0|background|sa||0|master|TASK MANAGER|0
11|0|suspended |sa||0|master|CHECKPOINT |0
12|0|sleeping |sa||0|master|TASK MANAGER|0
13|0|sleeping |sa||0|master|TASK MANAGER|0
14|0|sleeping |sa||0|master|TASK MANAGER|0
15|0|sleeping |sa||0|master|TASK MANAGER|0
16|0|sleeping |sa||0|master|TASK MANAGER|0
17|0|sleeping |sa||0|master|TASK MANAGER|0
18|0|sleeping |sa||0|master|TASK MANAGER|0
19|0|sleeping |sa||0|master|TASK MANAGER|0
21|0|background|sa||0|master|BRKR EVENT HNDLR|0
22|0|background|sa||0|master|BRKR TASK |0
53|0|runnable |sa|CLIC-IBM2|0|master|SELECT |0
,好像都是sleeping\background之类的,
有一个runnable,查看的时候是我刚才执行dbcc inputbuffer(@blk)的语句,
楼上的大哥,能再给讲讲不?
#3
你把不用的SQL服务都关掉试下,比如什么REPORT SERVICE啊,BROKER SERVICE啊,
#4
SQL Server的内存是自动管理的,你可以设置一下机器的最大内存使用量,系统会自动进行管理释放.
#5
大虾,在哪里执行呀?
#6
大虾,不行啊.
我在查询分析器里面运行,语法错误
我在查询分析器里面运行,语法错误
#1
sp_who active --看看有沒有阻塞,blk
sp_lock --看看锁住了那个资源id,objid ,select object_name(objid) 得到
dbcc inputbuffer(@blk) -- 看看是那个语句
sp_lock --看看锁住了那个资源id,objid ,select object_name(objid) 得到
dbcc inputbuffer(@blk) -- 看看是那个语句
#2
执行sp_who active,返回
1|0|background|sa||0|NULL|RESOURCE MONITOR|0
2|0|background|sa||0|NULL|LAZY WRITER |0
3|0|suspended |sa||0|NULL|LOG WRITER |0
4|0|background|sa||0|NULL|LOCK MONITOR|0
5|0|background|sa||0|master|SIGNAL HANDLER |0
6|0|sleeping |sa||0|master|TASK MANAGER|0
7|0|background|sa||0|master|TRACE QUEUE TASK|0
8|0|sleeping |sa||0|NULL|UNKNOWN TOKEN |0
9|0|background|sa||0|master|BRKR TASK |0
10|0|background|sa||0|master|TASK MANAGER|0
11|0|suspended |sa||0|master|CHECKPOINT |0
12|0|sleeping |sa||0|master|TASK MANAGER|0
13|0|sleeping |sa||0|master|TASK MANAGER|0
14|0|sleeping |sa||0|master|TASK MANAGER|0
15|0|sleeping |sa||0|master|TASK MANAGER|0
16|0|sleeping |sa||0|master|TASK MANAGER|0
17|0|sleeping |sa||0|master|TASK MANAGER|0
18|0|sleeping |sa||0|master|TASK MANAGER|0
19|0|sleeping |sa||0|master|TASK MANAGER|0
21|0|background|sa||0|master|BRKR EVENT HNDLR|0
22|0|background|sa||0|master|BRKR TASK |0
53|0|runnable |sa|CLIC-IBM2|0|master|SELECT |0
,好像都是sleeping\background之类的,
有一个runnable,查看的时候是我刚才执行dbcc inputbuffer(@blk)的语句,
楼上的大哥,能再给讲讲不?
1|0|background|sa||0|NULL|RESOURCE MONITOR|0
2|0|background|sa||0|NULL|LAZY WRITER |0
3|0|suspended |sa||0|NULL|LOG WRITER |0
4|0|background|sa||0|NULL|LOCK MONITOR|0
5|0|background|sa||0|master|SIGNAL HANDLER |0
6|0|sleeping |sa||0|master|TASK MANAGER|0
7|0|background|sa||0|master|TRACE QUEUE TASK|0
8|0|sleeping |sa||0|NULL|UNKNOWN TOKEN |0
9|0|background|sa||0|master|BRKR TASK |0
10|0|background|sa||0|master|TASK MANAGER|0
11|0|suspended |sa||0|master|CHECKPOINT |0
12|0|sleeping |sa||0|master|TASK MANAGER|0
13|0|sleeping |sa||0|master|TASK MANAGER|0
14|0|sleeping |sa||0|master|TASK MANAGER|0
15|0|sleeping |sa||0|master|TASK MANAGER|0
16|0|sleeping |sa||0|master|TASK MANAGER|0
17|0|sleeping |sa||0|master|TASK MANAGER|0
18|0|sleeping |sa||0|master|TASK MANAGER|0
19|0|sleeping |sa||0|master|TASK MANAGER|0
21|0|background|sa||0|master|BRKR EVENT HNDLR|0
22|0|background|sa||0|master|BRKR TASK |0
53|0|runnable |sa|CLIC-IBM2|0|master|SELECT |0
,好像都是sleeping\background之类的,
有一个runnable,查看的时候是我刚才执行dbcc inputbuffer(@blk)的语句,
楼上的大哥,能再给讲讲不?
#3
你把不用的SQL服务都关掉试下,比如什么REPORT SERVICE啊,BROKER SERVICE啊,
#4
SQL Server的内存是自动管理的,你可以设置一下机器的最大内存使用量,系统会自动进行管理释放.
#5
大虾,在哪里执行呀?
#6
大虾,不行啊.
我在查询分析器里面运行,语法错误
我在查询分析器里面运行,语法错误