Makes a physical device or file usable by the SAP ASE server.
disk init name = "device_name", physname = { 'physical_name' | 'cache_name'} skip_alloc={true | false}, [vdevno = virtual_device_number,] size = number_of_blocks [, type = 'inmemory' ] [, vstart = virtual_address , cntrltype = controller_number] [, dsync = {true | false}] [, directio = {true | false}] [, instance = "instance_name"]
To determine the virtual device number, look at the device_number column of the sp_helpdevice report, and use the next unused integer.
5120 = 10MB
"5120" = 10MB
"10M" = 10MB
The size of the offset depends on how you enter the value for vstart.
If you do not specify a unit size, vstart uses 2K pages for its starting address. For example, if you specify vstart = 13, the SAP ASE server uses 13 * 2K pages as the offset for the starting address.
If you specify a unit value, vstart uses the unit value as the starting address. For example, if you specify vstart = "13M", the SAP ASE server sets the starting address offset at 13MB.
The default value (and usually the preferred value) of vstart is 0. If the specified device does not have the sum of vstart + size blocks available, the disk init command fails. If you are running the Logical Volume Manager on an AIX operating system, vstart should be 2. Specify vstart only if instructed to do so by SAP Technical Support.
directio is a static parameter that requires a restart of the SAP ASE server to take effect.
By default, directio is set to false for nonclustered SAP ASE servers, and to true for clustered SAP ASE servers.
The directio parameter is ignored for raw devices.
disk init name="d2", physname="/usr/sybase/devices/d3.dat", skip_alloc="true", size="10G"
SAP ASE servers do not allocate space during disk initialization if skip_alloc is set to true.
disk init name = "user_disk", physname = "/dev/rxy1a", vdevno = 2, size = 5120
disk init name = "user_file", physname = "/usr/u/sybase/data/userfile1.dat", vdevno = 2, size = 5120, dsync = true
disk init name = "user_disk", physname = "/usr/u/sybase/data/userfile1.dat", size = 5120, directio= true
disk init name = inmemory_dev, physname = 'imdb_cache', size = '3G', type = 'inmemory'
Use block devices as a database device only on the HP-UX, Windows, and Linux platforms. disk init and disk reinit display a warning message if you attempt to create a block device on a different platform.
Use skip_alloc to expedite crash recovery on non-NT file systems and on NT raw systems. Also, using skip_alloc with the directio feature creates devices faster and improves durability of updates. Regardless of space availability, skip_alloc always prints a warning message about making sure the SAP ASE server has the required space for future use.
The master device is initialized by the installation program; you need not initialize this device with disk init.
Devices created with disk init have restricted permissions.
To successfully complete disk initialization, the “sybase” user must have the appropriate operating system permissions on the device that is being initialized.
You can specify the size as a float, but the size is rounded down to the nearest multiple of 2K.
If you do not use a unit specifier for size, disk init uses the virtual page size of 2K.
One megabyte
One allocation unit of the server’s logical page size
directio and dsync are mutually exclusive. If a device has dsync set to true, you cannot set directio to true for this device. To enable directio for a device, you must first reset dsync to false.
directio is not available on all platforms. If you issue disk init with the directio parameter on a platform on which it is not supported, the SAP ASE server issues the message No such parameter: 'directio'.
Use disk init for each new database device. Each time disk init is issued, a row is added to master..sysdevices. A new database device does not automatically become part of the pool of default database storage. Use sp_diskdefault to assign default status to a database device.
Back up the master database with the dump database or dump transaction command after each use of disk init. This makes recovery easier and safer in case master is damaged. If you add a device with disk init and fail to back up master, you may be able to recover the changes by using disk reinit, then stopping and restarting the SAP ASE server.
Assign user databases to database devices using the on clause of the create database or alter database command.
The preferred method for placing a database’s transaction log (the system table syslogs) on a different device than the one on which the rest of the database is stored is to use the log on extension to create database. Alternatively, you can name at least two devices when you create the database, then execute sp_logdevice. You can also use alter database to extend the database onto a second device, then run sp_logdevice. The log on extension immediately moves the entire log to a separate device. The sp_logdevice method retains part of the system log on the original database device until transaction activity causes the migration to become complete.
For a report on all SAP ASE devices on your system (both database and dump devices), execute sp_helpdevice.
Use sp_dropdevice to remove a database device. You must first drop all existing databases on that device.
See also sp_diskdefault, sp_dropdevice, sp_helpdevice, sp_logdevice in Reference Manual: Procedures.
ANSI SQL – Compliance level: Transact-SQL extension.
The permission checks for disk init differ based on your granular permissions settings. You must be using the master database to use disk init.
Setting | Description |
---|---|
Enabled | With granular permissions enabled, you must be a user with manage disk privilege. |
Disabled | With granular permissions disabled, you must be a user with sa_role. disk init permission is not transferable. |
Values in event and extrainfo columns of sysaudits are:
Information | Values |
---|---|
Event | 20 |
Audit option | disk |
Command or access audited | disk init |
Information in extrainfo |
|