question

Steve Jones - Editor avatar image
Steve Jones - Editor asked

Does an offline database clear the cache?

If I take a database offline, or remove all users from the database and set it to single user mode, does the cache clear? Are those entries for plans, data, etc., removed from memory?

memorycacheprocedure-cache
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Tom Staab avatar image
Tom Staab answered

According to MSDN,
The plan cache for the instance of SQL Server is cleared by setting one of the following options:

  • OFFLINE
  • READ_WRITE
  • ONLINE
  • MODIFY FILEGROUP DEFAULT
  • MODIFY_NAME
  • MODIFY FILEGROUP READ_WRITE
  • COLLATE
  • MODIFY FILEGROUP READ_ONLY
  • READ_ONLY
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.