April 23, 2010 at 4:11 pm
Hi all,
I have a database 'db1' that has its transactional log full and I checked for the free space available.
It gives 29% free in datafile
and -95% in log file.
and When I run a package on this DB Its giving me the error.
I tried shrinkfile for Tlogfile using gui, and it said -98% free space.
So, How do I get free space in my transactional log.
should I truncate or shrink my tlog,
If so How?
April 23, 2010 at 5:40 pm
What recovery mode is the database in? Can you back up the log to another drive?
April 23, 2010 at 5:44 pm
Yes,
I can back up the log. But, it is not necessary.
and the database is in full recovery mode.
But can u give me both the scenarios like
what should I do Incase if I need to back up the log
and case where I dont need the log backup.
thanks
baba
April 23, 2010 at 5:51 pm
When the database is in full recovery mode, the log will grow until you back it up, at which point, it will remove the committed transactions and reuse the space it has taken up or be available to be shrunk manually. Until those transactions are backed up, you can't reclaim the space. Once the log is backed up, it won't shrink back to its original size, but it will have space available internally for new transactions. To get it back to the original size, you need to back it up and then shrink it.
You can truncate the log, but then you lose the ability to restore from a backup and use the information in the truncated log to roll forward. If the database is in full recovery mode, the ability to roll forward must have been important at some point, so I wouldn't recommend truncating the log.
April 23, 2010 at 5:57 pm
Thanks you david,
The information is really help full.
My Sr.dba says we can truncate the log no backup is required.
can you suggest me the best practice for truncating the log.
My plan is to put the database in simple recovery mode and then shrink the log file.
what do you suggest.?
April 23, 2010 at 6:05 pm
I'm not sure there is a 'best practice', but here's a link to a Microsoft article that, I think, covers what you want to do.
http://support.microsoft.com/kb/272318
Good luck.
April 23, 2010 at 6:32 pm
yes, this is the information I was looking for..
thanks very much bro.
April 23, 2010 at 11:13 pm
Try to free up space in the drive. What is the recovery model of the database? If possible, attach one more log file to a seperate drive where space available or stop sql server and move the ldf file to a drive where space is available.
Thanks.
April 24, 2010 at 7:41 am
Please read through this - Managing Transaction Logs[/url]
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
April 24, 2010 at 9:20 am
striker-baba (4/23/2010)
I can back up the log. But, it is not necessary.and the database is in full recovery mode.
if the database is in full recovery model then log backups are vital. What backup regime\jobs do you have in force against this database at present?
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs" 😉
April 24, 2010 at 10:13 am
striker-baba (4/23/2010)
My plan is to put the database in simple recovery mode and then shrink the log file.
Why do you want to put it in SIMPLE just for truncating log ?, then what would happen when you again put it in FULL model.
Spent sometime with this link
http://support.microsoft.com/kb/873235
-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done;-)
April 25, 2010 at 7:39 am
Assuming it's a production database, do you understand the disaster recover risks of switching to simple ?
April 25, 2010 at 9:12 am
I had a suggestion to put the database in simple recovery mode and then shrink the transaction log file
I dont know what impact does it has on the size of the file.
I would like to know its impacts both gud and bad..!!!
April 25, 2010 at 9:54 am
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
April 25, 2010 at 3:10 pm
striker-baba (4/25/2010)
I had a suggestion to put the database in simple recovery mode and then shrink the transaction log fileI dont know what impact does it has on the size of the file.
I would like to know its impacts both gud and bad..!!!
I don't think you are getting good advice from your dba.
Have you read Gail's article ? Have you read other documentation about transaction logs and recovery models ? There are different choices to make depending on different situations such as development or production environment, and how tolerant you business is for potential data loss (1 day's business, or just the last 10 minutes ...)
Viewing 15 posts - 1 through 15 (of 21 total)
You must be logged in to reply to this topic. Login to reply