Share via


Backing Up Notification Services Databases and Operational Files

You should regularly back up instances of SQL Server Notification Services. Without frequent backups of instance and application data, you cannot recover applications to a specific point in time. Without backups of other data, the instance configuration, application definitions, subscription management interfaces, custom components, and any other operational files required by your applications, you will not be able to fully recover an instance of Notification Services.

Backups and Quantum Clocks

In Notification Services, generators do not run continuously. Instead, the generator divides time into distinct intervals. Each time interval, which is called a quantum, is created and tracked by the generator. At the end of each generator quantum, the generator fires rules.

When you recover an instance, Notification Services determines from the database the last completed generator quantum and resumes processing from that point. The generator might skip quanta depending on the quantum limit defined for the application. For more information, see Specifying Quantum Limits.

If you cannot fully restore the transaction logs, your application may re-process events and generate duplicate notifications. For example, if you restore your databases to the state they were in 3 hours ago, the generator may resume processing quanta that are 3 hours old, producing duplicates of the notifications that were generated in the past 3 hours. Because of the generator's quantum clock, and because subscriber and subscription data is located in the instance and application databases, it is important to back up frequently so that you can restore current data and reduce duplicate notifications.

For more information about the generator quantum clock, see Specifying the Generator Quantum Duration.

Planning for Recovery

The following lists can help you plan for recovery; however, you should develop your own recovery lists and instructions for your applications, because each application and deployment is unique.

Software

Ensure that you have the following software available for recovery:

  • Operating system media.
  • Microsoft SQL Server media.
  • Any service packs or patches applied to the operating system, SQL Server, or Notification Services.
  • Any operational files used by Notification Services applications, such as custom components, XML schema definition language (XSD) files, and Extensible Stylesheet Language Transformation (XSLT) files. It will be easier to recover instances of Notification Services if you create a list of all files and their runtime locations.
  • Files that contain the instance configuration and application definitions.
  • Subscription management interfaces.

Security Information

Ensure that the following security information is available to those who restore instances of Notification Services, such as an operations department:

  • User names and passwords that the Notification Services engine runs under. Typically it runs under the NS$intanceName Microsoft Windows service.
  • The instance's SQL Server user name and password, if the instance uses SQL Server Authentication to access instance and application databases.
  • User names and passwords used by subscription management interfaces.
  • The local or domain user account used to install software and run nscontrol commands.
  • The SQL Server administrator account used to administer the instance of Notification Services using SQL Server Management Studio, nscontrol commands, or custom applications that use the Notification Services Management Objects (NMO).

Important

Keep this information in a secure location. Anyone who does not deploy, administer, or recover instances of Notification Services should not have access to account and password information.

Backing Up Databases and Other Files

To back up an instance of Notification Services, you must back up the database and operational files (such as XSLT files used to format notifications), and the files used to configure the instance and applications.

Backing Up Database Files

In Microsoft SQL Server 2005, the instance and application data can be placed in existing databases, or Notification Services can create new databases. Look in your documentation for the instance of Notification Services, or the instance configuration and application definitions, to determine which databases contain instance and application data.

For Notification Services, the best recovery model is Full. If you use the database, differential, and transaction log backups that the Full recovery model provides, you can restore the instance and application databases to a specific point in time. An example schedule for backups could be full database backups each night, differential backups every 3 hours, and transaction log backups every 30 minutes. Using this model, you should be able to restore the instance to within 30 minutes of the failure.

For more information about backing up databases, see Backing Up and Restoring Databases in SQL Server.

Important

Back up the databases that contain instance and application data on the same schedule. Simultaneous backup ensures that the databases are at the same operational state, and reduces the likelihood of application errors after recovery.

Backing Up Operational Files

Other than the database files, most instances require additional files during operation. For example, an application that uses the file system watcher event provider uses one or more XML schema definition language (XSD) files that describe event data. Any application that uses XSLT to format notifications has one or more XSLT files. And any application that uses custom objects has additional files for those custom objects.

To recover an instance, you must have all of the operational files for all of the applications that are hosted by the instance. If these other files are not available, parts of the applications will fail when you start the instance.

Because these other operational files typically change less often than the database files, you probably do not need to back up these files as often as the database files. But you should either store the source files using a version control system or should back up the files whenever you change them.

Backing Up Configuration and Application Definition Files

When running, the instance and its applications do not require the files that contain the instance configuration application definition data. However, you use these files whenever you update the instance or applications. If you do not have backups of the instance available, and the original files are lost, you can export the current data from the instance and application databases.

For more information, see Exporting Notification Services Instance and Application Metadata.

See Also

Other Resources

Backing Up and Recovering Notification Services
Backing Up and Restoring Databases in SQL Server
Administering Notification Services

Help and Information

Getting SQL Server 2005 Assistance