Rebuilds the master database’s sysdevices system table. Use disk reinit as part of the procedure to restore the master database.
disk reinit name = "device_name", physname = "physicalname" , [vdevno = virtual_device_number ,] size = number_of_blocks [, vstart = virtual_address , cntrltype = controller_number] [, dsync = {true | false}] [, directio = {true | false}] [, instance = "instance_name"]
is the name of the database device, which must conform to the rules for identifiers, and must be enclosed in single or double quotes. This name is used in the create database and alter database commands.
is the name of the database device. The physical name must be enclosed in single or double quotes.
is the virtual device number, which must be unique among the database devices associated with Adaptive Server. The device number 0 is reserved for the master device. Otherwise, valid device numbers are between 1 and 2,147,483,647.
To determine the virtual device number, look at the device_number column of the sp_helpdevice report, and use the next unused integer.
is the current size of the device being reinitialized. The following are example unit specifiers, using uppercase, lowercase, and single and double quotes interchangeably: ‘k’ or “K” (kilobytes), “m” or ‘M’ (megabytes), “g” or “G” (gigabytes), and ‘t’ or ‘T’ (terabytes). Sybase recommends that you always include a unit specifier. Quotes are optional if you do not include a unit specifier. However, you must use quotes if you include a unit specifier.
is the starting virtual address, or the offset, for Adaptive Server to begin using the database device. The following are example unit specifiers, using uppercase, lowercase, and single and double quotes interchangeably: ‘k’ or “K” (kilobytes), “m” or ‘M’ (megabytes), “g” or “G” (gigabytes), and ‘t’ or ‘T’ (terabytes). Sybase recommends that you always include a unit specifier. Quotes are optional if you do not include a unit specifier. However, you must use quotes if you include a unit specifier. If you do not provide a unit specifier, the value provided is presumed to be in megabytes. 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
,
Adaptive Server uses 13 * 2K pages as the offset for the
starting address.
If you specify a unit value, vstart uses
it as the starting address. For example, if you specify vstart = "13M"
,
Adaptive 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, disk reinit 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 Sybase Technical Support.
specifies the disk controller. Its default value is 0. Reset it only if instructed to do so by Sybase Technical Support.
specifies whether writes to the database device take place directly to the storage media, or are buffered when using operating system files. This option is meaningful only when you are initializing an operating system file; it has no effect when initializing devices on a raw partition. By default, all operating system files are initialized with dsync set to true.
allows you to configure Adaptive Server to transfer data directly to disk, bypassing the operating system buffer cache. directio is a static parameter that requires a restart of Adaptive Server to take effect.
By default, directio is set to false for nonclustered Adaptive Servers, and to true for clustered Adaptive Servers.
The directio parameter is ignored for raw devices.
(clusters only) specifies the device as private and sets its owning instance to instance_name.
Adds a new row to the sysdevices table. This new row contains the characteristics of the existing device currently being reinitialized:
disk reinit name = "user_file", physname = "/usr/u/sybase/data/userfile1.dat", vdevno = 2, size = 5120, dsync = true
Adds a new row to the sysdevices table, with the data transferred directly to disk. This new row contains the characteristics of the existing device currently being reinitialized:
disk reinit name = "user_disk", physname = "/usr/u/sybase/data/userfile1.dat", size = 5120, directio= true
Sybase recommends that you 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 platform Sybase does not recommend.
disk reinit ensures that master..sysdevices is correct if the master database has been damaged or if devices have been added since the last dump of master.
disk reinit is similar to disk init, but does not initialize the database device.
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 reinit uses the virtual page size of 2K.
By default, the directio option is set to false (off) for all platforms.
For complete information on restoring the master database, see the System Administration Guide.
Do not set dsync to false for any device that stores critical data. The only exception is tempdb, which can safely be stored on devices for which dsync is set to false.
When dsync is on, writes to the database device are guaranteed to take place on the physical storage media, and Adaptive Server can recover data on the device in the event of a system failure.
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.”
When dsync is off, writes to the database device may be buffered by the UNIX file system. The UNIX file system may mark an update as being completed, even though the physical media has not yet been modified. In the event of a system failure, there is no guarantee that data updates have ever taken place on the physical media, and Adaptive Server may be unable to recover the database.
dsync is always on for the master device file.
Turn off the dsync value only when databases on the device need not be recovered after a system failure. For example, you may consider turning dsync off for a device that stores only the tempdb database.
Adaptive Server ignores the dsync setting for devices stored on raw partitions—writes to those device are guaranteed to take place on the physical storage media, regardless of the dsync setting.
The dsync setting is not used on the Windows NT platform.
disk reinit ensures that master..sysdevices is correct if the master database has been damaged or if devices have been added since the last dump of master.
ANSI SQL – Compliance level: Transact-SQL extension.
disk reinit permission defaults to system administrators and is not transferable. You must be in the master database to use disk reinit.
Values in event and extrainfo columns of sysaudits are:
Event |
Audit option |
Command or access audited |
Information in extrainfo |
---|---|---|---|
22 |
disk |
disk reinit |
|
Commands alter database, create database, dbcc, disk init, disk refit
System procedures sp_addumpdevice, sp_helpdevice