Building a new master device

Build a new master device only if your old master device is damaged beyond repair. Otherwise, you can re-create the master and model databases on your existing master device.

There are two procedures for recreating the master database: replacement of the master device, and forcing Adaptive Server to re-create the configuration area. Replace the master device when the master database is corrupted. If the master device’s configuration area is also corrupt, force Adaptive Server to re-create the configuration area. You can often detect corruption in the configuration area because the server does not run, and produces error messages stating the area is corrupt.

The following examples use the UNIX dataserver command. On Windows, use the sqlsrvr command.

StepsReplacing the master device

  1. Rebuild the master device with the dataserver -w option:

    dataserver -w master
    

    NoteYour dataserver command may include other options such as command line flags specifying the device path name, server name, interfaces file name, and so on. These options are listed in the RUN_servername file that normally starts this server.

    The -w master option causes Adaptive Server to search the device for database fragments belonging to the master database. After it finds these fragments, it writes a default master database into that space, then shuts down.

  2. Restart Adaptive Server with the RUN_servername file.

StepsRebuilding the configuration area

If the configuration area is corrupt, you must use the -f option to force Adaptive Server to reconstruct this area.

NoteYour dataserver command may include other options such as command line flags specifying the device path name, server name, interfaces file name, and so on. These options are listed in the RUN_servername file that normally starts this server.

The following restrictions apply:

WARNING! Do not attempt to use this procedure to change your server’s logical page size. Doing so furthor corrupts the device to the point where you cannot recover it. Any device size you specify must be accurate; dataserver -w does not alter the device’s size, but it may fail to find parts of some databases if the specified size is too small, and can fail entirely if the specified size is too large.

The -w master option, with or without -f, re-creates only the master database. All other allocation units on the disk remain unchanged, so you may be able to recover the data using disk refit.

If the entire master device is corrupt (for example, in the case of a disk failure), replace the entire device by starting Adaptive Server using the dataserver -zpage_size. . .-bdevice_size:

  1. If the existing master device is not on a raw partition and you plan to reuse it, remove the old master device file.

  2. Start the server with dataserver -zpage_size. . .-bdevice_size.

WARNING! You cannot use this command to change the server’s page size at this time. All the other devices for this server use the configured page size, and will not recover properly if you use a different page size. However, since you are creating a new file, you can change the device size.

When determining how large to make your master device, keep in mind that this device reserves 8KB for its configuration area. For example, if you specify the device size as 96MB, some space is wasted because there is not enough space for a full allocation unit. Add an additional .01MB to the space you require for the device to account for this overhead. For example, to use a full 96MB for the device, specify -b96.01M.

When you use this method to rebuild the master device, Adaptive Server creates new, default databases for master, model, tempdb, and sybsystemdb. These databases are all as small as possible for your installation’s logical page size. If you intend to load backups to these databases, they may now be too small. Before loading these backups, use alter database to increase the size of the databases.

No matter which method you use to restore your master device, all users and passwords in your master database will be gone. The only remaining privileged login is “sa”, with no password.

See the Utility Guide for information about re-creating users and passwords.