Backing Up a Database or Transaction Log

You should back up a database after you create it, and then maintain a regular backup schedule to ensure smooth recovery in case of database or media failure. SQL Enterprise Manager allows you to set and maintain a schedule of automatic backups. Scheduling can be accomplished at the same time you define a backup. You can also back up manually at any time.

If a transaction log is on a separate device from its database, you can back up the transaction log separately. You should back up a transaction log more frequently than its database.

The SQL Server dump is a dynamic dump ¾ it can take place while the database is active. The dump captures the state of the data as it is at the moment the statement is executed; no partial transactions are reflected. Any data changes made after the dump begins are not reflected in the dumped database. Performing a dump can slow the system down somewhat, so you may want to run it when the database is not being heavily updated.

You should maintain regular backups of the master database, the msdb (scheduling) database, all user databases, and (if the server is configured as a replication distributor) the distribution database.

    To back up a database or a transaction log
  1. From the Server Manager window of SQL Enterprise Manager, select a server.
  2. From the Tools menu, choose Backup/Restore.

    The Database Backup/Restore dialog box appears.

  3. Select the device(s) to back up to.

    In the Dump Devices box, select a device, and then choose Add. To perform a striped dump (a multiple dump device backup), repeat this step for each dump device that will be part of the backup. The added devices move to the Backup Destination list.

    If necessary, you can create a new dump device by choosing New and completing the Create Dump Device dialog box that appears.

    The DISKDUMP device is a special device. Backing up to DISKDUMP sends the data to the NULL device, which dumps data without saving it. You can use the DISKDUMP device name as a bit bucket in conjunction with database or transaction log backups.

    Important You cannot retrieve dumps sent to the NULL (DISKDUMP) device.

    You cannot back up to diskette dump devices when using SQL Enterprise Manager. For information about backing up to diskette dump devices, see the Microsoft SQL Server Transact-SQL Reference. For information about dump devices, see Chapter 5, Managing Devices.

  4. To add a volume name for a device, type up to six characters (letters or numbers) in the Volume box of the Backup Destination list.

    In general, you do not need to provide volume names for dumps. You may provide one if this is the first dump on a device or if Append is not selected. The volume name is in effect for all subsequent dumps appended to the device. Entering a name is optional for subsequent dumps, but if specified it must match the initial volume.

    To view volume and header information for a disk or tape dump device, select the device from the Dump Devices list and then choose the Info button.

  5. From Database list, select the database to back up.
  6. Select either Entire Database or Transaction Log.
  7. Select or clear the backup options.
  8. Either execute the backup or schedule it for execution.

You cannot back up a transaction log separately after enabling the Select Into / Bulk Copy database option and making unlogged changes to the database with SELECT INTO or a bulk copy operation. Under these conditions, do a database backup instead.

For more information about backing up databases, see More About Backing Up and Restoring, later in this chapter. You can also back up a database or transaction log using the DUMP statement. For information, see the Microsoft SQL Server Transact-SQL Reference.