Cleanup of stale DB entries skipped

Kevin Howard 0 Reputation points
2025-02-03T18:30:07.4333333+00:00

I have log shipping enabled on a User Database and that database is also using memory optimized tables. It looks like the folder that contains the $HKv2 files on the secondary server are not being deleted after the restore of the log file on the secondary. The oldest $HKv2 file is back in August 2024. Not sure if that is when I setup log shipping or not.

After the database is restored on the secondary it is read-only. Do not see any errors in the SQL Server or Windows Event log except in the SQL server it states

'Cleanup of stale DB entries skipped because master db is not memory optimized. DbId: 6.'

Not sure if I need to make any adjustments to the master on the secondary server and I am running into a brick wall so any help is greatly appreciated. I don't want to continue adding disk space.

I am also not sure if I can just delete the old $HKv2 files as the errorlog file shows me that after the message above I see this message

'HkCkptLoadInternalEx(): Database ID: [6]. Root file: {349FE487-A1B7-4A73-AA42-3C60E4E7D2AD}'

That {349 file is very recent as it keeps coming up after every log restore which is set for 15 minutes.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,470 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Erland Sommarskog 116.8K Reputation points MVP
    2025-02-04T22:36:52.19+00:00

    I have not worked with In-Memory OLTP in production, and I have certainly not tried it with log-shipping, so my answer is not the most helpful one.

    The first thought that came to me is that you would need to perform recovery of the database to get rid of these files, but of course you don't want to do that with log-shipping. And my thought may be completely wrong; I have nothing to back it up.

    Else: well, you can always stop the log-shipping and start again with a new fresh backup from production. Not pretty, but maybe acceptable if you only need to do it every third month or so.

    I will need to admit that I don't understand the message Cleanup of stale DB entries skipped because master db is not memory optimized. Master is typically not memory-optimized.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.