SIGN UP MEMBER LOGIN:    
ARTICLE

Read Log file in SQL Server

Posted by Venkatesan Jayakantham Articles | SQL Server 2012 June 21, 2010
In this article we will see how to read log file in SQL Server and extract information from it.
Reader Level:

Scenario:

Usually, we will face log space issue in our SQL Server. Most of the time, we don't know the reason for our logfile space. I would suggest getting a third party tool to check it. By reading through some of the forums. I found there is some undocumented DBCC command which is used to dig the log file and get some information to us.

This command won't give very great information at least we can get some high level information. Let's see the command,

DBCC Log(Databasename, Option number)

Default option number is 0

For instance, 

dbcc log ('master',0) - 0 indicates a very minimal information.

The above command will provide the below details, 

1.gif

The above output won't give more information let's try with some other option values.
 
Now, am trying the option 1 
 
dbcc log ('master',1) - This will provide some moreinformation like log description, Log record length, log reserver etc., 

2.gif
  
Now, am trying the option 2 

dbcc log ('master',2) - This will provide some more information like PageId, slot ID, Lock details etc.., 

3.gif
  
Now, am trying the option 3

dbcc log('master',3) - This will provide lot of information to us like object name, database name, transaction details like transaction start time /end time/transaction id etc..,

4.gif

Now, am trying the option 4 

dbcc log ('master',4) - This provides very less information when compared to 1,2,3 option. It's just an enhanced version of option type 0.
 
5.gif

Login to add your contents and source code to this article
share this article :
post comment
 

asdasd

Posted by Nithin Steve Sep 09, 2010

dddds

Posted by Nithin Steve Sep 09, 2010
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor
PREMIUM SPONSORS
  • Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
    The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
Team Foundation Server Hosting
Become a Sponsor