Sybase ASE: Extending an Existing Database Device

When the free space in the device where the DB is hosted is exhausted Sybase ASE gives following errors:

Msg 1105, Level 17, State 2
Server '', Procedure '', Line 15
Can't allocate space for object '' in database '' because 'default' segment is full/has no free extents. If you ran out of space in syslogs, dump the transaction log. Otherwise, use ALTER DATABASE to increase the size of the segment.
(return status = -7)
Could not execute statement.
Can't allocate space for object 'xxxxxx' in database 'xxx' because 'default' segment is full/has no free extents. If you ran out of space in syslogs, dump the transaction log. Otherwise, use ALTER DATABASE to increase the size of the segment.
Sybase error code=1105
Severity Level=17, State=16, Transaction State=0
Line 2

In such cases sometimes we need to extend the Database device, for which first we’ll identify the devices mapped to the database by executing following command:

> sp_helpdb <DB Name>
> go

Once the device is identified we would use following command to identify the free space in the device and the physical path of the device:

> sp_helpdevice <Device Name>
> go

If the mount point has sufficient space, use following command to extend the device:

> disk resize name='<Device Name>', size='Amount of space you want to add'
> go

Once space is added to the device we need to allocate that added space to the database by using following command:

> alter database <DB Name>
> on  <Data Device> = 'Amount of space you want to add' 
> log on  <Log Device> = 'Amount of space you want to add'
> go





Author: