Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Long running transactions Expand / Collapse
Author
Message
Posted Monday, October 25, 2010 8:30 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, November 18, 2010 12:44 AM
Points: 2, 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
Post #1010513
Posted Wednesday, October 27, 2010 1:32 PM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Tuesday, January 28, 2014 8:15 AM
Points: 3,065, Visits: 4,639
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.
Post #1011844
Posted Thursday, October 28, 2010 12:56 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, November 18, 2010 12:44 AM
Points: 2, 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
Post #1012591
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse