sp_nvcacheconfig <cachename>,'device=<device_name>'[, 'dirty_threshold=<threshold_percent>']
<cachename>
是 NV 高速缓存的名称
device=<device_name>
是非易变高速缓存所驻留的非易变设备
dirty_threshold=<threshold_percent>
在 NV 高速缓存中指定脏缓冲区阈值,超出该阈值后,NV 高速缓存消极清理程序任务将会清理此高速缓存。有效值为:
如果值低,NV 高速缓存消极清理程序将对 HDD 执行频繁的写入操作以清理 NV 高速缓存中的页。
此示例在名为“cachedisk”的设备上创建名为“nvc”的 NV 高速缓存:
1> sp_nvcacheconfig nvc, 'device=cachedisk'
2> go
(return status = 0)
1> sp_nvcacheconfig
2> go
NV Cache Name NV Cache Size Dirty Threshold
--------------- --------------- -----------------
nvc 1024.00 MB 50
(1 row affected)
NV Cache Name NV Device Name NV Device Location
--------------- ---------------- --------------------
nvc cachedisk ./cachedisk.dat
(return status = 0)
此示例在名为“cachedisk”的设备上创建名为“nvc”的 NV 高速缓存,其中脏阈值百分比为 40:
1> sp_nvcacheconfig 'nvc', 'device=cachedisk', 'dirty_threshold=40'
2> go
此示例删除名为“nvCache1”的 NV 高速缓存:
1> sp_nvcacheconfig nvCache1,'device=NULL'
NV cache = nvCache1 is being deleted
(return status = 0)
1> sp_nvcacheconfig
2> go
No NV Cache exists for this server
(return status = 1)
此示例显示与所有指定 NV 高速缓存有关的信息。
1> sp_nvcacheconfig
2> go
NV Cache Name NV Cache Size Dirty Threshold
--------------- --------------- -----------------
nvc1 10.00 MB 50
nvc2 10.00 MB 50
nvc3 10.00 MB 50
(1 row affected)
NV Cache Name NV Device Name NV Device Location
--------------- ---------------- --------------------
nvc1 cachedisk1 ./cachedisk1.dat
nvc2 cachedisk2 ./cachedisk2.dat
nvc3 cachedisk3 ./cachedisk3.dat
(return status = 0)
此示例显示与名为“nvc1”的 NV 高速缓存有关的信息:
1> sp_nvcacheconfig nvc1
2> go
NV Cache Name NV Cache Size Dirty Threshold
--------------- --------------- -----------------
nvc1 10.00 MB 50
(1 row affected)
NV Cache Name NV Device Name NV Device Location
--------------- ---------------- --------------------
nvc1 cachedisk1 ./cachedisk1.dat
(return status = 0)
示例代码
disk init name="NV_CACHE1",
physname="/my_dev11/user1/cssdDir/bootClust/devDir/nvdev11.dat", size="1000M",
type='nvcache'