ERP server is running slower than normal
Posted by Floridaxmen@reddit | sysadmin | View on Reddit | 9 comments
Got several users saying our ERP program is running slower than normal. Logging onto the server, I am noticing a lot of errors in the Event Viewer. Having trouble finding out how to resolve these errors. Has anyone encountered these before and/or have suggestions on how to resolve them?
Log Name: Application
Source: MSSQLSERVER
Date: 3/31/2026 9:46:45 AM
Event ID: 28005
Task Category: Server
Level: Error
Keywords: Classic
User: N/A
Computer:
Description:
An exception occurred while enqueueing a message in the target queue. Error: 15517, State: 1. Cannot execute as the database principal because the principal "dbo" does not exist, this type of principal cannot be impersonated, or you do not have permission.
Event Xml:
15517
1
Cannot execute as the database principal because the principal "dbo" does not exist, this type of principal cannot be impersonated, or you do not have permission.
jason9045@reddit
Set the database owner to sa or whatever else you may have named the main SQL administrator account. If the owner is set to an invalid account, or a disabled one, a lot of things will break.
Floridaxmen@reddit (OP)
That did the trick and resolved the errors. Thank you.
DatDing15@reddit
But you should try to continue analyzing the issue. This fix should not be considered temporary - because those tend to stay permanent. Rather consider it emergency.
The sa account should not stay database owner. Its bad practice and a security risk.
iotic@reddit
If it seems weird, it's one of these, DNS, RAM, Storage, Hackers - in that order
Independent-Arrival1@reddit
Can you validate ? :
Also can you check ? :
If fixing the owner doesn’t stabilize things, there’s usually a second layer (orphaned users, broken job context, etc.)
Thanks
shrimp_blowdryer@reddit
You’re not dealing with some mysterious “ERP is slow” ghost. SQL is literally telling you it’s tripping over its own permissions.
That error is the key:
Cannot execute as the database principal “dbo”
Translation: something in your SQL instance is trying to run as dbo, and SQL has no idea who that actually maps to anymore. That’s broken ownership.
⸻
What’s actually going on
This usually happens when: • A database got restored from another server • The original owner login doesn’t exist on this instance • Or the owner SID is orphaned
So now anything using Service Broker, jobs, queues, or stored procedures with EXECUTE AS is failing repeatedly
And yeah, that will slow your ERP down because: • retries • queue failures • jobs choking in the background
⸻
Stop guessing and check this first
Run this in SQL:
SELECT name, SUSER_SNAME(owner_sid) AS owner FROM sys.databases;
If you see: • NULL • or some weird old account
Congrats, that’s your problem.
⸻
Fix it (this is usually all it takes)
Set the DB owner properly:
ALTER AUTHORIZATION ON DATABASE::YourDBName TO sa;
Or if you don’t like using sa, use a valid login that exists.
⸻
If it’s tied to Service Broker / queues
That “enqueueing a message in the target queue” line is a giveaway.
Check: • SQL Agent jobs • Service Broker queues • Any ERP-related messaging components
They’re probably running under EXECUTE AS OWNER or similar
If owner is busted → everything using that context fails
⸻
Also check orphaned users (because why not)
EXEC sp_change_users_login 'Report';
If you see users not mapped to logins, fix them.
⸻
Reality check
You’re not fixing “performance” here. You’re fixing a broken identity/permission issue that’s causing the performance problem.
If you ignore that and start tuning indexes or throwing more CPU at it, you’re just polishing a broken system.
⸻
TL;DR • Your DB owner is likely invalid • SQL can’t impersonate dbo • Background processes are failing and slowing things down • Fix the DB owner → errors stop → performance likely stabilizes
⸻
If you want, drop what ERP this is and I’ll tell you exactly where it’s probably breaking, because some of them are notorious for this.
Ok-Double-7982@reddit
"Has anyone encountered these before and/or have suggestions on how to resolve them?"
Suggestion: move to the cloud and let the vendor manage this.
Tack122@reddit
Been changing passwords lately, or disabling old users?
IFarmZombies@reddit
Did someone disable an account they shouldnt have?