Suppressing Successful backup Information in SQL Server Error Log

Some time back, I was administering a SQL Server 2005 instance which hosts a huge number of Databases. The instance is in production environment and all the databases are set to be backed up at regular intervals of 10 minutes. Due to this, SQL Server Log is flooded with backup information resulting the SQL Server Log to grow enormously. As part of monitoring, I look at the entries in SQL Server Log and it is a tough task to weed out the entries related to successful database backups. These are the steps I had to perform to supress the successful backup information in SQL Server Logs.

To understand better let us take a look at the problem first and then work on solving it.

SQL Server runs a default trace which keeps track of certain events and writes them to SQL Server Log when there is an important information such as a database restore, change in recovery model of a database or a failure login. 

The following images display some sample log entries found in a log viewer. The image displayed contains an entry about a failed login attempt to the SQL Server.

This below image displays an entry about a change in the recovery model for a database. 

Here is another example, the below image displays the error log indicating that a profiler trace has been started and stopped by user.

Monitoring the SQL Server log from time to time is very important since it has vital information about the SQL instance. Many times, the information found in these error logs is important for troubleshooting SQL Server issues. Having too many entries in the SQL Server Log causes delay in loading the error log in log viewer, moreover it is difficult to find the error messages reported in the error log due to high number of log entries. SQL Server Error Log is recycled automatically every time SQL Server starts, due to this, error log grows in huge size causing trouble to find the vital information about the SQL instance.

On a SQL Server which hosts 20 databases, assuming that transaction log backups are scheduled every 10 minutes, would result in 2880 entries each day due to successful backups being written in error log. This should be avoided in order to find out other entries easily in log viewer.

Next we move on to the steps to solve this problem.

This problem can be solved in 2 different ways. One way of solving this by runnig DBCC TRACEON command.

Solution 1

Below is the screenshot of the command. What we are doing in this command is to turn off all successful backup entries into the SQL Server. Note that any failed backups are still logged into the error log..  The next line is the command to recycle the SQL Server Error Log, so that we would have a clean error log from that point onwards. This solution is good until the SQL Server is restarted the next time. So as long as the SQL Instance is not restarted, we will not be seeing the successful backup entries in the Error log. 

Below is how the Error Log looks, after it has been recycled..

Solution 2

The procedure involved in this solution is to add a trace flag to the SQL Server startup. This solution is permanent, that is, the successful backup information will not be written in the error log, unless the trace flag is removed manully from the SQL Server startup parameters..

In order to do this, we need to log into Services console and find the SQL Server service and right click, choose porperties. In the Advanced tab, under startup parameters. Go to the end of the parameters and add a semicolon ” ; “, followed by -T3226. Save the modifications by clicking Apply and OK.

You should see a warning / confimation message  indicating that the changes will take effect only when the SQL Server is restarted next time. Click OK and when possible, restart the SQL Server.

Do you like this site? Like our FB page @ Facebook.com\LearnSQLWithBru so that, you know when there is a new blog post.

– Bru Medishetty

 

SQL Server 2008 SP2 Released

Microsoft has recently released Service Pack 2 for SQL Server 2008. There are some improvements this service pack brings in, and here is the list of those..

  • 15K partitioning Improvement.
  • Reporting Services in SharePoint Integrated Mode.
  • SQL Server 2008 Instance Management.
  • Data-tier Application (DAC) Support.

You can download from the following link and make sure you choose the appropriate version of SP2 that is installed on your machine.

http://www.microsoft.com/downloads/en/details.aspx?FamilyID=8FBFC1DE-D25E-4790-88B5-7DDA1F1D4E17&amp%3Bdisplaylang=en

You can also find the list of bugs that are fixed in SQL Server 2008 Service Pack 2 in this knowledge base article.. http://support.microsoft.com/kb/2285068

Do you like this site? Like our FB page @ Facebook.com\LearnSQLWithBru so that, you know when there is a new blog post.

– Bru Medishetty

Verifying SQL Server Database Backups

We know that data in a database is important and also aware that database backups are required in case of a disaster in order to restore the database to a previous state (before the disaster). As a Database Admin it is crucial to perform regular database backups. One of the important tasks many people might not pay attention with respect to database backups is to verify whether or not the database backup is reliable. What I mean is whether that particular database backup is good to be restored?“. It would be a real disaster to have a backup which is not good to be used, in case of recovery. In order to be on a safer side, we need to verify the backups that we have taken. There are 2 ways you can verify whether or not a backup is reliable; one way would be to try restoring from the backup and the other way is to try a restore verifyonly. When a restore the database from a backup (procedure 1), you actually need to have sufficient disk space to hold the database being restored, where as using restore verifyonly option, you do not need to have the free disk space for the database. It verifies whether or not the particular database backup is reliable or not (indicating that it is possible to restore the database from that particular database).

Let’s say you stored your database backup on C: Drive as dbbackup.bak, use the following command to verify if that backup is valid.

RESTORE VERIFYONLY FROM DISK = 'C:\dbbackup.bak'

The image below shows screen shot of the scripts used in this example.

It would be a good practice to verify the backup files using this option on a regular basis.

Do you like this site? Like our FB page @ Facebook.com\LearnSQLWithBru so that, you know when there is a new blog post.

– Bru Medishetty