Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 SQL memory consumtption

Author  Topic 

keyursoni85
Posting Yak Master

233 Posts

Posted - 2013-05-31 : 06:04:36
Hi,

After enabling server broker sql notification. My sql memory goes 2 gb.

How can I kill queues?
How to release one of notification table?

Below query "sysdercv" tables goes huge.

select OBJECT_NAME(p.object_id),
reservedpages = sum(a.total_pages),
usedpages = sum(a.used_pages),
pages = sum(
CASE
-- XML-Index and FT-Index internal tables are not considered "data", but is part of "index_size"
When it.internal_type IN (202,204,211,212,213,214,215,216) Then 0
When a.type <> 1 Then a.used_pages
When p.index_id < 2 Then a.data_pages
Else 0
END
)
from sys.partitions p join sys.allocation_units a on p.partition_id = a.container_id
left join sys.internal_tables it on p.object_id = it.object_id
GROUP BY p.object_id
with rollup


How can I frees up and kill all service broker notifications? I also want to disable notification. But want to kill and frees up above table first.

stepson
Aged Yak Warrior

545 Posts

Posted - 2013-05-31 : 09:34:09
Hi

May be this link will help you

http://www.sqlservercentral.com/Forums/Topic883785-146-1.aspx


S

Ce-am pe mine am si-n dulap, cand ma-mbrac zici ca ma mut
sabinWeb
Go to Top of Page

keyursoni85
Posting Yak Master

233 Posts

Posted - 2013-06-01 : 01:10:29
I tried but I want to kill old queues of notification broker .. I tried to stop broker but also it not stopping..

"sysdercv" tables goes huge and huge.

I want to frees up that table and stopping notification broker.. sql server takes memory up to 2 gb and goes in recovery mode due to such problems of insufficient memory.
Go to Top of Page

keyursoni85
Posting Yak Master

233 Posts

Posted - 2013-06-03 : 02:19:43
Done...

SET NOCOUNT OFF;
DECLARE @handle UniqueIdentifier
DECLARE @count INT =0

DECLARE handleCursor CURSOR
FOR
SELECT TOP 1000 [conversation_handle]
FROM sys.conversation_endpoints with(nolock)
WHERE [state] = 'co'
AND far_service = 'ChangeNotifications'
AND security_timestamp < '2013-01-01'

DECLARE @Rows INT
SELECT @Rows = COUNT(*) FROM sys.conversation_endpoints with(nolock)
WHERE [state] = 'co'
AND far_service = 'ChangeNotifications'

WHILE @ROWS>0
BEGIN
OPEN handleCursor

FETCH NEXT FROM handleCursor
INTO @handle

BEGIN TRANSACTION

WHILE @@FETCH_STATUS = 0
BEGIN

END CONVERSATION @handle WITH CLEANUP

FETCH NEXT FROM handleCursor INTO @handle
SET @count= @count+1
END

COMMIT TRANSACTION
print @count

CLOSE handleCursor;

IF @count > 100000
BEGIN
BREAK;
END

SELECT @Rows = COUNT(*) FROM sys.conversation_endpoints with(nolock)
WHERE [state] = 'co'
AND far_service = 'ChangeNotifications'
END
DEALLOCATE handleCursor;
Go to Top of Page
   

- Advertisement -