browse: forums | FAQ
Connecting Tech Pros Worldwide

Hey there! Do you need Microsoft SQL Server help?

Get answers from our community of Microsoft SQL Server experts on BYTES! It's free.

Truncating or shrinking a 65GB Log File with available 2.8GB harddisk space

khickyphutz's Avatar
Newbie
 
Join Date: Nov 2006
Posts: 7
#1: Nov 28 '06
Good day!

I would like to ask for a technical advice regarding transaction logs. Right now, our server only have 2.8GB due to the transaction log of our database which is 65GB now. Its database size is around 1.8GB. There is an approximate growth of 1GB+ per day in the transaction log.

I have tried backing up the transaction log with the option of remove inactive transaction logs but it wont work, as well as backing up completely the database.

I have tried shrinking the transaction log to a specified size but the smallest size I can reduce it is 64GB.

What should I do in order for me to reduce the size of the transaction log?



Thank you and God bless.



Lives Here
 
Join Date: Oct 2006
Posts: 1,626
#2: Nov 28 '06

re: Truncating or shrinking a 65GB Log File with available 2.8GB harddisk space


Quote:

Originally Posted by khickyphutz

Good day!

I would like to ask for a technical advice regarding transaction logs. Right now, our server only have 2.8GB due to the transaction log of our database which is 65GB now. Its database size is around 1.8GB. There is an approximate growth of 1GB+ per day in the transaction log.

I have tried backing up the transaction log with the option of remove inactive transaction logs but it wont work, as well as backing up completely the database.

I have tried shrinking the transaction log to a specified size but the smallest size I can reduce it is 64GB.

What should I do in order for me to reduce the size of the transaction log?



Thank you and God bless.

hold your breath and delete it after you copy it over to another disk.
khickyphutz's Avatar
Newbie
 
Join Date: Nov 2006
Posts: 7
#3: Nov 28 '06

re: Truncating or shrinking a 65GB Log File with available 2.8GB harddisk space


Quote:

Originally Posted by willakawill

hold your breath and delete it after you copy it over to another disk.

???

I already have copied the DATA and LOG file to my hardisk through Remote Desktop. Now, How will I be able to use the DATA and LOG? Assuming the database name is AgriMrpPrd and the Files are: AgriMrpPrd.mdf and AgriMrpPrd_Log.ldf.

Sowee to the nooby question...

Take care and God Bless
Newbie
 
Join Date: Nov 2006
Posts: 9
#4: Nov 28 '06

re: Truncating or shrinking a 65GB Log File with available 2.8GB harddisk space


Try
truncate log {databasename} with truncate_only
khickyphutz's Avatar
Newbie
 
Join Date: Nov 2006
Posts: 7
#5: Nov 29 '06

re: Truncating or shrinking a 65GB Log File with available 2.8GB harddisk space


This is what I have entered in SQL Analyzer:

truncate log AgriMrpPrd with truncate_only

Where AgriMrpPrd is the name of the database.


The error is:
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near 'log'.
Newbie
 
Join Date: Nov 2006
Posts: 9
#6: Nov 29 '06

re: Truncating or shrinking a 65GB Log File with available 2.8GB harddisk space


backup log AgriMrpPrd with truncate_only
khickyphutz's Avatar
Newbie
 
Join Date: Nov 2006
Posts: 7
#7: Nov 30 '06

re: Truncating or shrinking a 65GB Log File with available 2.8GB harddisk space


I already have run the script and it compiled successfully but there was no change in the size of my transaction log.

the transaction log file size is still the same and it continues to grow every day.
any other alternative way to reduce its size?Ü

thank you and god bless
khickyphutz's Avatar
Newbie
 
Join Date: Nov 2006
Posts: 7
#8: Nov 30 '06

re: Truncating or shrinking a 65GB Log File with available 2.8GB harddisk space


Good day wayne,

after running the script you gave me, I tried to shrink the database this time and I can already set its minimum size from 64GB to 5GB now. after shrinking the transaction log, the size now of my transaction log is only 5GB.

Thank's a lot manÜ Thank you so much, It really helps.

Take care and God Bless.



MaDz
Reply