Hello again folks.
Weve had some pretty grim Ops DB performance over the last few days causing console slowdowns, los off data, the works.
Our DBA has identified the following query causing the locks for several minutes at a time.
CREATEPROCEDURE [dbo].[p_EntityTransactionLogBegin]
(
@DiscoverySourceIduniqueidentifier,
@ContextGeneratednvarchar(255)=NULL,
@TransactionIdbigint= NULLOUTPUT
)
AS
BEGIN
SETNOCOUNTON;
DECLARE @Err int;
DECLARE @LastModified datetime;
UPDATE [dbo].[DiscoverySource]
SET [TimeGeneratedOfLastSnapshot] = [TimeGeneratedOfLastSnapshot]
WHERE [DiscoverySourceId] ='85AB926D-6E0F-4B36-A951-77CCD4399681'
SELECT @Err = @@ERROR;
IF (@Err <> 0)
GOTO Error_Exit;
SET @LastModified=GETUTCDATE();
INSERTINTO dbo.[EntityTransactionLog]
(
[DiscoverySourceId],
[ContextGenerated],
[LastModified],
[TimeAdded],
[IsCommitted]
)
VALUES
(
@DiscoverySourceId,
@ContextGenerated,
@LastModified,
@LastModified,
0
);
SELECT @Err = @@ERROR;
SELECT @TransactionId = @@IDENTITY;
IF (@Err <> 0)
GOTO Error_Exit;
IFOBJECT_ID('tempdb..#EntityTransaction')ISNOT NULL
BEGIN
INSERT #EntityTransaction
(TransactionId)
VALUES
(@TransactionId);
END
RETURN 0;
Error_Exit:
RETURN 1;
END
GO
This seems to be trying to insert half a million rows a time into the DB - no idea why?
Does anyone know how I can locate that discovery ID in the SCOM DB? Ive tried get-scommonitoring object -id without success.