Solved

transaction log in sql server

Posted on 2011-02-24
4
254 Views
Last Modified: 2012-05-11
Why will Transactional Log becomes full, and what will you do if it
happens?
0
Comment
Question by:sqlcurious
  • 2
4 Comments
 
LVL 39

Accepted Solution

by:
lcohan earned 125 total points
ID: 34971370
You must do periodic maintenance/backups and please see more details at:

How to stop the transaction log of a SQL Server database from growing

http://support.microsoft.com/kb/873235

0
 
LVL 32

Assisted Solution

by:ewangoya
ewangoya earned 125 total points
ID: 34971579

The are two things you can do to avoid the log growing to large

1. Set database recovery mode to SIMPLE
OR
2. Schedule regular backups
0
 
LVL 9

Assisted Solution

by:mayank_joshi
mayank_joshi earned 250 total points
ID: 34978410
try the folllowing script:-

USE [Database_Name]
GO
DBCC SHRINKDATABASE(N'Database_Name' )
GO
0
 
LVL 9

Assisted Solution

by:mayank_joshi
mayank_joshi earned 250 total points
ID: 34978447
The above script will shrink both data and log files.That's absolutely harmless.
But if you want to shrink only the log file use:-

USE [Database_Name]
GO
DBCC SHRINKFILE (N'DataBase_Log' , 0, TRUNCATEONLY)
GO

here DataBase_Log is the logical name of log file of database.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Sql query 34 35
SQL Transaction logs 8 28
TSQL DateADD update Question 4 29
Changing the datatype of a column from nvarchar to date 47 12
SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now