Quantcast
Channel: SQL Backup Archives - SQL Authority with Pinal Dave
Viewing all articles
Browse latest Browse all 110

SQL SERVER – Database Backup and Restore Job Management

$
0
0

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).

SQL SERVER - Database Backup and Restore Job Management apexrecovery02

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

SQL SERVER - Database Backup and Restore Job Management apexrecovery03

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

  • Select SQL Server instance that needs to be managed
    SQL SERVER - Database Backup and Restore Job Management apexrecovery04
  • Click on the Browse (…) button in Databases box, and check the boxes in front of the databases that you wish to back up
    SQL SERVER - Database Backup and Restore Job Management apexrecovery05
  • 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.
    SQL SERVER - Database Backup and Restore Job Management apexrecovery06
  • 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.
    SQL SERVER - Database Backup and Restore Job Management apexrecovery07

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

SQL SERVER - Database Backup and Restore Job Management apexrecovery08

Optionally, configure the email notifications for the job status.

SQL SERVER - Database Backup and Restore Job Management apexrecovery09

Click Ok to schedule or execute defined backup job.

SQL SERVER - Database Backup and Restore Job Management apexrecovery10

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.

SQL SERVER - Database Backup and Restore Job Management apexrecovery11

  • Click on the New button to configure the template.
    SQL SERVER - Database Backup and Restore Job Management apexrecovery12
  • 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.
    SQL SERVER - Database Backup and Restore Job Management apexrecovery13
  • 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.
    SQL SERVER - Database Backup and Restore Job Management apexrecovery14

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

SQL SERVER - Database Backup and Restore Job Management apexrecovery15

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

SQL SERVER - Database Backup and Restore Job Management apexrecovery16

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

SQL SERVER - Database Backup and Restore Job Management apexrecovery17

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.

SQL SERVER - Database Backup and Restore Job Management apexrecovery18

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.

SQL SERVER - Database Backup and Restore Job Management apexrecovery19

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.

SQL SERVER - Database Backup and Restore Job Management apexrecovery20

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

SQL SERVER - Database Backup and Restore Job Management apexrecovery21

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.

SQL SERVER - Database Backup and Restore Job Management apexrecovery22

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.

SQL SERVER - Database Backup and Restore Job Management apexrecovery23

  • 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.

SQL SERVER - Database Backup and Restore Job Management apexrecovery24

  • 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.

SQL SERVER - Database Backup and Restore Job Management apexrecovery25

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

SQL SERVER - Database Backup and Restore Job Management apexrecovery26

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.

SQL SERVER - Database Backup and Restore Job Management apexrecovery27
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.

SQL SERVER - Database Backup and Restore Job Management apexrecovery28
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.

SQL SERVER - Database Backup and Restore Job Management apexrecovery29

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.

SQL SERVER - Database Backup and Restore Job Management apexrecovery30

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.

SQL SERVER - Database Backup and Restore Job Management apexrecovery31

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.

SQL SERVER - Database Backup and Restore Job Management apexrecovery32

Related links to Database Backup and Restore Job Management:

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

First appeared on SQL SERVER – Database Backup and Restore Job Management


Viewing all articles
Browse latest Browse all 110

Trending Articles