|
Protecting Your Data Through Regular Backups
As the database administrator for your organization's implementation of
Xfmea Enterprise, you have the
ability to perform the backups and other maintenance activities
necessary to protect the information stored in the SQL Server database.
Please refer to the SQL Server documentation for detailed coverage of
this topic. In addition, this document provides specific instructions
for two ways that you can perform backups: on command or scheduled.
To quickly jump to sections in this document, use these links:
Create a Backup
on Command Using SQL Server Management Studio Express
The free SQL
Server Express Edition provides the option to create database
backups on command through the SQL Server Management Studio Express.
-
Open SQL Server Management Studio Express.
-
Expand
Databases, then right-click the database used by
Xfmea Enterprise (e.g.
eXfmea).

-
Enter your preferences in the Back Up Database window, and then click Add
which will allow you to specify the location and the file name
of the backup that will be created.
-
It will appear in the window below the Destination header. Make
a note of where this file is being saved so you can locate it to restore
your database, if needed.

Return
to top
Automate Backups Using
SQL Server Management Studio Express and Windows Task Scheduler
The free SQL
Server Express Edition does not provide a built-in utility to
schedule automated backups. However, there is a
workaround that can be set up using the Task
Scheduling feature built into Windows. Use the following steps to create
an automated backup schedule for your
Xfmea Enterprise database.
Creating the .sql Script
By following the
steps described above, you have already selected the settings and the destination for the backup file, so you
now need to generate the script that will allow you to automate the
running of the backup. To do that:
-
Click the arrow to
the right of the Script menu at the top of the window and then select
Script Action to File. This will create a simple
text file (with a .sql extension) that contains the instructions
required to perform the backup and save it to the pathname/filename
that you specify. Be
sure that this file is stored in a safe, accessible location because
this is the file that Windows Task Scheduler needs to point to in
order to
automate the backups. Make sure to note the location for the final
step.

Creating the
Backup Task in the Task Scheduler
-
Open the Windows Task Scheduler by
clicking Start then selecting Programs then
Accessories then System Tools and
then clicking Scheduled Tasks. (You can also find
Scheduled Tasks in the Control Panel.) In this window,
double-click Add Scheduled Task. The Scheduled Task
Wizard will walk you through the next steps.
-
When prompted for the
program that you want Windows to run, click Browse
and then go to the SQL installation location to select sqlcmd.exe (in
default installations, the file is found here: C:\Program
Files\Microsoft SQL Server\90\Tools\Binn). Create a name for the
scheduled task (we have used "eXfmea Backup" in our example) and then specify
the frequency of your desired backups. Click Next.





Return
to top
Configuring the Scheduled Task to Run
the Database Backup Script
After completing the wizard, or
double-clicking on the task in the Scheduled Tasks window, you will see the
properties of the task you have created.

-
In the task window, you will need to add information at the end of the existing text
in the Run field. Click inside the field and use the right
arrow key to scroll all the way to the right (or press the End key).
Type or copy and paste the following text after the final quote in the
Run line:
-S \sqlexpress
-i
-
In the same field, and after the line you just
typed or
pasted, type the location of the
script file that you created using SQL Management Studio
Express. If you called the file "sqlbackup.sql" and saved it in the
root of your C:\ drive, then you would type this (using
the quotes):
"C:\sqlbackup.sql"
-
The full Run line should look similar to this:
"C:\Program Files\Microsoft SQL Server\90\Tools\Binn\SQLCMD.EXE" -S
\sqlexpress -i "C:\sqlbackup.sql"
-
You can adjust when the task runs by clicking the
Schedule tab and making changes. On the
Task tab,
if you have an account with a password that periodically expires or
changes, you can click the Set password... button
to update your password.
- Note that you will not be notified if the
scheduled task does not complete successfully. You will have to come
back to the Scheduled Tasks window to view the scheduled time, next
run time and last run time. If your password has expired or changed,
the task will not run.
Return
to top
Restoring the Data
To recover the data from one of the backups:
-
Open SQL Server Management Studio Express.
-
Expand Databases, then right-click
the database used by Xfmea Enterprise (e.g.
eXfmea).
-
Select Tasks, then Restore, then
click Database.


-
Click Add and then browse to
the location of the backup file and select it (in our example, the
default location for the backup is used). Click OK. Click
OK to close the Specify Backup window after it shows the file in
the Backup location field, as shown below.

-
In the Restore Database
window, select
the remaining options appropriate for your restoration, and then select the
Restore checkbox in the Select the backup sets to restore:
field. Click OK to restore the data from the selected backup.

Return
to top
Additional Support
If you have any further questions
about how to use
Xfmea Enterprise
with SQL Server or experienced any problems with this instruction
document, please contact us.
Additional on-line support for SQL Server can also be found at these two
locations:
SQL forums (requires
that you create a user name for the forums):
http://go.microsoft.com/fwlink/?LinkId=52347
Visual Studio 2005 Express Developer Center -- for support:
http://msdn2.microsoft.com/en-us/express/aa718398.aspx
|
|