Need a larger master device with Sybase ASE?

For those of you that may not know, you can use the supported method to increase the size of any Sybase ASE database device starting with ASE 12.5.0.1. Obviously, you will need to ensure that the filesystem or raw device the database device is pointing to is large enough:

For raw devices (unix/linux inspecific):

dd if=/dev/raw_device of=/dev/null bs=1M

For filesystems (unix/linux inspecific):

df -k

For Windows, use Windows Explorer.

If you don’t have enough space, you will need to increase the size of the filesystem or raw device. These can be easily done in Windows (i.e. Partition Magic is very handy) or Linux/Unix via a logical volume manager and/or gparted.

To increase the size of the database device, you will want to make a backup of any of the databases that reside on the device. Since we’re going to extend the master device, we would want to back up the master database:

dump database master to "/sybdump/master.dmp"

We are ready to extend the master device:

disk resize "master", size = "170M"

Once that completes, we might as well increase the master database from 12MBytes to 50MBytes:

alter database master on master = "38M"

That’s it! 🙂

Share Button

HOWTO: Fixing a raw device misconfiguration

If you were observent in the Mapping Linux LVM and Raw partitions blog post, you probably noticed that there are two raw devices pointing to the same logical volume

raw -qa
/dev/raw/raw1:  bound to major 253, minor 7
/dev/raw/raw2:  bound to major 253, minor 8
/dev/raw/raw3:  bound to major 253, minor 9
/dev/raw/raw4:  bound to major 253, minor 10
/dev/raw/raw5:  bound to major 253, minor 12
/dev/raw/raw6:  bound to major 253, minor 13
/dev/raw/raw7:  bound to major 253, minor 15
/dev/raw/raw8:  bound to major 253, minor 15
/dev/raw/raw10: bound to major 253, minor 16
/dev/raw/raw11: bound to major 253, minor 17

Correcting this misconfiguration is easy but can be painful if the devices have been put to use (maybe as a database device).  Since we’ve already done the mapping (see Mapping Linux LVM and Raw partitions), we know the devices that they should be mapped to.

Let’s assume that no one has starting using either raw device and fix it the easy way (as root):

raw /dev/raw/raw7 /dev/dbvg/rawdatavol07
/dev/raw/raw7:  bound to major 253, minor 14
raw /dev/raw/raw8 /dev/dbvg/rawdatavol08
/dev/raw/raw8:  bound to major 253, minor 15

We have one more step, we need to update whatever script is run at start up to configure the raw devices to make sure that the mapping is retained after we reboot:

On RedHat and derived distributions, we modify the /etc/sysconfig/rawdevices:

/dev/raw/raw1 /dev/dbvg/rawdatavol01
/dev/raw/raw2 /dev/dbvg/rawdatavol02
/dev/raw/raw3 /dev/dbvg/rawdatavol03
/dev/raw/raw4 /dev/dbvg/rawdatavol04
/dev/raw/raw5 /dev/dbvg/rawdatavol05
/dev/raw/raw6 /dev/dbvg/rawdatavol06
/dev/raw/raw7 /dev/dbvg/rawdatavol07
/dev/raw/raw8 /dev/dbvg/rawdatavol08
/dev/raw/raw10 /dev/dbvg/rawdatavol10
/dev/raw/raw11 /dev/dbvg/rawdatavol11

RedHat provides the script file /etc/init.d/rawdevices that will read the /etc/sysconfig/rawdevices and while we could use it to correct the raw device mappings…. It is my understanding that remapping of the raw devices that are in use may allow for loss of data at the instant that the remapping takes place.  So, we avoid the whole situation and run the raw command on only the devices that are mismapped.

Share Button