March 11, 2012 at 10:46 am
Hi,
I am having a database in SQL Server 2008 its Transaction log reached around 70 GB whereas data file is around 750 MB.... I just want to truncate the transaction log file ... is it possible? how? I tried shrinking database and file but didnt worked.... help please...
Regards
March 11, 2012 at 11:15 am
your database is probably in full recovery mode but you are not backing up your transaction log.
Switch to simple recovery mode
run a checkpoint in the database
then attempt to shrink the log to 1GB
switch back to full recovery mode
take a full backup of the database
set up and run regular log backups
and read this managing transaction logs by gail shaw[/url]
---------------------------------------------------------------------
March 13, 2012 at 12:48 am
Hi,
I had once faced a situation where the transaction log was full. Below are some steps you can refer to;
Solution 1:
=======
DBCC SQLPERF(LOGSPACE)
BACKUP LOG Comapny WITH TRUNCATE_ONLY
DBCC SHRINKFILE (Company_log, 500)
DBCC SQLPERF(LOGSPACE)
Solution 2:
======
Change the recovery model from full recovery to simple
Solution 3:
=======
USE DatabaseName
GO
DBCC SHRINKFILE( TransactionLogName, 1) -- freeing some space if it there
BACKUP LOG DatabaseName WITH TRUNCATE_ONLY -- backup the log before shrinking
DBCC SHRINKFILE( TransactionLogName, 1) -- shrink the file
GO
Regards,
Shodhan
March 13, 2012 at 3:51 am
Shodhan,
There are couple of issues with the solutions mentioned by you.
1) BACKUP LOG WITH TRUNCATE_ONLY removes the log entries from log file. So point-in-time restore is not possible. (btw this is deprecated)
2) ALTER DATABASE SET RECOVERY SIMPLE also removes the log entries from log file. So point-in-time restore is not possible.
3) Full database backup must be taken if the above statements are execute as they break the log chain.
Regards,
March 13, 2012 at 8:29 am
Thanx all...
Problem Solved...
I really appreciate all of ur concern...
March 13, 2012 at 2:59 pm
Suresh B. (3/13/2012)
3) Full database backup must be taken if the above statements are execute as they break the log chain.
A differential backup is sufficient to restart the log chain 😉
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs" 😉
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply