Using directio to bypass operating system buffer

The directio parameter for disk init, disk reinit, and sp_deviceattr allows you to configure Adaptive Server to transfer data directly to disk, bypassing the operating system buffer cache. directio performs I/O in the same manner as raw devices and provides the same performance benefit as raw devices, but has the ease of use and manageability of file system devices. You cannot set directio for the master device. directio is a static parameter; restart Adaptive Server for it to take effect.

Notedirectio is not available on all platforms. If you issue disk init with the directio parameter on a platform on which it is not supported, Adaptive Server issues the message No such parameter: 'directio'.

By default, the directio option is set to false (off) for all platforms.

NoteDevices used for databases for which recovery is not important (for example, tempdb), may, by default, have dsync set to false. For these devices, enabling directio may have an adverse performance effect, so carefully review device use before you enable directio.

This example creates a device named “user_disk” that uses directio to write data directly to disk:

disk init 
name = "user_disk", 
physname = "/usr/u/sybase/data/userfile1.dat", 
size = 5120, directio = true

To initializes 10MB of a disk on a UNIX operating system file, enter:

disk reinit 
name = "user_disk", 
physname = "/usr/u/sybase/data/userfile1.dat", 
size = 5120, directio = true

By default, directio is disabled for all existing devices; enable it using sp_deviceattr:

sp_deviceattr device_name, directio, [true | false]

For example, the following enables directio disk writes for the “user_disk” device:

sp_deviceattr user_disk, directio, true