• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 298
  • Last Modified:

transaction log in sql server

Why will Transactional Log becomes full, and what will you do if it
happens?
0
sqlcurious
Asked:
sqlcurious
  • 2
4 Solutions
 
lcohanDatabase AnalystCommented:
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
 
Ephraim WangoyaCommented:

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
 
mayank_joshiCommented:
try the folllowing script:-

USE [Database_Name]
GO
DBCC SHRINKDATABASE(N'Database_Name' )
GO
0
 
mayank_joshiCommented:
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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now