statement cache save argument: Save the SQL statement cache (SQL administration API)

Use the statement cache save argument with the admin() or task() function to save the statement cache.

Syntax


>>-EXECUTE FUNCTION--+-admin-+--(--+-"statement cache save"-+----->
                     '-task--'
>--)--;----------------------------------------------------------><

Usage

statement cache save is used to:
  • Lock the Statement Cache
  • Drop sysadmin:statement_cache table if it exists
  • Create new sysadmin:statement_cache table
  • Copy each entry from the Statement Cache and insert into the sysadmin:statement_cache table
    Note: If cache entry is Locked, the query plan will be preserved so that it can persist as-is when being restored.
    Note: If cache entry is Locked and has STMT_CACHE_QUERY_PLAN enabled, the current query plan will be stored in text form so it can persist as-is when being restored.
  • Unlock the Statement Cache