Solved

cannot backup transaction log

Posted on 2008-10-29
2
952 Views
Last Modified: 2012-05-05
hi all,

I can't perform SQL maintenance anymore, when I run the following script :

delete from decade_history..tblnotifyqueue where decade_receivedt < '20-Sep-2008'

it said :

Server: Msg 9002, Level 17, State 6, Line 1
The log file for database 'DECADE_HISTORY' is full. Back up the transaction log for the database to free up some log space.

so i try to backup the translog by running this script :



alter database DECADE_HISTORY set recovery full

use DECADE_HISTORY

backup log DECADE_HISTORY to disk='c:\Temp\Log1.bak'
dbcc shrinkfile (DECADE_HISTORY_Log, TRUNCATEONLY)
backup log DECADE_HISTORY to disk='c:\Temp\Log2.bak'
dbcc shrinkfile (DECADE_HISTORY_Log, TRUNCATEONLY)
backup log DECADE_HISTORY to disk='c:\Temp\Log3.bak'
dbcc shrinkfile (DECADE_HISTORY_Log, TRUNCATEONLY)

use master
alter database DECADE_HISTORY set recovery FULL

the error is :

Server: Msg 9002, Level 17, State 6, Line 2
The log file for database 'DECADE_HISTORY' is full. Back up the transaction log for the database to free up some log space.
Could not write a CHECKPOINT record in database ID 9 because the log is out of space.
Processed 4103 pages for database 'DECADE_HISTORY', file 'DECADE_HISTORY_Log' on file 2.
BACKUP LOG successfully processed 4103 pages in 2.081 seconds (16.151 MB/sec).

(1 row(s) affected)

DBCC execution completed. If DBCC printed error messages, contact your system administrator.
Processed 4103 pages for database 'DECADE_HISTORY', file 'DECADE_HISTORY_Log' on file 2.
BACKUP LOG successfully processed 4103 pages in 2.518 seconds (13.348 MB/sec).

(1 row(s) affected)

DBCC execution completed. If DBCC printed error messages, contact your system administrator.
Processed 4103 pages for database 'DECADE_HISTORY', file 'DECADE_HISTORY_Log' on file 3.
BACKUP LOG successfully processed 4103 pages in 1.642 seconds (20.470 MB/sec).

(1 row(s) affected)

DBCC execution completed. If DBCC printed error messages, contact your system administrator.
Server: Msg 9002, Level 17, State 6, Line 14
The log file for database 'DECADE_HISTORY' is full. Back up the transaction log for the database to free up some log space.
Could not write a CHECKPOINT record in database ID 9 because the log is out of space.




Please advise, I am not a DBA.  My DBA said upgrade the hard disk   but this server is VERY VERY old......


Thanks.


0
Comment
Question by:binary_1001010
2 Comments
 
LVL 5

Accepted Solution

by:
Aanvik earned 200 total points
ID: 22838243
Use Master
backup log DECADE_HISTORY with no_log

Use DECADE_HISTORY
dbcc shrinkfile(DECADE_HISTORY_Log, 0, truncateonly)

you can use the above commands and it should truncate the Log files.
0
 
LVL 41

Assisted Solution

by:graye
graye earned 50 total points
ID: 22840421
I'd be checking to see if you're also out of physical disk space... or it's just the log file that is out of space.
Log files can be configured to automatically grow (that's the default)... if true, then you'd be out of disk space.    Or, they can be configured not exceed a certain size (which probably isn't a good idea)... then you'd just need to adjust the "quota" allowed for the file.
Take a look at the following article as it describes how to a) fix the problem, b) prevent it from happening again.   There is also a section on how to diagnose why a shrink operation might fail
http://home.hot.rr.com/graye/Articles/SQL_LogMaintenance.htm
 
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MS SQL tables, .net application and ETL connundrum 3 55
How to search for strings inside db views 4 27
Return 0 on SQL count 24 29
Can > be used for a Text field 6 42
Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

770 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