Sunday , December 22 2024

How To Create Log Backup Using SQL Server Maintenance Plan

We perform maintenance operations in SQL Server using Maintenance Plan. In this article we will create a maintenance plan for Log Backup. I will share article links of other processes that can be performed using SQL Server Maintenance Plan at the end of the article.

From the Management tab under SSMS, we select Maintenance Plans and Maintenance Plan Wizard as shown below.

On the next screen, select “Do not show this starting page again” as follows and click Next.

We give a name to the Maintenance Plan from the Name section as follows on the incoming screen.  I named LogBackup.

Then click Change in the Schedule section. A screen appears as follows.

From Occurs you can choose Daily, Weekly or Monthly.

  • Select Daily if you want this maintenance plan to run daily
  • Select Weekly if you want this maintenance plan to run weekly
  • Select Monthly if you want this maintenance plan to run monthly

We schedule the job like below in the Schedule section.

On the next screen, we select Back Up Database(Transaction Log) as follows and click next.

When we click “Select one or more” in the Databases section, the window appears just below.

If we select the All databases option, it will create log backup of all databases.

If we select System databases, it will create log backup of system databases.

If we select All user databases, it will create log backup of all user databases.

We can select specific databases by selecting these databases. For example, in this example we will only create log Backup of the Test database as follows.

If you select “Ignore databases is not online” option and a database is inaccessible during the backup process, it continues for the next database.

In the next screen, if you select “Write a report to a text file” as below, it will create a report in the folder you selected in Folder location.

If you select the E-mail report option, it will send the reports to the e-mail address you specified in the To: section.

Since I have no operator defined on my server, I got an error like the following.

There are no operators defined on the system.

You may want to read my article “How To Create An Operator On SQL Server” to get detailed information about the operator. Finish the process by clicking Next and Finish.

You can find more articles about Maintenance Plans below.

Reorganizing Indexes Using Maintenance Plan“,

Rebuilding Indexes Using SQL Server Maintenance Plan“,

How To Create Full Backup Using SQL Server Maintenance Plan“,

How To Create Differential Backup Using SQL Server Maintenance Plan“,

Checking Database Consistency Using Maintenance Plan“,

Updating Statistics Using Maintenance Plan“,

Deleting Backup, Restore, Job, or Maintenance Plan History Using Maintenance Plan“,

Running an Existing Job Using Maintenance Plan“,

Deleting Files with a Specified Extension in a Folder Using  Maintenance Plan(Maintenance Cleanup Task)

To understand What is Transaction log and why we should backup it, read the following articles.

What is SQL Server Transaction Log”,

What is Database Recovery Model

You may want to read the below article to restore your backups.

Backup Restore On SQL Server

Loading

About dbtut

We are a team with over 10 years of database management and BI experience. Our Expertises: Oracle, SQL Server, PostgreSQL, MySQL, MongoDB, Elasticsearch, Kibana, Grafana.

Leave a Reply

Your email address will not be published. Required fields are marked *