- 论坛徽章:
- 0
|
如何增加一个DEVICE的空间?
原帖由 "trytodoit" 发表:
disk resize
name=<device_name>;
size=<incremental_size>;
DISK RESIZE命令是12.5版本才有的,如果是12.5的话,直接用此命令就行了
对于之前的版本,麻烦一些,要手工修改sysdevices表,然后通过DISK MIRROR来扩展设备文件的大小,具体步骤如下
1、用sa登陆后,允许修改系统表
sp_configure 'allow updates',1
go
2、修改sysdevices表
update sysdevices set high=high+需要增加的设备大小(2K单位) where name='设备名称'
go
注意:修改之后总的设备尺寸不能超过2G
3、禁止修改系统表
sp_configure 'allow updates',0
go
4、建立镜象文件,这是因为直接修改sysdevices表之后,原来的设备文件大小并没有改变,不能使用,而镜象命令则可以按照新的设备尺寸重新建立新的设备文件
disk mirror name='设备名称', mirror='新的设备文件路径及名称'
go
执行该命令最后系统会提示“The remaining xxxx pages are currently unallocated and will be mirrored as they are allocated.”这表明扩展部分的内容并未镜象,但新设备文件已包含这段的长度
5、解除镜象
disk unmirror name='设备名称', side="primary", mode=remove
go
6、删除原来的设备文件,新的设备文件已经替代了原来的设备文件,而新的设备文件比原来的设备文件多出了扩展部分的空间。可以正常使用了 |
|