Solved

Transaction log full, simple recovery in SQL 2005 (with 80 compatibilty)

Posted on 2008-06-19
6
1,617 Views
Last Modified: 2008-07-01
Hi Experts.
the DBA left without notice, we just found out that a database was in Simple recovery mode.. the log just got maxed out (2 gig space)...
The database has not been backed up for three weeks, and never a log back up
I just gave it abother gig of space, but I would like to do a full backup and make sure the log is (included/backed-up/truncated) (by incuded i mean to make sure the log is written in the database before truncating, or is my job)
I am a little freaked out, since it has been a long time, and the fact that log shouldn't have been maxed-out, I know there was some major imports happening, but doesn't check-point make that space available for the log to be used again?

anyway, please let me know, how to backup, and truncate safely... TIA
0
Comment
Question by:sir-rob
  • 3
  • 2
6 Comments
 
LVL 8

Expert Comment

by:sbagireddi
ID: 21824914
When large transactions take place the log will fill up, until the transaction is committed, at that point the log is truncated.
0
 
LVL 32

Expert Comment

by:bhess1
ID: 21824951
Try these commands in a query window:

BACKUP LOG MyDatabase
  WITH TRUNCATE_ONLY -- truncate log

BACKUP DATABASE MyDatabase                   -- backup database
TO DISK='E:\My\Backup\Disk\Mydatabase.bak'
WITH init, skip
0
 
LVL 32

Expert Comment

by:bhess1
ID: 21824959
Also, i'm a bit surprised things grew that much in SIMPLE mode.  How much of the log space is free?  If none, what is holding open a transaction for this long?
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

by:sir-rob
ID: 21824989
how can I tell how much space is avaiable?

Also, when I do (WITH TRUNCATE_ONLY -- truncate log), would that still back up everything safely (no loss of data)
0
 
LVL 32

Accepted Solution

by:
bhess1 earned 500 total points
ID: 21825009
Yes - no loss of data.

As to free space - Right-Click on the database, and select Tasks - Shrink - Files.  Selecting the file type in the dropdown (data or log) will show how much free space is available.  You can SHRINK the log file if you need the space.
0
 

Author Comment

by:sir-rob
ID: 21825081
ok, so I did "Right-Click on the database, and select Tasks - Shrink - Files." the space has not been released yet... so the extra gig now is being used up, so I need to (please correct me if I am wrong)
* first find out why the log is not  being released (how do I do that?)
then there is an option in the same (shrink file window) that says
* released unused space, or reorganize pages before releasing spce, or rmpty in another file...
My question is can I release the space here, and get it over with? (I should first figyre out why the log keeps getting bigger though, no?)
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

759 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

24 Experts available now in Live!

Get 1:1 Help Now