disk mirror starts disk mirroring. Do not initialize the mirror device with disk init. A database device and its mirror constitute one logical device. The disk mirror command adds the mirror name to the mirrorname column in the sysdevices table.
To retain use of asynchronous I/O, always mirror devices that are capable of asynchronous I/O to other devices capable of asynchronous I/O. In most cases, this means mirroring raw devices to raw devices and operating system files to operating system files.
If the operating system cannot perform asynchronous I/O on files, mirroring a raw device to a regular file produces an error message. Mirroring a regular file to a raw device will work, but will not use asynchronous I/O.
The disk mirror syntax is:
disk mirror name = "device_name" , mirror = "physicalname" [ , writes = { serial | noserial }]
The device_name is the name of the device that you want to mirror, as it is recorded in sysdevices.name (by disk init). Use the mirror = “physicalname” clause to specify the path to the mirror device, enclosed in single or double quotes. If the mirror device is a file, “physicalname” must unambiguously identify the path where Adaptive Server will create the file; it cannot specify the name of an existing file.
On systems that support asynchronous I/O, the writes option allows you to specify whether writes to the first device must finish before writes to the second device begin (serial) or whether both I/O requests are to be queued immediately, one to each side of the mirror (noserial). In either case, if a write cannot be completed, the I/O error causes the bad device to become unmirrored.
serial writes are the default. The writes to the devices take place consecutively, that is, the first one finishes before the second one starts. serial writes provide protection in the case of power failures: one write may be garbled, but both of them will not be. serial writes are generally slower than noserial writes.
In the following example, tranlog is the logical device name for a raw device. The tranlog device was initialized with disk init and is being used as a transaction log device (as in create database...log on tranlog). The following command mirrors the transaction log device:
disk mirror name = "tranlog", mirror = "/dev/rxy1e"