Solved

Index rebuilding increasing log size

Posted on 2007-04-02
4
1,159 Views
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?
0
Comment
Question by:looper8
4 Comments
 
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.
0
 
LVL 2

Expert Comment

by:rattu976
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.

Regards,
Rehan
0
 
LVL 1

Author Comment

by:looper8
ID: 18880785
Thanks.  

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?

0
 
LVL 3

Accepted Solution

by:
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
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
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.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

746 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now