Index rebuilding increasing log size

Posted on 2007-04-02
Last Modified: 2012-05-05
Very rarely  do much SQL Server 2k maintenance and am feeling rather dense about this ...

Have set up a weekly job to rebuild the indices in several databases (OK indexes if you'd rather!), but the log size grows rapidly during this rebuild.  Questions are:
1. Does this matter (it's not growing to the extent that there's any concern over HDD space)?
2. If it matters can I just schedule a database shrink (or should that be a log shrink?) immediately after the rebuild?
Question by:looper8
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 11

Expert Comment

by:Ved Prakash Agrawal
ID: 18835020
1. Does this matter (it's not growing to the extent that there's any concern over HDD space)?

Rebuild process to fill log file means  , you should concern about HDD space.

2. If it matters can I just schedule a database shrink (or should that be a log shrink?) immediately after the rebuild?

you should shrnik the log file because it will be the fast rather than shrinking the complete database.

Expert Comment

ID: 18835076
I would suggest using indexdefrag for it will do things online, or if you are doing maintenance out of work hours use dbreindex.
Backup your transaction log before the job start and truncate Log after each index rebuild.
This way you  will be having smallest transaction log possible used by your database. I wont suggest shinking the transaction log however, as it will grow again as and when sql server required it again.
Please let me know if you need any more assistance.


Author Comment

ID: 18880785

I can see why shrinking the log isn't worth doing, but confused about truncation.  Looking at Books Online I come up with this about Log truncation:

"Important  The Truncate method allows reuse of the space allocated to the operating system file(s) maintaining a transaction log. Log truncation is part of normal transaction log backup. If log backup is part of a database backup strategy, the Truncate method should never be called."

Seeing as I've got log backups going every hour during office hours is it necessary to do this?  In other words do I just leave the log as it is after the index rebuild (Sunday afternoon) and it will then get sorted with a log backup Monday morning?


Accepted Solution

abhijit_k earned 500 total points
ID: 19418001
If u dont wish to Generate Trans Log while Reindexing the Put the Database into Bulk_logged before doing Reindexing and change the status once completed

Featured Post

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In my previous article ( I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question