When working with containers to store data, the database manager supports direct disk (raw) access using the block device interface (that is, raw I/O).
The following information should be used when working in a Linux environment. On Linux/390, the database manager does not support direct disk access devices.
To configure or raw I/O on Linux:
In this example, the raw database partition to be used is /dev/sda5. It should not contain any valuable data.
# fdisk /dev/sda
Command (m for help): p
Disk /dev/sda: 255 heads, 63 sectors, 1106 cylinders
Units = cylinders of 16065 * 512 bytes
Device boot | Start | End | Blocks | Id | System |
---|---|---|---|---|---|
/dev/sda1 | 1 | 523 | 4200997 | 83 | Linux |
/dev/sda2 | 524 | 1106 | 4682947+ | 5 | Extended |
/dev/sda5 | 524 | 1106 | 4682947 | 83 | Linux |
Command (m for help): q
#
The number of pages in /dev/sda5 is:num_pages = floor( (4682947 * 1024)/4096 )
num_pages = 1170736
CREATE TABLESPACE dms1
MANAGED BY DATABASE
USING (DEVICE '/dev/sda5' 1170736)
CREATE TABLESPACE TS4
MANAGED BY DATABASE USING (DEVICE 'C:\JUNCTION\DISK_1' 10000,
DEVICE 'C:\JUNCTION\DISK_2' 10000)
The database manager
first queries the partition to see whether there is a file system
R on it; if yes, the partition is not treated as a RAW device, and
performs normal file system I/O operations on the partition.Table spaces on raw devices are also supported for all other page sizes supported by the database manager.
Prior to Version 9, direct disk access using a raw controller utility on Linux was used. This method is now deprecated, and its use is discouraged. The database manager will still allow you to use this method if the Linux operating system still supports it, however, there will be a message in the db2diag log files that will indicate that its use is deprecated.
CREATE TABLESPACE dms1
MANAGED BY DATABASE
USING (DEVICE '/dev/raw/raw1' 1170736)