Blackboard

SQL Server 2008 R2

rated by 0 users
Answered (Verified) This post has 2 verified answers | 5 Replies | 1 Follower

Top 75 Contributor
Male
35 Posts
Ala'eddin Al-Suleiman posted on 16 Mar 2012 5:56 PM

We have our BBLEARN Transaction Logs file size increasing rapidly by 10GB-20GB per day!!! it is now around 250GB, what is the recommended way to control the growth of this file by BB, and When i have to truncate the logs and also when i have to shrink the logs file, is this normal? or we have some problem? please help?? we are using MS SQL Server 2008 R2

Answered (Verified) Verified Answer

Top 10 Contributor
Male
6,271 Posts

Ala'eddin,

This is a SQL Server problem, not specifically a Blackboard problem.

Look at this article on shrinking the transaction log:   http://msdn.microsoft.com/en-us/library/ms178037.aspx

Notice what is says in the very first "Note" area:  Typically, truncation occurs automatically under the simple recovery model when database is backed up and under the full recovery model when the transaction log is backed up.

Also, look at the Transaction Log Truncation article at http://msdn.microsoft.com/en-us/library/ms189085.aspx :

Except when delayed for some reason, log truncation occurs automatically as follows:

  • Under the simple recovery model, after a checkpoint.

  • Under the full recovery model or bulk-logged recovery model, after a log backup, if a checkpoint has occurred since the previous backup. For more information, see "Log truncation under the full and bulk-logged recovery models," later in this topic.

However, having the log file truncated means that the transaction records are dropped--it is not the same as shrinking the file and freeing up actual space on the disk.

Open up the SQL Server Management Console, right-click on BBLEARN and choose Tasks > Shrink > Files > Log File.  On that screen, you can see how much free space there is in your transaction log file.   If you have a 250Gb transaction log file and you are doing complete database backups every day, you probably have 99%+ of the file free.  Look at the instructions for shrinking files under http://msdn.microsoft.com/en-us/library/ms190757.aspx.   Also, look at the "Log truncation under the full and bulk-logged recovery models" section of the previous article.

Sometimes, though, I've had a hard time getting the log file to shrink unless a backup or a database checkpoint has just been run.    I can usually get around this by manually running a database checkpoint (http://msdn.microsoft.com/en-us/library/ms188748.aspx), then shrinking the file.  A checkpoint writes all the transaction records that are recorded in the transaction log back to the database.

If you stop and restart the SQL server, you really do not help the situation, though--I know this from personal experience!   So I'm not surprised that you had problems restarting the DB server.

Mike

Top 10 Contributor
Male
6,271 Posts

Ala'eddin,

Blackboard's recommendation is the Full Recovery model, so that's not a mistake in their maintenance plan recommendation article.  However, at this point you really need to just get things functioning.  Most schools (mine included) use Full Recovery, and do a nightly full backup plus transaction log backups every few hours, to keep the transaction log size down.  I haven't tried to run in a SQL Cluster environment, though.

Mike

All Replies

Top 10 Contributor
Male
6,271 Posts

Ala'eddin,

If it is never shrunk, the transaction log can easily grow 10-20Gb a day.  However, the transaction log should be getting shrunk automatically whenever you do a full database backup or a transaction log backup, when a checkpoint occurs.   What is your backup schedule like?  I'd generally recommend doing a full database backup at least once a day, and a transaction log backup several times a day--as often as necessary to keep the transaction log file size to no more than a couple of gigabytes.

If you haven't seen it already, take a look at the Behind the Blackboard article on setting up a maintenance plan for SQL Server 2008: http://kb.blackboard.com/display/KB/SQL+Server+2008+Maintenance+Plan+Wizard

Mike

Top 75 Contributor
Male
35 Posts

HI Mike,

 

Thank you for your Reply, it is really appreciated, Even We Scheduled A Daily Transaction Log and Full Backup, transaction log file size didn't stop growing, I already read Blackboard Maintenance Plan Recommendation Related To SQL, but what confused me that I read many MS SQL articles related to Transaction log backups,Shrinking The Transaction Logs File,Truncating The Transaction Logs  and non of them mentioned that a Full-Backup  will truncate the Transaction Logs File or even shrink it as I understood when reading Blackboard Maintenance Plan Recommendation, and what "added insult to injury" is that BBLEARN Database did go to recovery mode many times when restarting the DB server or MS SQL services due to the huge size of transaction logs we have (240 GB) even so it shouldn't, is it recommended changing the recovery mode of the DB to Simple??, Nothing work , we did truncate the logs to at least keeping the current size but it didn't stop growing, I doubt that the DB have a checkpoint, I don't know where exactly the issue , is it related to BB or MS SQL

Thank you Mike

Top 10 Contributor
Male
6,271 Posts

Ala'eddin,

This is a SQL Server problem, not specifically a Blackboard problem.

Look at this article on shrinking the transaction log:   http://msdn.microsoft.com/en-us/library/ms178037.aspx

Notice what is says in the very first "Note" area:  Typically, truncation occurs automatically under the simple recovery model when database is backed up and under the full recovery model when the transaction log is backed up.

Also, look at the Transaction Log Truncation article at http://msdn.microsoft.com/en-us/library/ms189085.aspx :

Except when delayed for some reason, log truncation occurs automatically as follows:

  • Under the simple recovery model, after a checkpoint.

  • Under the full recovery model or bulk-logged recovery model, after a log backup, if a checkpoint has occurred since the previous backup. For more information, see "Log truncation under the full and bulk-logged recovery models," later in this topic.

However, having the log file truncated means that the transaction records are dropped--it is not the same as shrinking the file and freeing up actual space on the disk.

Open up the SQL Server Management Console, right-click on BBLEARN and choose Tasks > Shrink > Files > Log File.  On that screen, you can see how much free space there is in your transaction log file.   If you have a 250Gb transaction log file and you are doing complete database backups every day, you probably have 99%+ of the file free.  Look at the instructions for shrinking files under http://msdn.microsoft.com/en-us/library/ms190757.aspx.   Also, look at the "Log truncation under the full and bulk-logged recovery models" section of the previous article.

Sometimes, though, I've had a hard time getting the log file to shrink unless a backup or a database checkpoint has just been run.    I can usually get around this by manually running a database checkpoint (http://msdn.microsoft.com/en-us/library/ms188748.aspx), then shrinking the file.  A checkpoint writes all the transaction records that are recorded in the transaction log back to the database.

If you stop and restart the SQL server, you really do not help the situation, though--I know this from personal experience!   So I'm not surprised that you had problems restarting the DB server.

Mike

Top 75 Contributor
Male
35 Posts

HI Mike

Thank you so much for your valuable information , this declare the issue, You right this is an MS SQL related issue , and I think that Blackboard meant the Simple Recovery Mode in their Maintenace Plan Recommendation Article, I'm going to make it under Simple Recovery Mode and I'll shrink the Log File when needed I think When More Than 5 GB will be fair enough, I hope That's will resolve the issue, It is more bad than retarting the SQL Server, we have SQL Cluster , and even when failing over from node to node it did go to Recovery Mode which is embarssing , What raised the issue is that we had a SAN Link Disconnection Last Week which guide us to All these issues

 

Thank You , Your help is really appricated

Kind Regards...

 

 

Top 10 Contributor
Male
6,271 Posts

Ala'eddin,

Blackboard's recommendation is the Full Recovery model, so that's not a mistake in their maintenance plan recommendation article.  However, at this point you really need to just get things functioning.  Most schools (mine included) use Full Recovery, and do a nightly full backup plus transaction log backups every few hours, to keep the transaction log size down.  I haven't tried to run in a SQL Cluster environment, though.

Mike

Page 1 of 1 (6 items) | RSS