Create Files for Database Devices

You can create new database devices using disk init.

You can specify a raw partition or operating system file. When using a raw partition, you must specify the full path to the partition. When using an operating system file, use the full path or a relative path. Path names are relative to your server’s current working directory.

SAP recommends that you specify the full path to all database devices. Do not use environment variables when specifying path names with disk init.

An example of creating a database device using disk init:

disk init name = "user_device1",
physname = "/work/data/device1.dat",
size = 2048

"size = 2048" allocates 2048 “virtual” pages to the device. A virtual page is 2048 bytes, so this command creates a 4MB device.

The example command does not specify a device number, instead letting the server choose one. Unless you need to assign a specific number to a given device, SAP recommends you use this method. If you do need an explicit device number, use the parameter "vdevno = N", where N is the device number you want to use.You cannot specify a device number that is in use by any other device on this server. Use sp_helpdevice to see what device numbers have already been used.

If you find that an existing database device is too small, use the disk resize command to make the device larger. This command takes the same “name” and “size” parameters as disk init, except the size parameter specifies how much larger you want the device to be.

disk resize allows you to dynamically increase the size of your database devices, rather than initializing a new device.You can use disk resize to increase the size for devices on raw partitions and file systems. The minimum increase on a device is 1MB or an allocation unit, whichever is greater.

Note: Operating system constraints limit how much larger you can make any given device. For example, you cannot make a device on a UNIX raw partition larger if you have already allocated the full defined size of that partition.

See the System Administration Guide, Volume 1 and the Reference Manual: Commands.

For more information about device files, see the Performance and Tuning Series: Physical Database Tuning.