Backup and Restore


This section explains how to perform a backup of a SQL-NS instance, as well as how to restore an instance from a previous backup. Doing regular backups is an important part of administering an instance and is the only way to ensure that it can be recovered after a catastrophic failure.

Backing Up a SQL-NS Instance

Backing up a SQL-NS instance involves backing up the following individual items:

  • The databases containing the instance and application objects

  • The runtime files (such as XSL transforms) required by application components, the assemblies containing custom components, standalone event providers, and any SMI files

  • The registration information for the instance, including the accounts used to run the various components

  • The source files, including the ICF, ADFs, and code for any custom components

To back up the databases, you can use any of the standard SQL Server backup techniques. SQL Server provides built-in commands for backing up entire databases, as well as specific files or filegroups. See the BACKUP command in the SQL Server Books Online for more information. You can also use Management Studio or a number of third-party tools to back up SQL databases. Any of these can be applied to the SQL-NS databases, just as they can to other databases.

Tip

If the instance and application database objects are created in different databases, make sure you back up all databases on the same schedule so that the backups are consistent with one another.


When backing up the runtime files, custom component assemblies, and other files, it's important to preserve not only the files themselves but also the directory structure in which they are laid out. This is especially important for the XSL transforms used with the XsltFormatter. The XsltFormatter relies on the directory layout to locate the appropriate transform for each locale and device type (see the "Using Locale and Device-Specific Transforms" section, p. 329, in Chapter 9, "Content Formatters," for more information). You can use any of the standard file backup tools to fully back up all directories and files used by the SQL-NS instance.

It's highly recommended that you preserve a record of the registration information for the instance (for all machines in the deployment) as well as the accounts used to run all the components. When restoring an instance from a backup, you will need to reregister it, and you may need to grant database and file permissions to the accounts again. Having a record of this information makes this process much easier. How you keep this record is up to you; in most cases, you can store it in a document, along with the instance's source files. If the document describes passwords or other sensitive information, make sure that it is secured appropriately.

The source files that make up the definition of an instance should be maintained in a version control system and backed up regularly. Even if you are able to restore a running instance, losing the source files will make it difficult to update the instance in the future. Using a version control system allows you to track changes to your source files as they evolve.

Tip

You can re-create the ICF and ADFs for a compiled instance using the nscontrol export command or the Export to Editor task in Management Studio. (See the SQL-NS Books Online for information on using these tools.) These operations reconstruct the original XML definitions from the compiled information in the instance and application database objects. Although these export tools exist, you should still keep a copy of the original source files in a safe, secure location.


Restoring a SQL-NS Instance from Backup

Before you can restore an instance from a previous backup, you need to restore the deployment hardware on which it will run. In the case of hardware failure, this may mean rebuilding some of the machines and reinstalling the required software on them. The "Installing SQL-NS on the Deployment Machines" section (p. 476) in Chapter 13 provides guidance on installing SQL-NS on deployment hardware; you can refer back to this section if you need to rebuild your SQL-NS machines.

After the deployment machines have been restored, you can use the following instructions to restore the SQL-NS instance:

1.

Restore the instance and application databases from their backups, using standard SQL Server procedures. See the RESTORE command in the SQL Server Books Online for more information.

2.

Rebuild the instance metadata. To do this, run the nscontrol repair command. The general topic of instance metadata is covered in the "Instance Metadata" section (p. 100) in Chapter 4, "Working with SQL-NS Instances." However, the nscontrol repair command is not covered in this book. For documentation, see the SQL-NS Books Online.

3.

Rebuild the directories containing the instance's runtime files and custom component assemblies. Take care to restore the directory structure as it existed before.

4.

Restore any standalone event providers and the SMI if necessary.

5.

Re-create any accounts required to run the components of the instance.

6.

Reregister the instance and grant database and filesystem permissions as needed.

7.

If you are restoring the instance onto different machines, you may need to update the <SqlServerSystem> and <SystemName> elements in the ICF and ADFs accordingly. Also, if any paths have changed as a result of restoring the instance's runtime files in step 2, you may need to update the paths specified in the ICF and ADFs. After making the required ICF and ADF changes, update the instance to reflect them in the databases.

8.

Enable the instance.

9.

Restart the instance by starting the SQL-NS engine on all machines hosting it.

As part of deploying your instance, I recommend that you practice restoring it from backup at least once. Doing this familiarizes you with the process and helps you find and fix problems in your backup strategy. Practicing in advance enables you to recover your systems much more quickly should the real need arise.




Microsoft SQL Server 2005 Notification Services
Microsoft SQL Server 2005 Notification Services
ISBN: 0672327791
EAN: 2147483647
Year: 2006
Pages: 166
Authors: Shyam Pather

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net