Solved

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

Posted on 2008-06-19
6
1,660 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
[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
  • 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:Brendt Hess
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:Brendt Hess
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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

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:
Brendt Hess 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
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.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

631 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