Technical Bulletin. SQL Express Backup Utility

Size: px
Start display at page:

Download "Technical Bulletin. SQL Express Backup Utility"

Transcription

1 Technical Bulletin SQL Express Backup Utility May 2012

2 Introduction This document describes the installation, configuration and use of the SATEON SQL Express Backup utility, which is used to provide scheduled database backups in SATEON installations where the Express Edition of SQL Server is used. Note: This is required because SQL Express Edition does not include any scheduled backup facility of its own. The SATEON SQL Express Backup utility is installed with the SATEON software and uses the Windows Task Scheduler to provide scheduled backups. The following sections describe the functions of the utility and explain how to configure backups and restore a database from a backup. The utility consists of a single executable file, ExpressMaint.exe. It is included in the standard SATEON installation, and can be found in the...\sateon\utilities folder, in a sub-folder called SATEON Express Backup. Running the utility You can run ExpressMaint.exe from the command line or set it up to run automatically. Command line arguments The ExpressMaint.exe command takes various command line arguments: -S Defines the name of the SQL Server and instance. -D Defines the database to be backed up. You can specify a single database name, such as SATEON, or specify ALL_USER to select all the SATEON user databases. -T Specifies the type of operation to carry out. Specify DB to perform a full database backup. -B Defines the location that the backup will be written to a full path name. Ensure this already exists and that you have access to it. -BV -BU Specified the time period that back-ups are kept for. Defines the units for the BV argument. This can be minutes, hours, days, or weeks. Note: For more information and help, run ExpressMaint.exe with the -? argument. This provides information about the utility and a description of all arguments. SATEON Technical Bulletin 2 Issue 1.1

3 The format of a command line to backup all databases would therefore be: Where: "C:\Program Files (x86)\grosvenor Technology Ltd\SATEON\Utilities\ExpressMaint" S server D ALL_USER T DB B location BV 10 BU days server identifies the SQL Server name and instance. You can use (local) to specify the local machine (note that it must be in brackets), but otherwise specify the SQL server name. location identifies the full path of the location where the backups will be stored. An example of a command line: "C:\Program Files (x86)\grosvenor Technology Ltd\SATEON\Utilities\ExpressMaint" S dt-sateon-01\sateon D ALL_USER T DB B "C:\SATEON\Backup" BV 10 BU days This example would back up all the SATEON databases on the SQL server called dt-sateon-01\sateon to C:\SATEON\Backup\ and keep the backups for ten days. Running the task automatically Although you can run the utility from the command line, it would normally be set up to run as a regular task using the Windows Task Scheduler for each database you wish to back up, as described below. Setting up a scheduled backup task To run scheduled backups you need to configure a task within Windows Task Scheduler for each of the SATEON databases that you wish to back up. To schedule a backup task 1. Open Windows Task Scheduler (Start Menu > All Programs > Accessories > System Tools > Task Scheduler). 2. Ensure the Task Scheduler Summary is shown. If not, click on Task Scheduler (Local) at the top of the tree view on the left. SATEON Technical Bulletin 3 Issue 1.1

4 3. Select Action > Create Task from the menu to set up a new task. The Create Task window appears. 4. On the General tab, set details as follows to back up the SATEON databases: Note: Ensure the specified user account has sufficient access rights: Sysadmin rights to the SQL Server instance and Modify rights to the specified backup folder. SATEON Technical Bulletin 4 Issue 1.1

5 5. Select the Triggers tab to define when the task is to be triggered. 6. Click the New... button to create a new trigger and set up a daily schedule with the settings as follows, selecting a suitable time for the backup: 7. Click OK and confirm the summarised settings: SATEON Technical Bulletin 5 Issue 1.1

6 8. Select the Actions tab to define the action to be triggered. 9. Click New... to create a new action and set it up to run the ExpressMaint.exe utility. Use the following settings: Note the following: In the Program/script text box use the Browse button to locate the file or enter the path of the ExpressMaint.exe file. By default this will be: C:\Program Files (x86)\grosvenor Technology Ltd\SATEON\Utilities\ ExpressMaint.exe Note: This may not be the same path for all installations. If the path includes spaces it must be enclosed in quotes. In the Add arguments text box, enter the required arguments, as described in Command line arguments on page 2. For example: -S dt-sateon-01 -D ALL_USER -T DB -B "C:\SATEON\Backup" -BV 10 -BU days S dt-sateon-01\sateon D ALL_USER T DB B "C:\SATEON\Backup" BV 10 BU days Note: There MUST be a leading space before the first argument in the text box. The -B argument should be set to the path of the SQL backup folder on your machine, which may not be the same as that shown above. If there are spaces in the path name it must be enclosed in quotes. SATEON Technical Bulletin 6 Issue 1.1

7 10. Click OK to view the summarised settings. 11. Select the Conditions tab to define any conditions that apply to the task. The settings on the Conditions tab can be left as the defaults, as shown below: 12. Select the Settings tab to define any additional settings that apply to the task. We recommend the following settings: SATEON Technical Bulletin 7 Issue 1.1

8 13. Click OK to save the settings for the task. SATEON Technical Bulletin 8 Issue 1.1

9 Restoring a database This section details how to restore a SATEON database in installations where the Express Edition of SQL Server is used. Note: SATEON includes multiple databases. If more than one needs to be restored, for example in the case of total data loss, you need to restore them separately. To restore a backup 1. Check the backup location to ensure there is a recent backup of the database. 2. If the database you want to restore is still present (e.g. data is present but corrupted), delete it as follows: Open SQL Server Management Studio and connect to the database instance. Open Databases in the Object Explorer. Right-click on the database you need to restore and select Delete from the menu. The Delete Object dialog is displayed: When you have confirmed the database, click OK to confirm the deletion. 3. To restore the database, select Databases from the Object Explorer, right-click and choose Restore Database: SATEON Technical Bulletin 9 Issue 1.1

10 4. The Restore Database dialog appears; enter details as follows: Under Destination for restore, choose the name of the database to be restored from the To database drop-down (e.g. Sateon, SateonESS) Under Source for restore, choose From device. Click the button to display the Specify Backup dialog. Press the Add button to display a File Explorer dialog, and navigate to the location of the backup file. Click OK twice to return to the Restore Database dialog: SATEON Technical Bulletin 10 Issue 1.1

11 5. Click OK to start the restore process. When it has finished a confirmation message will be displayed. For more details on SQL Express database backup and restore processes, see the relevant section on the Microsoft website. For more information For further assistance with SATEON, please contact Grosvenor Technology Technical Support as follows: Web: Technical website: FTP Site: support@grosvenortechnology.co.uk www. grosvenortechnology.co.uk ftp.grostech.com A username and password for the FTP site are available from Technical Support. SATEON Technical Bulletin 11 Issue 1.1