SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Long running transactions


Long running transactions

Author
Message
vrkumar01
vrkumar01
Valued Member
Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)

Group: General Forum Members
Points: 70 Visits: 10
Hi Team,

i am very new to this forum.... we have SCOM R2 which monitors all our SQL servers which is quite ok and satisfied with the default SQL MP's.

today i got a query from my DBA team to create a monitor for long running transactions. This is the script (Procedure) which is installed by the DBA team on all the SQL servers in my environment to the master databases.

Need your help in creating a monitor.


CREATE procedure [dbo].[p_open_tran_check]
(
@min int
)
-----------------------------------------------------------------------
-- Functional Area: DB Administration
-- Purpose:
--
-- Parameters:
--
--
-- Deployment Notes:
-- resolve_db
--
-- History:
-- ?.?.? ?/??/2008 resolve_author Created.
-----------------------------------------------------------------------
-- Copyright 2008 Inc. All Rights Reserved.
-----------------------------------------------------------------------
-- Unit Test
/***
***/
--
as
set nocount on

set @min = @min * -1

-- convert @min to milliseconds
select count(*) as qty
from master.dbo.sysprocesses (readpast)
where open_tran > 0
and last_batch < dateadd( minute, @min, getDate() )
and cmd <> 'GHOST CLEANUP'

--and datediff(minute, last_batch, getDate() ) >= @min

return

-Vrkumar01
PaulB-TheOneAndOnly
PaulB-TheOneAndOnly
One Orange Chip
One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)

Group: General Forum Members
Points: 29627 Visits: 4639
vrkumar01 (10/25/2010)
Hi Team,

i am very new to this forum.... we have SCOM R2 which monitors all our SQL servers which is quite ok and satisfied with the default SQL MP's.

today i got a query from my DBA team to create a monitor for long running transactions. This is the script (Procedure) which is installed by the DBA team on all the SQL servers in my environment to the master databases.

Need your help in creating a monitor.


CREATE procedure [dbo].[p_open_tran_check]
(
@min int
)
-----------------------------------------------------------------------
-- Functional Area: DB Administration
-- Purpose:
--
-- Parameters:
--
--
-- Deployment Notes:
-- resolve_db
--
-- History:
-- ?.?.? ?/??/2008 resolve_author Created.
-----------------------------------------------------------------------
-- Copyright 2008 Inc. All Rights Reserved.
-----------------------------------------------------------------------
-- Unit Test
/***
***/
--
as
set nocount on

set @min = @min * -1

-- convert @min to milliseconds
select count(*) as qty
from master.dbo.sysprocesses (readpast)
where open_tran > 0
and last_batch < dateadd( minute, @min, getDate() )
and cmd <> 'GHOST CLEANUP'

--and datediff(minute, last_batch, getDate() ) >= @min

return

Go to Authoring Console then... >Create Monitor >Script Monitor

_____________________________________
Pablo (Paul) Berzukov

Author of Understanding Database Administration available at Amazon and other bookstores.

Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
vrkumar01
vrkumar01
Valued Member
Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)

Group: General Forum Members
Points: 70 Visits: 10
Hey Pablo (Paul) Berzukov,

Thanks for your response. i am aware that we have to use a script monitor from authoring console.

Create Monitor - Script monitor- selected SQL Database as Monitor target - Parent Monitor as Availability.
now when i come to script.... do i have to copy all the script which i mentioned and paste it ??????
if yes gr8 if no kindly suggest.

under parameters what should i mention?????

i previously used script based folder monitor which counts number of files where i gave the folder path and size.
'd:\log\log.txt' '50'

please let me know if i am not clear and apperciate your help.

-Vrkumar01
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum







































































































































































SQLServerCentral


Search