Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 How to truncate the .dlf log?

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-12-04 : 09:18:25
lars writes "Hi

How do I truncate my extremely large .dlf log on my production database 7.0 sqlserver on ms2000 server and sp3. It is so large that it fills the disk completely. I havee run a back up and tried to truncate - nothing happens."

nr
SQLTeam MVY

12543 Posts

Posted - 2001-12-04 : 10:32:56
easiest way is to dettach the database, delete the log file then attach the database again. This will create a default size log file.
Make sure you take a backup first.

If it has really filled the whole disk yuo are in danger of ending up with a corrupt database.
In future set a max size so that you leave some room to play with.

==========================================
Cursors are useful if you don't know sql.
Beer is not cold and it isn't fizzy.
Go to Top of Page

SQLServerDBA_Dan
Aged Yak Warrior

752 Posts

Posted - 2001-12-04 : 11:13:57
quote:

easiest way is to dettach the database, delete the log file then attach the database again. This will create a default size log file.
Make sure you take a backup first.

If it has really filled the whole disk yuo are in danger of ending up with a corrupt database.
In future set a max size so that you leave some room to play with.

==========================================
Cursors are useful if you don't know sql.
Beer is not cold and it isn't fizzy.



YIKES!!! I've run into a problem where I dettached the DB deleted the log and then the DB would not reattach... It's important that you do have your nice backup before attempting this one. I've heard of many other people loosing the DB by this method too... but out of the 15-16 times I've done this it's only went bad that 1 time.

Daniel
SQL Server DBA
Go to Top of Page

cshekar
Starting Member

49 Posts

Posted - 2001-12-06 : 10:28:08
You can truncate in SQL2000 clicl by backup Transaction file sql automatocaly truncate log file, but it is not mean that physical it will reduce the size you have to shrink the databse by nmanually the it will shrink. and reduce the physical transaction log file i am sure it works.
tru to back up log file atleat 3-4 times daily then it will not grow as large as you are now



quote:

quote:

easiest way is to dettach the database, delete the log file then attach the database again. This will create a default size log file.
Make sure you take a backup first.

If it has really filled the whole disk yuo are in danger of ending up with a corrupt database.
In future set a max size so that you leave some room to play with.

==========================================
Cursors are useful if you don't know sql.
Beer is not cold and it isn't fizzy.



YIKES!!! I've run into a problem where I dettached the DB deleted the log and then the DB would not reattach... It's important that you do have your nice backup before attempting this one. I've heard of many other people loosing the DB by this method too... but out of the 15-16 times I've done this it's only went bad that 1 time.

Daniel
SQL Server DBA



chandra shekar
Go to Top of Page
   

- Advertisement -