(UNIX platforms only) Changes the device parameter settings of an existing database device file.
sp_deviceattr logicalname, optname, optvalue
is the logical name of an existing database device. The device can be stored on either an operating system file or a raw partition, but the dsync setting is ignored for raw partitions.
name of the attribute to change. Valid values are directio or dsync:
directio – enables Adaptive Server to write directly to disk, bypassing the operating system’s buffer system.
dsync – enables updates to the device take place directly on the storage media, or are buffered by the UNIX file system
The directio and dsync options are mutually exclusive; you cannot specify “true” for both at the same time.
can be either “true” or “false.”
Sets dsync on for the device named “file_device1”:
sp_deviceattr file_device1, dsync, true
For database devices stored on UNIX files, dsync determines whether updates to the device take place directly on the storage media, or are buffered by the UNIX file system.
When dsync is on, writes to the database device occur directly to 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 requests to update data have ever taken place on the physical media, and Adaptive Server may be unable to recover the database.
After using sp_deviceattr to change the dsync or directio setting, you must reboot Adaptive Server before the change takes affect.
sp_deviceattr displays a warning message if the dsync option is disabled for a database device file.
directio setting, you must reboot Adaptive Server before the change takes affect.
dsync is always on for the master device file. You cannot change the dsync setting for a master device file with sp_deviceattr.Therefore, you cannot set the directio option for the master device.
Turn off the dsync value only when the databases on the device does not need to 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; updates to those devices are never buffered, regardless of the dsync setting.
dsync is not used on the Windows NT platform.
The user executing sp_deviceattr must have permission to update the sysdevices table.
Values in event and extrainfo columns from the sysaudits table are:
Event |
Audit option |
Command or access audited |
Information in extrainfo |
---|---|---|---|
38 |
exec_procedure |
Execution of a procedure |
|
System procedures sp_helpdevice