I'm trying to schedule full and incremental backups with maintenance plans of database but it seems that It's not truncating logs of database so how can I do that in maintenance plan? Is there a option or do I have to schedule another script for that?

asked 03 Apr, 04:54

hg1735's gravatar image

hg1735
55111
accept rate: 0%

Do you really want to truncate the log when you run a backup transaction log only? Because if you do then you need to be aware that in case of a restore you need the latest full database backup and all separate backup logs made since the full backup.

If the size of the log is no problem, I would generally recommend to do the transaction log backups without truncation so the log grows until the next full backup but you only need the latest log backup for recovery...

(03 Apr, 14:09) Volker Barth

A maintenance plan is basically a UI that builds an event. You could modify the event to meet your specific needs. See BACKUP DATABASE statement for syntax of the statement used in the event to backup the database. To truncate the log, you will need to use the TRANSACTION LOG TRUNCATE backup option.

permanent link

answered 03 Apr, 09:54

Chris%20Keating's gravatar image

Chris Keating
5.0k2784
accept rate: 33%

In the box ro Run this SQL after the plan, you could put

BACKUP DATABASE DIRECTORY '' TRANSACTION LOG ONLY TRANSACTION LOG TRUNCATE; COMMIT;

permanent link

answered 06 Apr, 08:47

mrmitch's gravatar image

mrmitch
41126
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×82
×43
×7

question asked: 03 Apr, 04:54

question was seen: 206 times

last updated: 06 Apr, 08:47