Solved

transaction log in sql server

Posted on 2011-02-24
4
280 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 40

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:Ephraim Wangoya
Ephraim Wangoya 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
database level memory cache..? 8 46
TSQL convert date to string 4 72
shrink table after huge delete 2 33
SQL syntax question 6 72
I have written a PowerShell script to "walk" the security structure of each SQL instance to find:         Each Login (Windows or SQL)             * Its Server Roles             * Every database to which the login is mapped             * The associated "Database User" for this …
Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

732 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