Recovery of an SMS site generally falls into two
categories: recovering the site database and recovering the site server.
If the SMS database fails for some reason, you can restore it from its
backup using SQL Server Enterprise Manager. You need to have access to a
current backup, of course, as well as to the SQL Server Enterprise
Manager console. There’s no restore function in SMS because, presumably,
if you need to restore the site in some fashion, you probably can’t
open the SMS Administrator Console.
Recovering the Site Database
Recovering
the SMS database itself is a fairly straightforward task—which isn’t to
imply that it’s a mundane or trivial matter, but rather that it’s cut
and dried. You recover the site database by restoring it from a current
backup. For example, if you need to move the SMS database to another
server running SQL Server for some reason, you would follow these steps:
1. | Close
all SMS-related tools, such as all SMS Administrator Consoles, that are
accessing the current database, as well as all SMS site server services
(including the SQL Monitor service on the system running SQL). You
don’t want anything trying to update the database while you’re managing
it.
|
2. | Start
SQL Server in single-user mode and back up the SMS database, or
schedule a database backup through the SMS Administrator Console. The
single-user mode option is set through the Properties dialog box for the
database accessible through the SQL Server Enterprise Manager, on the
Options tab.
|
3. | Locate
(or install) the other system running SQL Server, ensuring that the
same database sort order has been used as on the original server running
SQL, as well as the same hardware platform.
|
4. | Create
database and log devices or files (depending on the SQL Server version)
that are at least as large as the backed-up database.
|
5. | Restore the backed-up SMS database to the new system running SQL Server.
|
6. | Use
the Reset option of the SMS Setup program on the site server to point
the site server to the location of the new system running SQL Server
containing the database.
|
You would follow
similar steps if the database needed to be restored for any other
reason, although if you were restoring to the same system running SQL
Server, you might not need to perform step 6.
Recovering the Site Server
If you encounter a
situation in which the SMS site server itself needs to be
recovered—perhaps it crashed or it had be moved to a different physical
system—the steps for recovery are somewhat more involved. First of all,
your situation would probably be hopeless if you had not already created
a current backup of your SMS database, so let’s assume that you’ve been
backing it up regularly.
As
we’ve seen, other significant elements of the site server in addition
to the SMS database need to be backed up in order to completely restore
the site server to its previous state. These elements include the SMS
and NAL registry keys, the site control file
(\SMS\Inboxes\Sitectrl.box\Sitectrl.ct0), and the SMS directory
structure and files.
The recovery process
begins with the restoration of the SMS site database, of course.
However, it will also involve the restoration of the backed-up elements.
For example, if you need to reinstall SMS on the site server or install
it on a new computer, you’ll restore the previous site by copying the
backed-up SMS directory and site control file over the new installation
or over the reinstallation. Similarly, you can restore the SMS-related
registry keys by using the Windows Registry Editor to replace the
existing SMS keys (created when you reinstalled SMS or installed it to a
new server) with the backed-up versions of those keys.
In some cases, you
could restore just the database itself and let the SMS site server
rebuild itself—which it will do eventually. However, any changes you
made that were written to the registry but not yet updated to the
database will probably be lost. Restoring the SMS site server
completely, as described here, will ensure that all elements of the site
server are properly synchronized.
Note
If
you need to completely reinstall the SMS site server, all vestiges of
the old site server must be cleaned off the server first. This includes
uninstalling the SMS client software, removing the registry keys, and
removing the remainder of the SMS directories and setup files not
removed through the Remove SMS option of the Setup program. Then
reinstall SMS, and restore the previous site as outlined above. |
Included
on the SMS product CD is the Site Utilities tool (Preinst.exe). This
tool must be installed on a site server and is used to help diagnose
problems, repair the site control file, delete incorrectly removed
sites, or stop SMS site server services, among other things. Let’s
look at three of this tool’s command-line options here that can be of
particular use in the SMS site server recovery and maintenance process:
/DUMP, /DELSITE, and /DELJOB. You can run this tool from a command
prompt by changing the path to the appropriate directory from the
command prompt and executing the tool. Figure 1
displays the command switches available for PREINST. Executing the
PREINST /DUMP command causes a new site control image to be written to
the root of the partition on which SMS was installed. An image
is a binary representation of the site control file. This image is
based on the current site control data stored in the SMS database and is
named SMS_sitecode.scf.
This file can then be copied to the Site Control Manager’s inbox
(SMS\Inboxes\Sitectrl.box) and renamed Sitectrl.ct0 to rebuild the
site’s properties. This function is useful if the site control file
becomes corrupted or if you don’t have a current backup of it.
You can
use PREINST /DELSITE to remove a “phantom” child site. When a child site
is to be removed from a parent site, the correct process is to break
the parent-child relationship through the child site’s properties, wait
for the parent and child sites to update their respective databases, and
then remove the addresses. A phantom
child site occurs if the child site is removed from the parent site
before the relationship has been broken or before the databases can be
correctly updated, and references to the deleted child site may remain
at the parent. To delete the removed site from the parent site, execute PREINST /DELSITE: {childsitecode, parentsitecode}, where childsitecodeparentsitecode
represents the parent’s site code for the site that needs to be
deleted. Once executed, the change will be replicated up the SMS site
hierarchy. represents the site code of the site that needs to be deleted and Last, PREINST
/DELJOB is designed to remove jobs or commands targeted to a specific
site. You can use this command to remove jobs that might still be in the
queue for the removed site but keep trying to be sent or executed,
resulting in error status messages. Executing PREINST /DELJOB: sitecode will delete all commands that are targeting the specified site code. |