SQL SERVER – Database Backup and Restore Job Management

ApexSQL Backup is a tool for Microsoft SQL Server, intended for database backup and restore job management. The application supports all native SQL Server backups (full, differential and transaction log backups), and allows users to easily create, save and manage all backup related jobs. ApexSQL Backup can be used to run, schedule and monitor all backup operations across the domain from a single location.

Database Backup and Restore Job Management

Creating and maintaining full backup chains is a priority for any disaster recovery plan. But running these jobs manually on a daily basis could be quite challenging and time consuming. ApexSQL Backup enables the automation of these jobs by applying schedules, or by running custom scripts in the command line interface. Furthermore, ApexSQL Backup supports the automation of other daily maintenance tasks such as deleting old backup files, rebuilding and reorganizing fragmented indexes, verifying created backups and much more.

ApexSQL Backup components

ApexSQL Backup consists of four main components:

  • Windows application – main part of the program, managed via GUI. Used for creating, managing and executing database backup and restore maintenance jobs in SQL Server.
  • Command line interface aka CLI – a console application that enables users to automate backup, restore, and log shipping maintenance jobs by running custom scripts. All jobs in a script are easily configured by using simple CLI switches.
  • Central repository database – SQL Server database that stores parameters for all created jobs as well as configuration settings data for the application
  • Agent – simple windows service that is used for communication between the application and SQL Server instances.

How does it work

In order to work properly, ApexSQL Backup needs all four components to be installed and connected. The application and central repository database are usually installed on the machine that will be used for managing and monitoring SQL Server instances inside the domain or a workgroup. ApexSQL Backup agent must be installed on each server machine that hosts one or more SQL Server instances that need to be managed. After all agents are running, each SQL Server instance can be added to the list of manageable servers.

To add the local SQL Server instance, click on the Add button in Home tab, and select local instance from dropdown menu. Select the authentication type for the selected server, and provide necessary credentials if SQL Server authentication was selected.

SQL SERVER - Database Backup and Restore Job Management apexrecovery01

To add a remote instance, type the name or IP address of the instance in SQL Server field. Alternatively, click on the Network server button to obtain the list of available network servers, and select the one that should be added to the list (in order to have all remote servers listed, make sure that SQL Server Browser services are enabled and running on the remote servers).

As soon as all instances are added to the server list, they can be managed through the application interface. ApexSQL Backup contains many useful features that make database maintenance tasks fun and easy.

Backup job management

Making a foolproof disaster recovery plan should be one of the main priorities for every database administrator. Creating uninterrupted backup chains that consist of regular full, differential and transaction log backups is the base concept behind any serious disaster recovery plan. ApexSQL Backup enables the user to configure and automate the entire process of creating any type of SQL Server database backups.

To make a database backup click on the Backup button in the ribbon of the Home tab

In the main tab of Backup wizard, provide the main parameters for the backup job:

  • Select SQL Server instance that needs to be managed
  • Click on the Browse (…) button in Databases box, and check the boxes in front of the databases that you wish to back up
  • Select the backup type (full database, differential database, transaction log, or filegroups backup) from the drop down menu in the Type box
  • Set name and description parameters for the job name in Name and Description boxes
  • To change default SQL Server backup path, and assign custom backup destination path, click the Browse button (…) under the Path In the opened form, set the backup folder, and specify the naming rules for the backup file.
  • If you want to execute the backup job only once, select the Execute immediately radio button at the bottom of the main tab in Backup wizard. If defined job needs to be executed on regular basis, set the schedule for the job, by selecting Schedule radio button. Set the frequency and duration for the schedule, and click Ok to save the schedule settings.

It is possible to set additional job parameters in Advanced tab of the backup wizard, such as: media, verification, compression, encryption and cleanup settings.

Optionally, configure the email notifications for the job status.

Click Ok to schedule or execute defined backup job.

Backup templates

Another interesting and practical way of creating backup jobs is by using backup templates. Users can save all preferred settings for a backup job as a template, and apply it to one or more databases whenever necessary. Backup templates support all features that are supported for the regular backup jobs.

To create a new backup template, navigate to Home tab, and click on the Manage button in Backup templates group.

  • Click on the New button to configure the template.
  • Provide the custom name and description for the template. Select the backup type for the template: full, differential, or transaction log backup. Naming rules may be defined for operation name and operation description (this will be displayed in Activities view), as well as for the backup filename. Schedule also needs to be set for every backup template.
  • Use the Advanced tab to set media, verification, compression and cleanup options. If necessary, set the email notifications in Notifications tab, and click OK when finished to save the template settings.

To deploy created template, click on Deploy button from Backup templates group in the Home tab.

In Deploy templates form, you need to specify:

  • One or more templates that you wish to deploy – select previously created templates by clicking on Browse button in Templates text box.
  • Databases that will be targeted by the template – select the target databases by clicking on Browse button in Databases text box
  • Destination path for the backup files – type the path manually, or browse for the destination folder

After all targets have been selected, click on Deploy button to apply the template(s).

All backup jobs configured this way are created as schedules, and they can be managed in Schedules view as such.

Restore job management

Other important feature of ApexSQL Backup is the ability to configure and manage restore operations.

To start the restore job configuration, click on the Restore button in Home tab.

In the main tab of Restore wizard, provide all required parameters for the job configuration:

  • Select the targeted SQL Server instance, and the database that needs to be restored from the drop down menus in SQL Server and Database
  • Choose to restore from a folder scan or from a specific backup files by selecting the respective radio button.
  • Select the desired restore type: Full; Full and differential; or Full, differential and transaction log restore. Note that you need to have suitable files selected in previous step to be able to execute any of the selected restore type operations.
  • Configure the restore job to run immediately, or set the schedule if job needs to be executed frequently.

In Advanced tab of restore wizard, you can set the custom location for data and log files, include various DBCC operations in restore job, or provide the custom T-SQL script and run it after the restore job is done.

Optionally, set email notifications in Notifications tab, and click Ok to schedule or execute the configured job.

Log shipping jobs

Setting the regular log shipping jobs is one of the simple, cost effective ways of running the successful disaster recovery plan. It may not be as powerful as failover clustering and Always ON Availability Groups, but it is much easier to configure, and has much lower cost in human and server resources.

To configure the log shipping job, click on the Log shipping button in the main ribbon of the Home tab.

In the main tab of Log shipping wizard, several parameters must be provided:

  • The primary (production) server is selected from dropdown menu in SQL Server textbox
  • The source database on a primary server is selected in Database box
  • The paths for the backup and shared folder must be provided
  • Backup and restore schedules have to be configured at the bottom of the form.

  • To configure the settings for the secondary (destination) server, click on Add destination In the Log shipping destination form, specify the destination server, destination database, recovery model and local folder (note that destination server has to be added to the list of manageable servers in the main form). If needed, multiple destination servers and/or databases can be added to the list. Click Ok to save the settings.

  • To complete job configuration, click OK. The wizard scheduled two operations: backup of transaction log on primary server, and restore of the created file on secondary server.

  • To start log shipping immediately, go to Schedules view, select both created schedules, and click Run now from the context menu

Reorganize and Rebuild indexes

ApexSQL Backup can handle some basic index maintenance operations. Rebuilding and reorganizing indexes regularly can significantly improve the performance of high traffic servers. On the other side, heavily fragmented indexes may degrade the overall query performance on the server.

To start the rebuild or reorganize index operation, click on the respective buttons in the Tasks group of the Home tab.

Reorganize index wizard allows users to specify SQL Server instance and database, as well as to manually select tables and views for the reorganize job. The schedule may also be set for the job, so it can be automated to run on a regular basis. Email notification are configured in Notification tab.

Rebuild index wizard works in a similar way. SQL Server instance and database are selected from the drop down menu, and tables and views are added from the list. The operation can be run both in online and offline mode. Rebuild index operation also supports schedules and notifications, and can therefore be automated.

Monitoring backup jobs

All described jobs and operations can be easily monitored and managed in Schedules, Activities, and History views.

Schedules view shows all scheduled maintenance jobs and job details in a grid. The jobs include all types of backup and restore schedules, rebuild and reorganize index schedules, log shipping jobs, etc. All schedules located in the grid can easily be managed by using the commands from the context menu. They can be executed immediately, enabled, disabled or deleted.

Activities view displays detailed information about all operations that were executed by ApexSQL Backup, either directly, or by the scheduled jobs. The form keeps track for both successful and failed operations, and can therefore be very useful in diagnosing various issues. Furthermore, all error messages that were returned by SQL Server are saved in the Message column. All activities can be grouped, sorted, or filtered by the values from any column. If the need arises, activities can be exported as CSV document.

History view shows the complete backup history (since the moment ApexSQL Backup is installed) for any selected database. The backup history can be viewed in the grid and on the timeline. This is very useful for monitoring backup chains, and identifying best restore point in the case of the disaster. Database can be restored easily from the context menu by selecting any of the available backup points.

Reference: Pinal Dave (https://blog.sqlauthority.com)

Exit mobile version