Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The log file for database is full

So our SQL Server 2000 is giving me the error, "The log file for database is full. Back up the transaction log for the database to free up some log space."

How do I go about fixing this without deleting the log like some other sites have mentioned?

Additional Info: Enable AutoGrowth is enabled growing by 10% and is restricted to 40MB.

like image 815
Scott Gottreu Avatar asked Sep 16 '08 14:09

Scott Gottreu


People also ask

How do I fix a transaction log for a database is full?

Try one of the 4 suggestion below to fix this issue: Under SQL Server Management Studio set the Maximum File Size under options for Altiris database to Unrestricted File Growth. Increase the Restricted File Growth (MB) size to a larger value creating space for transaction logs to grow. Shrink the log files from task.

What happens when log file is full?

When the transaction log becomes full, SQL Server Database Engine issues a 9002 error. The log can fill when the database is online, or in recovery. If the log fills while the database is online, the database remains online but can only be read, not updated.

How do I clear a DB log file?

To delete data or log files from a databaseExpand Databases, right-click the database from which to delete the file, and then click Properties. Select the Files page. In the Database files grid, select the file to delete and then click Remove. Click OK.


1 Answers

To just empty it:

backup log <dbname> with truncate_only  

To save it somewhere:

backup log <dbname> to disk='c:\somefile.bak'

If you dont really need transactional history, try setting the database recovery mode to simple.

like image 109
TrevorD Avatar answered Jan 02 '23 02:01

TrevorD