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 } ]
is the name of the database device. It must conform to the rules for identifiers, and it 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. It must be unique among devices used by Adaptive Server. The device number 0 is reserved for the master database device. Legal numbers are between 1 and 255, but cannot be greater than the number of database devices for which your system is configured. The default is 50 devices.
is the amount of space to allocate to the database extension. size can be in the following unit specifiers: ‘k’ or ‘K’ (kilobytes), ‘m’ or ‘M’ (megabytes), and ‘g’ or ‘G’ (gigabytes). 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. vstart accepts the following optional unit specifiers: ‘k’ or ‘K’ (kilobytes), ‘m’ or ‘M’ (megabytes), and ‘g’ or ‘G’ (gigabytes). 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
this as the starting address. For example, if you specify vstart = "13M"
,
Adaptive Server sets the starting address offset at 13 megabytes.
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 reinit 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 Sybase Technical Support.
specifies the disk controller. Its default value is 0. Reset it only if instructed to do so by Sybase Technical Support.
UNIX platforms only – specifies whether writes to the database device take place directly to the storage media, or are buffered when using UNIX operating system files. This option is meaningful only when you are initializing a UNIX operating system file; it has no effect when initializing devices on a raw partition. By default, all UNIX operating system files are initialized with dsync set to true.
Initializes 10MB of a disk on a UNIX operating system file. Adaptive Server opens the device file with the dsync setting, and writes to the file are guaranteed to take place directly on the storage media:
disk reinit name = "user_file", physname = "/usr/u/sybase/data/userfile1.dat", vdevno = 2, size = 5120, dsync = true
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.
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.
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.
The dsync value should be turned off 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.
Commands alter database, create database, dbcc, disk init, disk refit
System procedures sp_addumpdevice, sp_helpdevice