|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Friday, August 24, 2012 8:11 AM
Points: 1,097,
Visits: 2,157
|
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Thursday, January 31, 2013 3:25 PM
Points: 48,
Visits: 31
|
|
Krishna - Good article. Question though. What if the logfile expanded to fill the rest of the drive. Then what?
Tom Walters
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, February 18, 2013 7:37 PM
Points: 2,
Visits: 81
|
|
What about shrinking the database with replication???
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Today @ 2:15 PM
Points: 1,060,
Visits: 4,159
|
|
Hi Krishna
Very clear article, but I was a bit confused about the first option of shrinking the log - if it is full now, won't shrinkign the physical size mean it is still full afterwards?
John
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Friday, August 24, 2012 8:11 AM
Points: 1,097,
Visits: 2,157
|
|
Tom Walters (3/17/2009) Krishna - Good article. Question though. What if the logfile expanded to fill the rest of the drive. Then what?
hi Tom,
Thanks for your feedback. if the log file filled the rest of the drive you can think of any one of the steps mentioned in the article.
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Friday, August 24, 2012 8:11 AM
Points: 1,097,
Visits: 2,157
|
|
jts_2003 (3/18/2009) Hi Krishna
Very clear article, but I was a bit confused about the first option of shrinking the log - if it is full now, won't shrinkign the physical size mean it is still full afterwards?
John
Hello John,
Thanks for your valuable feedback. When you shrink the log file it removes the inactive VLF's to reuse the space made available.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, March 19, 2009 5:46 AM
Points: 1,
Visits: 8
|
|
| I cannot believe that backup was the third option. The first and best option is to create proper maintenance on the database. The only transactions you need are those occuring since the last backup. This keeps the back the logs small.
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Friday, August 24, 2012 8:11 AM
Points: 1,097,
Visits: 2,157
|
|
michael_sawyer (3/18/2009) I cannot believe that backup was the third option. The first and best option is to create proper maintenance on the database. The only transactions you need are those occuring since the last backup. This keeps the back the logs small.
Hi michael,
I have pointed out options of what we can do, the preference does not go according to the options mentioned. It totally depends on what you can chose as the best method. Obviously, at the first point if we have a good backup plan, frequent transaction logs, we would definitely not land on this kind of situation.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Tuesday, August 21, 2012 3:51 AM
Points: 3,
Visits: 64
|
|
Hi Krisha,
in order to shrink the logfile you recommend the command: "DBCC SHRINKFILE (transactionloglogicalfilename, TRUNCATEONLY)"
But BOL for DBCC SHRINKFILE states that: "TRUNCATEONLY is applicable only to data files."
Would you please comment on that.
Thanks Harald
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Tuesday, February 05, 2013 12:00 PM
Points: 1,
Visits: 55
|
|
Here is my take on it. (in sql2005, production with recover full mode)
DBCC LOGINFO('mydatabasename')
see the status column, you can only shrink the "0" rows after the last 2 or what. Because that was what is "free". (The worse case will be something like replication has a lockup and then the transaction log can't recycle and it will fill to the end) If your log hard drive is full. you should buy time and add an extra log file in the other HD.
do a checkpoint (that force transactions to write) backup your db change recover mode to simple that basically free up the log. (not the size)
Then you can detach the extra log file, shrink the size. turn back to Full mode.
|
|
|
|