sp_helpcache {<cache_name> | "<cache_size>[P | K | M | G]" ,
‘instance <instance_name>’}
<cache_name>
是现有数据高速缓存的名称。
<cache_size>
指定高速缓存的大小,指定 P 表示页,指定 K 表示千字节,指定 M 表示兆字节,指定 G 表示千兆字节。缺省值为 K。
<instance_name>
是要调查其高速缓存的实例的名称。
显示与绑定到 pub_cache 的项有关的信息:
sp_helpcache pub_cache
显示创建 80 MB 数据高速缓存所需的开销量:
sp_helpcache "80M"
显示与所有高速缓存和绑定到它们的所有项有关的信息:
sp_helpcache
(仅限 Cluster Edition)显示实例“blade1”上大小为 10 M 的高速缓存 C2 的开销:
sp_helpcache 'C2', '10M', 'instance blade1'
显示不同类型高速缓存的输出:
sp_helpcache
Cache Name Config Size Run Size Overhead Cache Type
------------------- ------------- ---------- ---------- ------------
HK_ignore_cache 10.00 Mb 10.00 Mb 0.30 M Mixed
default data cache 8.00 Mb 8.00 Mb 0.26 Mb Default
imdb_cache 400.00 Mb 400.00 Mb 8.17 Mb In-Memory
imrs_cache1 1024.00 Mb 1024.00 Mb 1.99 Mb Row Storage
imrs_cache2 1024.00 Mb 1024.00 Mb 1.99 Mb Row Storage
log_cache 10.00 Mb 10.00 Mb 0.30 Mb Log Only
mixed_cache 10.00 Mb 10.00 Mb 0.30 Mb Mixed
Memory Available For Memory Configured
Named Caches To Named Caches
-------------------- ----------------
2486.04 Mb 2486.00 Mb
------------------ Cache Binding Information: ------------------
Cache Name Entity Name Type Index Name
Status
---------- ----------- ---- ----------
------
imdb_cache imdb database
V
mixed_cache sybsystemprocs.dbo.sysindexes index csysindexes
V
mixed_cache sybsystemprocs.dbo.sysobjects table
V
------------------ In-memory Storage Cache Space Information ------------------
Cache Name Device Name Status Start Page Number of Pages Size(KB)
------------ ------------- -------- ------------ ----------------- ----------
imdb_cache imdb_dev1 active 0 24576 49152
imdb_cache imdb_logdev1 active 24576 12288 24576
imdb_cache None free 36864 167936 335872
------------------ Row Storage Cache Information ------------------
Cache Name Database Name Memtotal Memused Memfree
------------ --------------- ---------- ---------- ----------
imrs_cache2 imrsdb 1024.00 Mb 257.00 Mb 767.00 Mb
显示关于未绑定到数据库的 IMRS 高速缓存的信息:
sp_helpcache imrs_cache1
Cache Name Config Size Run Size Overhead Cache Type
------------ ------------- ---------- ---------- ------------
imrs_cache1 1024.00 Mb 1024.00 Mb 1.99 Mb Row Storage
示例 7
显示关于绑定到数据行高速缓存数据库的 IMRS 高速缓存的信息:
sp_helpcache imrs_cache2
Cache Name Config Size Run Size Overhead Cache Type
------------ ------------- ---------- ---------- ------------
imrs_cache2 1024.00 Mb 1024.00 Mb 1.99 Mb Row Storage
------------------ Row Storage Cache Information ------------------
Cache Name Database Name Memtotal Memused Memfree
------------ --------------- ---------- ---------- ----------
imrs_cache2 imrsdb 1024.00 Mb 257.00 Mb 767.00 Mb
```
使用 sp_helpcache 时,还存在一些其它注意事项: