Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Truncate Log File

Status
Not open for further replies.

hameja

Programmer
Oct 15, 2003
42
BE
Hi People

Please assist me in this technology. The transaction log file have reached 99% and I can not work any longer. How can I truncate this file.

I have run a backup as

backup log [transaction log file). The command is not working and I feeling frustrated.

John
 
For backup LOG run:

BACKUP LOG your_database_name TO DISK = 'C:\some_path\some_file_name'

OR backup entire database ( it backup database and log )

BACKUP DATABASE your_database_name TO DISK = 'C:\some_path\some_file_name'

Ofcourse, ensure that you have enought free space on destination drive of log backup :)

This backup automaticaly truncate the log.
From Books OnLine:

Truncation does not reduce the size of a physical log file, it reduces the size of the logical log file.

So you than need free up unused space inside physical log file by shrinking it: ( this shrink also data file )

DBCC SHRINGDATABASE
{
your_database_name
}

For more information about shrinking look at:


Zhavic



---------------------------------------------------------------
In the 1960s you needed the power of two Comodore64s to get a rocket to the moon. Now you need a machine which is a vast number of times more powerful just to run the most popular GUI.
 
Little mistake, this is right

DBCC SHRINKDATABASE
{
your_database_name
}

Zhavic


---------------------------------------------------------------
In the 1960s you needed the power of two Comodore64s to get a rocket to the moon. Now you need a machine which is a vast number of times more powerful just to run the most popular GUI.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top