sys.dm_os_memory_cache_counters (Transact-SQL)sys.dm_os_memory_cache_counters (Transact-SQL)

适用对象: 是SQL Server 否Azure SQL 数据库 否Azure Synapse Analytics (SQL DW) 否并行数据仓库 APPLIES TO: yesSQL Server noAzure SQL Database noAzure Synapse Analytics (SQL DW) noParallel Data Warehouse

返回 SQL ServerSQL Server 中缓存运行状况的快照。Returns a snapshot of the health of a cache in SQL ServerSQL Server. dm_os_memory_cache_counters提供有关已分配缓存项的运行时信息、其使用情况以及缓存项的内存源。sys.dm_os_memory_cache_counters provides run-time information about the cache entries allocated, their use, and the source of memory for the cache entries.

注意: 若要从 Azure Synapse Analytics (SQL DW)Azure Synapse Analytics (SQL DW)并行数据仓库Parallel Data Warehouse中调用此名称,请使用名称sys.databases. dm_pdw_nodes_os_memory_cache_countersNOTE: To call this from Azure Synapse Analytics (SQL DW)Azure Synapse Analytics (SQL DW) or 并行数据仓库Parallel Data Warehouse, use the name sys.dm_pdw_nodes_os_memory_cache_counters.

列名Column name 数据类型Data type 描述Description
cache_addresscache_address varbinary(8)varbinary(8) 指示与特定缓存关联的计数器的地址(主键)。Indicates the address (primary key) of the counters associated with a specific cache. 不可为 null。Is not nullable.
名称name nvarchar(256)nvarchar(256) 指定缓存的名称。Specifies the name of the cache. 不可为 null。Is not nullable.
typetype nvarchar(60)nvarchar(60) 指示与该项关联的缓存的类型。Indicates the type of cache that is associated with this entry. 不可为 null。Is not nullable.
single_pages_kbsingle_pages_kb bigintbigint 适用于SQL Server 2008SQL Server 2008SQL Server 2008 R2SQL Server 2008 R2Applies to: SQL Server 2008SQL Server 2008 through SQL Server 2008 R2SQL Server 2008 R2.

已分配的单页内存量(千字节)。Amount, in kilobytes, of the single-page memory allocated. 这是通过单页分配器分配的内存量。This is the amount of memory allocated by using the single-page allocator. 它指的是从此缓存的缓冲池中直接获取的 8 KB 页。This refers to the 8-KB pages that are taken directly from the buffer pool for this cache. 不可为 null。Is not nullable.
pages_kbpages_kb bigintbigint 适用于SQL Server 2012 (11.x)SQL Server 2012 (11.x) 及更高版本。Applies to: SQL Server 2012 (11.x)SQL Server 2012 (11.x) and later.

指定缓存中分配的内存量 (KB)。Specifies the amount, in kilobytes, of the memory allocated in the cache. 不可为 null。Is not nullable.
multi_pages_kbmulti_pages_kb bigintbigint 适用于SQL Server 2008SQL Server 2008SQL Server 2008 R2SQL Server 2008 R2Applies to: SQL Server 2008SQL Server 2008 through SQL Server 2008 R2SQL Server 2008 R2.

已分配的多页内存的容量(千字节)。Amount, in kilobytes, of the multipage memory allocated. 这是使用内存节点的多页分配器分配的内存量。This is the amount of memory allocated by using the multiple-page allocator of the memory node. 此内存在缓冲池外面分配,利用了内存节点虚拟分配器的优势。This memory is allocated outside the buffer pool and takes advantage of the virtual allocator of the memory nodes. 不可为 null。Is not nullable.
pages_in_use_kbpages_in_use_kb bigintbigint 适用于SQL Server 2012 (11.x)SQL Server 2012 (11.x) 及更高版本。Applies to: SQL Server 2012 (11.x)SQL Server 2012 (11.x) and later.

指定缓存中分配并使用的内存量 (KB)。Specifies the amount, in kilobytes, of the memory that is allocated and in use in the cache. 可以为 Null。Is nullable. 不跟踪类型为 USERSTORE_<*> 的对象的值。Values for objects of type USERSTORE_<*> are not tracked. 将针对其报告 NULL。NULL is reported for them.
single_pages_in_use_kbsingle_pages_in_use_kb bigintbigint 适用于SQL Server 2008SQL Server 2008SQL Server 2008 R2SQL Server 2008 R2Applies to: SQL Server 2008SQL Server 2008 through SQL Server 2008 R2SQL Server 2008 R2.

正在使用的单页内存量(千字节)。Amount, in kilobytes, of the single-page memory that is being used. 可以为 Null。Is nullable. 不会为类型 USERSTORE_<* > 的对象跟踪此信息,这些值将为 NULL。This information is not tracked for objects of type USERSTORE_<*> and these values will be NULL.
multi_pages_in_use_kbmulti_pages_in_use_kb bigintbigint 适用于SQL Server 2008SQL Server 2008SQL Server 2008 R2SQL Server 2008 R2Applies to: SQL Server 2008SQL Server 2008 through SQL Server 2008 R2SQL Server 2008 R2.

正在使用的多页内存量(千字节)。Amount, in kilobytes, of the multipage memory that is being used. 可以为 null.NULLABLE. 不会为类型 USERSTORE_<* > 的对象跟踪此信息,这些值将为 NULL。This information is not tracked for objects of type USERSTORE_<*>, and these values will be NULL.
entries_countentries_count bigintbigint 指示缓存中的条目数。Indicates the number of entries in the cache. 不可为 null。Is not nullable.
entries_in_use_countentries_in_use_count bigintbigint 指示缓存中正在使用的条目数。Indicates the number of entries in the cache that is being used. 不可为 null。Is not nullable.
pdw_node_idpdw_node_id intint 适用于: Azure Synapse Analytics (SQL DW)Azure Synapse Analytics (SQL DW)并行数据仓库Parallel Data WarehouseApplies to: Azure Synapse Analytics (SQL DW)Azure Synapse Analytics (SQL DW), 并行数据仓库Parallel Data Warehouse

此分发所在的节点的标识符。The identifier for the node that this distribution is on.

PermissionsPermissions

SQL ServerSQL Server上,需要 VIEW SERVER STATE 权限。On SQL ServerSQL Server, requires VIEW SERVER STATE permission.
SQL 数据库SQL Database 高级层上,需要数据库中的 VIEW DATABASE STATE 权限。On SQL 数据库SQL Database Premium Tiers, requires the VIEW DATABASE STATE permission in the database. SQL 数据库SQL Database 标准层和基本层上,需要服务器管理员Azure Active Directory 管理员帐户。On SQL 数据库SQL Database Standard and Basic Tiers, requires the Server admin or an Azure Active Directory admin account.

另请参阅See Also

与操作系统相关的动态管理视图(SQL Server transact-sql)SQL Server Operating System Related Dynamic Management Views (Transact-SQL)