Solved

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

Posted on 2008-06-19
6
1,624 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
[Webinar] Disaster Recovery and Cloud Management

Learn from Unigma and CloudBerry industry veterans which providers are best for certain use cases and how to lower cloud costs, how to grow your Managed Services practice in IaaS clouds, and how to utilize public cloud for Disaster Recovery

 

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

895 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

14 Experts available now in Live!

Get 1:1 Help Now