March 19, 2013 at 1:25 pm
hi i know that shrinking data base increase fragmentation , so logically shrinking data files would two result in fragmentation but does shrinking log file increases fragmentation. i hope answer is NO.
Second question is rebuilding an index reduces fragmentation but it increase size of database.I have seen increase in size of log file but does data file size to increases . Again i hope ans is No.
Plz correct me on this
March 19, 2013 at 1:48 pm
anoop.mig29 (3/19/2013)
hi i know that shrinking data base increase fragmentation , so logically shrinking data files would two result in fragmentation but does shrinking log file increases fragmentation. i hope answer is NO.Shrinking log file does not create any fragmentation.
Second question is rebuilding an index reduces fragmentation but it increase size of database.I have seen increase in size of log file but does data file size to increases . Again i hope ans is No.
Plz correct me on this
rebuilding/re-organizing index is a fully logged operation, therefore your log will be growing during the time of rebuild/re-organize.
SueTons.
Regards,
SQLisAwe5oMe.
March 19, 2013 at 1:48 pm
Why are you shrinking the log file? If your backup method is Full then the logfile will truncate on backup.
March 19, 2013 at 2:06 pm
Erin Ramsay (3/19/2013)
Why are you shrinking the log file? If your backup method is Full then the logfile will truncate on backup.
Full and Differential backups do not truncate (mark VLFs as reusable) the t-log. Only transaction log backups accomplish this when a database is using the BULK_LOGGED or FULL recovery models.
March 19, 2013 at 2:13 pm
anoop.mig29 (3/19/2013)
hi i know that shrinking data base increase fragmentation , so logically shrinking data files would two result in fragmentation but does shrinking log file increases fragmentation. i hope answer is NO.
Index fragmentation, no. However, lots of shrink/grow/shrink/grow will cause log fragmentation. You shouldn't be regularly shrinking your logs. Once off, yes. Regular, no.
Please read through this - Managing Transaction Logs[/url]
Second question is rebuilding an index reduces fragmentation but it increase size of database.I have seen increase in size of log file but does data file size to increases .
Yes it can. If there's not enough space in the database for the new index, the data file will grow.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
March 19, 2013 at 3:06 pm
Lynn Pettis (3/19/2013)
Erin Ramsay (3/19/2013)
Why are you shrinking the log file? If your backup method is Full then the logfile will truncate on backup.Full and Differential backups do not truncate (mark VLFs as reusable) the t-log. Only transaction log backups accomplish this when a database is using the BULK_LOGGED or FULL recovery models.
Learn something new every day...thank you, sir!
March 20, 2013 at 9:23 pm
GilaMonster (3/19/2013)
anoop.mig29 (3/19/2013)
hi i know that shrinking data base increase fragmentation , so logically shrinking data files would two result in fragmentation but does shrinking log file increases fragmentation. i hope answer is NO.Index fragmentation, no. However, lots of shrink/grow/shrink/grow will cause log fragmentation. You shouldn't be regularly shrinking your logs. Once off, yes. Regular, no.
Please read through this - Managing Transaction Logs[/url]
Second question is rebuilding an index reduces fragmentation but it increase size of database.I have seen increase in size of log file but does data file size to increases .
Yes it can. If there's not enough space in the database for the new index, the data file will grow.
Hi Gail thanks for reply but whats log fragmentation is it hramfull??
March 21, 2013 at 3:18 am
Log fragmentation is described in the article I referred you to.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply