473,387 Members | 1,749 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Turn of logging on SQL maintenance plans

I am running a SQL maintenance job on a 40 GB database which performs
optimizations by re-orginizing data and indexes pages. After the job
is finished, a separate job peforming a SQL transaction log backup is
run on the same database, which produces a 30 GB transaction log backup
file. Is there any way to turn off logging during the maintenance
plan, so that when the transaction log backup occurrs it will not
produce a large backup file?

Jul 10 '06 #1
2 6245
On 10 Jul 2006 12:32:46 -0700, Justin wrote:
>I am running a SQL maintenance job on a 40 GB database which performs
optimizations by re-orginizing data and indexes pages. After the job
is finished, a separate job peforming a SQL transaction log backup is
run on the same database, which produces a 30 GB transaction log backup
file. Is there any way to turn off logging during the maintenance
plan, so that when the transaction log backup occurrs it will not
produce a large backup file?
Hi Justin,

You can't turn off logging completely, but you can tell SQL Server to
overwrite parts of the transaction log that are not needed for restore
or repair in case of emergency. You do this by setting the recovery
model to simple.

BEWARE: By setting the recovery model to simple, you forfeit the ability
to restore your database to a point in time. To minimize potential for
data loss, you should switch back to full recovery and take a full
database backup (in that order!!) as soon as the maintenance job is
done.

--
Hugo Kornelis, SQL Server MVP
Jul 10 '06 #2
Justin (ju*************@hotmail.com) writes:
I am running a SQL maintenance job on a 40 GB database which performs
optimizations by re-orginizing data and indexes pages. After the job
is finished, a separate job peforming a SQL transaction log backup is
run on the same database, which produces a 30 GB transaction log backup
file. Is there any way to turn off logging during the maintenance
plan, so that when the transaction log backup occurrs it will not
produce a large backup file?
That depends. If the database goes bad in the middle of the day, because
of hardware error, or a serious human error, what is your requirement for
recover from the disaster? Are you content with restoring from the
the most recent full backup? Or do you want to be able to recover to a
point as close to the disaster to minimise data loss?

If the full backup is OK for you, then the answer is simple. Put the
database into simple recovery and forget all about the transaction log.

If you want up-to-the-point recovery, you want to avoid turning off
the transaction log, because if you do you break the log chain, and
until you have run a new full backup, you don't have the option to
recover to point in time.

What you could try to keep down the transaction log in size during
maintenance is to switch to bulk-logged recovery. This is a variant
of full recovery that logs less for some bulk operations like index
rebuilds.

You could also consider setting up a more intelligent job for reindexing.
There is little need to reindex a table with low fragmentation. DBCC
SHOWCONTIG can be used to examine the fragementation for a table.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Jul 11 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: trotter | last post by:
I want to know if there is a "best-practice" for setting up Database Maintenance Plans in SQL Server 7 or 2000. To be more specific, I want to know the order in which I complete the tasks. Do I...
1
by: Alexey Aksyonenko | last post by:
I know that SQL Servers can be set up to forward alerts to a single SQL Server. I am wondering if same would be true for the Maintenance Plan Reports. Basically, I want to have only one SQL...
5
by: Jim Andersen | last post by:
Hi there, Used the wizard to create a maintenance plan for a db. But it fails most of the time. I checked the log-files. At 1.00 AM, it runs the "Optimizations" job for 6-9 seconds. It...
4
by: nielsonj1976 | last post by:
I am getting a failure on the db backup job of one of my maintenance plans. It is coming back with the generic error message of, "sqlmaint.exe failed. (Error 22029). The step failed." I...
0
by: Larry Maturo | last post by:
I noticed that in SQL Server Management Studio, under Management, there is a Legacy folder with maintenace plans created by adding entries to the system tables dbo.sysmaintplan_* tables (i.e. all...
11
by: RdR | last post by:
Hi, I am using Q Replication, I need to set to logging to capture changes on a table but the table has more than 18 characters for the name, I looked at the docs, it mentioned that table names...
3
by: Netsharp Ninja | last post by:
What is the best of loggin in .NET I am used to use logging into a file with Java but I see many in .NET use event logging (Well I have not seen other techniques) From my old days(Client-Server)...
0
by: pk | last post by:
I have a problem that I would like to resolve through scripting, but I'm not sure how to go about it (or if it's even possible.) We're trying to work around a bug (...
0
by: Neil | last post by:
Using SQL 7, going into EM, and clicking on one of the databases, I see two maintenance plans listed. One of them is active, and the other has no options checked and nothing schueduled. How can I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.