Forums
Posted By: AX_125 MSSQL - 11th May 2007 1:12pm
I have a database that was setup far before my time in my current employment. The log file has grown to 40GB, i have set limits on it to stop it growing any more. I really need to shrink this log file quite consideribly. The database has a full backup every week and an incremental backup every night.

My knowledge of MS SQL server isn't amazing, but i was under the impression this might purge the logfiles like it does with MS Exchange when that is backed up.

The database is only about 300mb and is currently only used for reference. Should i delete the log file and start again with restricted log file sizes?
Posted By: StuyMac Re: MSSQL - 11th May 2007 1:59pm
Can you not create a cron to purge the old files at the end of each day?
Posted By: AX_125 Re: MSSQL - 11th May 2007 3:35pm
Already tried that frown
Posted By: Mark Re: MSSQL - 11th May 2007 3:39pm
Is this on a windows or Linx Server as they can behave different even if its the same version of mysql.

As there log files, i assume for tracking,
you should be able to back them up, and then delete them.

As you say starting a fresh with a max log size.

I don't know for sure as the versions and platform can be important.

But even if you answer those questions, i don't think i could
give you a 100% Answer.

Don't forget, if its not broken dont fix it wink
Posted By: AX_125 Re: MSSQL - 11th May 2007 4:03pm
windows 2000

Well, the disk is 60GB and this log is 45gb. I have now stopped the log from growing any more, there is not enough space to back it up locally. I am doing an online backup this weekend. Hopefully this might do it.
Posted By: MattLFC Re: MSSQL - 11th May 2007 4:31pm
Originally Posted by Mark
Is this on a windows or Linx Server as they can behave different even if its the same version of mysql.

MSSQL is Windows NT only hence the name Microsoft SQL, and has very little to do with MySQL and absolutely nothing to so with Linux. The same as ASP. Talking about MySQL in a topic that is about MSSQL is just confusing matters.

As much as I work with servers I havent a clue about MSSQL lmao! Linux all the way for me unfortuantly sorry I cant offer much help.

wink
Posted By: Mark Re: MSSQL - 11th May 2007 4:50pm
1 log file of 45gb omg

Sorry i cant help, as MYSQL is where i have more knowledge.

Let us know how you get on, if you would,
you never know when it may come in handy.

Sorry i looked too quick, as i work with mysql my eyes
seen mysql and not mssql.
Posted By: MattLFC Re: MSSQL - 11th May 2007 4:58pm
Lol easy enough mistake to make to be honest.
Posted By: AX_125 Re: MSSQL - 18th May 2007 9:26am
Solution, for anyone that is interested

1.DBCC SHRINKFILE(Pubs_log, 100)

2.BACKUP log Pubs WITH TRUNCATE_ONLY

3.DBCC SHRINKFILE(Pubs_log, 100)

© Wirral-Wikiwirral