More Related Content
Similar to HTG-SQL Server 2005 - Backup & Recovery.pdf
Similar to HTG-SQL Server 2005 - Backup & Recovery.pdf (20)
HTG-SQL Server 2005 - Backup & Recovery.pdf
- 1. October © 2008 Sage Page 1 of 27
“How To…” Guide
SQL Server 2005
Backup & Recovery
Introduction
• The following document describes how to backup and recover data in Sage ERP X3 using
both the backup utilities of X3 and the database backup and recovery tools in SQL Server
2005.
• Both the X3 backup utilities and the SQL Server 2005 backup/recovery utilities are powerful
tools for saving data. For normal daily or weekly backups, the SQL Server 2005 backup utility
is the best solution. By using a maintenance plan under SQL Server 2005, backup schedules
can easily be made, thus automating the backup process. Of course, SQL Server 2005 allows
both complete and partial backups. The X3 backup utilities are useful when only a few tables
need to be saved for short period of time (this is because the flat files that are created can
easily be overwritten by another backup export of the same tables). The X3 backup utilities
can also be used to copy tables from one X3 folder to another.
• A final section is included to outline the steps required to prepare and restore X3 in the case
of failure.
Procedure
Sage ERP X3 Backup
This should only be considered a temporary backup method since the data extractions and
imports are used often where data can be overwritten. The X3 Backup/Table copy is used to
backup and restore tables. The X3 backup utilities consist of two functions, Data Extract and Data
Import.
- 2. SQL Server 2005 – Backup & Recovery
October © 2008 Sage Page 2 of 27
• Data Extract
The Data Extract function prompts for the folder from which the tables are to be saved, and
the name of the tables to save. The wildcard (*) character can be used to specify multiple
tables
See help for additional information on Extract Options.
After the user hits OK, the data will start to be saved. The table that is currently being saved
and the progress of the data extraction is displayed.
Three files are created for each table that is extracted, an srf (table definition source), an fde
(compiled table definition), and a dat (flat file that contains the data). These files are created
under the SVG directory of the folder for which the extraction took place. Please note, if using
ftp to transfer these files from one system to another they all must be transferred in binary
mode.
After completion, a log file is displayed showing which tables were successfully saved.
- 3. SQL Server 2005 – Backup & Recovery
October © 2008 Sage Page 3 of 27
• Data Import
The Data Import function prompts for the folder from which the tables are to be restored and
the name of the tables to restore. The wildcard (*) character can be used to specify multiple
tables. The data import function will use the flat files located in the SVG directory under the
folder for which the tables are to be restored.
After the user hits OK, the tables will start to be restored. The table that is currently being
restored and the progress of the table integration is displayed.
After completion, a log file is displayed showing which tables were successfully integrated into
the folder.
Please note that the data import function recreates the tables that it imports. All data
previously in the table is lost.
- 4. SQL Server 2005 – Backup & Recovery
October © 2008 Sage Page 4 of 27
• SQL Server 2005 backup/recovery utilities
It is assumed that the DBA has a working knowledge of SQL Server 2005. To backup and
restore a database, the SQL Server Management Studio may be used.
• Maintenance Plan
Sage recommends the use of a Database Maintenance plan to backup SQL Server.
• SQL Server Agent
For a scheduled maintenance plan to be executed automatically, the SQL Server Agent
service must be started. By default, this service is set to start manually. This service should
be set to start automatically.
- 5. SQL Server 2005 – Backup & Recovery
October © 2008 Sage Page 5 of 27
NOTE: SQL Server Maintenance Plans have been updated with SQL service pack 2, so it is
necessary to be sure you are running SQL 2005 service pack 2 before creating the
maintenance plan.
SELECT @@version when entered in a query will return the current service pack level.
• 9.00.1399 No Service Pack
• 9.00.2047 Service Pack 1
• 9.00.3042 Service Pack 2
- 6. SQL Server 2005 – Backup & Recovery
October © 2008 Sage Page 6 of 27
• Maintenance Plan Creation via the Maintenance Plan Wizard
Start the SQL Server 2005 Management Studio. In the Object Explorer navigate to the SQL
instance where the X3 database resides and right click on Maintenance Plan and select the
Maintenance Plan Wizard.
- 7. SQL Server 2005 – Backup & Recovery
October © 2008 Sage Page 7 of 27
The Maintenance Plan Wizard will be launched and you should see the below screen.
Figure 1
It is fine to setup one maintenance plan to backup the system databases (master, model, and
msdb) along with the X3 database but this document will show two separate maintenance
plans one for the system databases and one for the X3 database(s).
- 8. SQL Server 2005 – Backup & Recovery
October © 2008 Sage Page 8 of 27
• Maintenance Plan (System Databases)
Enter name and optionally a description of the maintenance plan.
Figure 2
By default there is no schedule assigned to the maintenance plan so select the Change button
to enter a backup schedule that best meets your organization’s needs.
- 9. SQL Server 2005 – Backup & Recovery
October © 2008 Sage Page 9 of 27
Figure 3
When done entering scheduling settings click OK and then Next.
- 10. SQL Server 2005 – Backup & Recovery
October © 2008 Sage Page 10 of 27
You will now see a list of possible backup related tasks. To select a desired task click the box
in front of the task to place a checkmark in the box. When all tasks are selected click Next.
Figure 4
- 11. SQL Server 2005 – Backup & Recovery
October © 2008 Sage Page 11 of 27
If the option “Single schedule for the entire plan or no schedule” was taken earlier (see Figure
2) then the next screen displayed (figure 5) will provide a means to choose the execution
sequence of your selected tasks. If the option “Separate schedules for each task” was taken
you will skip this screen.
Figure 5
When the execution sequence is set click Next. The next screen is specific to the Back Up
Database (Full) task. It allows one to select which database(s) to backup. Click the drop
down arrow of the Database(s): field.
- 12. SQL Server 2005 – Backup & Recovery
October © 2008 Sage Page 12 of 27
Figure 6
Again since this is only the maintenance plan for the system databases we only select master,
model, and msdb and then click OK.
- 13. SQL Server 2005 – Backup & Recovery
October © 2008 Sage Page 13 of 27
Additional options are available depending or personal preferences such as, expiration,
backup device, and integrity check… Once setup is completed click Next.
Figure 7
- 14. SQL Server 2005 – Backup & Recovery
October © 2008 Sage Page 14 of 27
Figure 8
This next screen allows the user to define characteristics specific to the History Cleanup Task
such as the types of history to clean up and the length of time to keep that history.
- 15. SQL Server 2005 – Backup & Recovery
October © 2008 Sage Page 15 of 27
The Report Options screen allows the user to define a location to write the maintenance plan
actions file and/or to define recipients to receive an email copy of that report.
Figure 9
- 16. SQL Server 2005 – Backup & Recovery
October © 2008 Sage Page 16 of 27
Finally a summary screen is displayed showing the tasks of the maintenance plan being
created.
Figure 10
Click button Finish to execute the steps of the summary. If any problems are encountered
additional information will be available. If no problems you should see a screen similar to the
following.
- 17. SQL Server 2005 – Backup & Recovery
October © 2008 Sage Page 17 of 27
Figure 11
Click Close to end Maintenance Plan Wizard. If the Maintenance Plan has been created
successfully you should now be able to see it in Object Explorer under the Maintenance Plans
folder.
Figure 12
- 18. SQL Server 2005 – Backup & Recovery
October © 2008 Sage Page 18 of 27
• Maintenance Plan (X3 Database)
The second maintenance plan will backup the X3 database. The database will be called
X3V14 in this example. This database will of course be changing more often and will contain
all X3 data. So since the nature of this database is different that that of the system databases
its maintenance plan will also be different. Start the database maintenance plan wizard again
and enter a plan name and description and this time select the “Separate schedules for each
task” option.
• Click Next
You may select the options you require but note that for the X3 maintenance plan we also
include the backup of the transaction logs.
- 19. SQL Server 2005 – Backup & Recovery
October © 2008 Sage Page 19 of 27
Note the order cannot be changed because we have selected the option to have each
task have its own schedule. Click Next
Define the types of history to be deleted by the task and the schedule to have the task
execute.
- 20. SQL Server 2005 – Backup & Recovery
October © 2008 Sage Page 20 of 27
• Next for the Full backup task specify your X3 database to be backed up.
- 21. SQL Server 2005 – Backup & Recovery
October © 2008 Sage Page 21 of 27
Additional options are available depending on personal preferences such as, expiration,
backup device, and integrity check… Need to also include a schedule to have the full
backup execute.
- 22. SQL Server 2005 – Backup & Recovery
October © 2008 Sage Page 22 of 27
• Select database for which to backup the transaction log.
- 23. SQL Server 2005 – Backup & Recovery
October © 2008 Sage Page 23 of 27
• Next select the schedule to have the transaction log backed up.
- 24. SQL Server 2005 – Backup & Recovery
October © 2008 Sage Page 24 of 27
The Report Options screen allows the user to define a location to write the maintenance
plan actions file and/or to define recipients to receive an email copy of that report. Click
Next.
- 25. SQL Server 2005 – Backup & Recovery
October © 2008 Sage Page 25 of 27
Finally a summary screen is displayed showing the tasks of the maintenance plan being
created.
Click button Finish to execute the steps of the summary. If any problems are
encountered additional information will be available. If no problems you should see a
screen similar to the following.
- 26. SQL Server 2005 – Backup & Recovery
October © 2008 Sage Page 26 of 27
• Click Close to end Maintenance Plan Wizard.
If the Maintenance Plan has been created successfully you should now be able to see it in
Object Explorer under the Maintenance Plans folder.
- 27. SQL Server 2005 – Backup & Recovery
October © 2008 Sage Page 27 of 27
Important
This document is provided as a guideline for backup and recovery procedures and should not be
relied upon as the sole method for implementing a backup and recovery procedure. It is presented
to display general flow and the available tools available to perform backup and recovery. Many
factors should be considered when implementing a backup and recovery strategy including but
not limited to the size of the database, acceptable time to perform the backup, acceptable time to
perform the restore, acceptable amount of data loss… Once a viable backup/restore strategy
has been implemented it should also be tested. The only way to insure your backup and restore
strategy will work when needed is to test it and continue to test it periodically.