Resizing the database device is very simple in sybase ,only use disk resize command.But before,make sure that the physical device has enough space.If you use the file as the sybase database device,make sure that your filesystem has enough space.
1.Extend the physical device
Here used raw device in vxvm environment,the datavg group has enough space.The spw_db currently has 5GB that's full.So i want to extend it to 10GB.
- suse01:~ # vxassist -g datavg growto spw_db 10G
- suse01:~ # blockdev --getpbsz /dev/vx/dsk/datavg/spw_db
- 512
- suse01:~ # blockdev --getsz /dev/vx/dsk/datavg/spw_db
- 20971520
- suse01:~ # echo "20971520*512/1024/1024/1024"|bc
- 10
After extend,the spw_db resized to 10GB.
2.Resizing spw_db_dev
The database spwdb was created on spw_db_dev.Extend it when the spw_db_dev is full.
- 1> disk resize name=spw_db_dev,size='5G'
- 2> go
- 1> sp_helpdevice spw_db_dev
- 2> go
- device_name
- physical_name
- description
- status cntrltype
- vdevno ***_low
- ***_high
- --------------------------------------------
- ----------------------------------------------------------------------------------------------------
- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- ------------------------ ------------------------------------
- ------------------------ ----------------------------
- --------------------------------
- spw_db_dev
- /dev/vx/dsk/datavg/spw_db
- block device, special, dsync off, directio on, physical disk, 10240.00
- MB, Free: 5120.00 MB
- 2 0
- 5 0
- 5242879
- (1 row affected)
- dbname size
- allocated
- vstart lstart
- ------------------------ ----------------------------------------------------
- ----------------------------------------------------------------------------
- ---------------------------- ------------------------
- spwdb 3072.00 MB
- Oct 25 2012 11:01AM
- 0 0
- spwdb 2048.00 MB
- Oct 25 2012 11:01AM
- 1572864 786432
- (1 row affected)
- (return status = 0)