Adding a Database Device

You add a database device by using SQL Enterprise Manager or the DISK INIT statement. The following procedure assumes that you are using SQL Enterprise Manager. For information about using the DISK INIT statement, see the Microsoft SQL Server Transact-SQL Reference.

Note If you are planning to use hardware- or operating system-based striping to hold large databases, set up the stripe sets prior to defining devices. For information see Chapter 7, Managing Drives.

    To add a database device
  1. From the Server Manager window, select a server, and then from the toolbar, choose the Manage Devices button.

    The Manage Database Devices window appears.

  2. Choose the New Device button.

    The New Database Device window appears.

  3. In the Name box, type a name for the device.
  4. In the Drive box, select a drive on which to place the device.
  5. In the Path box, specify the path of the system file for this device.

    The Path box is filled in automatically using a combination of the name you entered in the Name box and the location of this SQL Server's MASTER device. To change the location, type a different path in the box, or choose the Locate button and select a different directory from the displayed directory tree.

  6. In the Size box, type a size for the device.

    Choose a size that is adequate for the intended use of this device. The Available Storage Space graph displays space available on the local drives. The size is represented in megabytes.

  7. To make the device a default device (a device on which databases are created if no device is specified), select the Default Device checkbox.
  8. To mirror the device, choose Mirroring, and complete the Database Device Mirroring dialog box that appears.

    SQL Server mirroring is used to ensure full recovery and continued operation in the event of media failure. For more information on mirroring, see Chapter 7, Managing Drives.

  9. In the New Database Device window, choose OK.

    The device is created.

When a database device is created, its logical and physical names are entered in the sysdevices table in the master database.

You can also create a new database device while creating or modifying a database. This allows you to create a new device at the time you create the database or transaction log the new device will support. For more information, see Chapter 6, Managing Databases.