Skip to content

Commit 0cdc2e5

Browse files
Update 2021-08-16-resolve-33333-events.markdown
1 parent 7bca976 commit 0cdc2e5

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

docs/_posts/2021-08-16-resolve-33333-events.markdown

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,25 @@ Data Access Layer rejected retry on SqlError:
2828
Message: Violation of PRIMARY KEY constraint 'PK_StateChangeEvent'. Cannot insert duplicate key in object 'dbo.StateChangeEvent'. The duplicate key value is (b48055d3-18f2-40f7-a0e7-a0f8bd1b44a3).
2929
```
3030

31+
This Powershell Script will allow you to detect for Event ID 33333 being generated and get a count of unique Servers referenced across your OperationsManager Event Log:
32+
```powershell
33+
$events = (Get-EventLog -LogName 'Operations Manager' -Source 'DataAccessLayer' -ErrorAction SilentlyContinue | Where-Object { $_.EventID -eq 33333 })
34+
# If Event 33333 found in the OperationsManager Event Log, do the below
35+
if ($events.Message -like "*Violation of PRIMARY KEY constraint 'PK_StateChangeEvent'. Cannot insert duplicate key in object 'dbo.StateChangeEvent'. The duplicate key value is*")
36+
{
37+
$message = $events | %{ ($_ | Select-Object -Property Message -ExpandProperty Message) }
38+
$matches = $message -split "," | select-string "MonitorId=(.*)"
39+
$match = $matches.matches.groups[1].value.TrimEnd(")")
40+
"Found $($message.count) issues with the Event ID 33333 (Monitor Id: $match), see the following article:`n https://kevinholman.com/2017/05/29/stop-healthservice-restarts-in-scom-2016/"
41+
}
42+
```
43+
44+
Run the above script on each of your Management Servers in your Management Group.
45+
3146
I found that this correlates to this article written by Kevin Holman:
3247
[https://kevinholman.com/2017/05/29/stop-healthservice-restarts-in-scom-2016/](https://kevinholman.com/2017/05/29/stop-healthservice-restarts-in-scom-2016/)
3348

34-
Following the steps in the article above, will resolve the issues you are having with Event ID: **33333** above.
49+
Following the steps in the article above, will resolve the issues you are having with Event ID: **33333** `Violation of PRIMARY KEY constraint 'PK_StateChangeEvent'. Cannot insert duplicate key in object 'dbo.StateChangeEvent'.` .
3550

3651
<!--
3752
Having trouble with Pages? Check out our [documentation](https://docs.github.com/categories/github-pages-basics/) or [contact support](https://support.github.com/contact) and we’ll help you sort it out.

0 commit comments

Comments
 (0)