Sunday, March 25, 2012

Can't shrink transaction log

Hi,
A SQL Server2000 database we have has ended up with a
massive Transaction Log (basically because the maintenance
schedule needs looking at).
Anyway to cut a long story short, I backed up the
transaction log which truncated it, but I can't seem to
shrink the logfile to free up the space.
I tried:
DBCC SHRINKFILE (2, 200, TRUNCATEONLY)
[where 2 is the filenumber of the logfile]
This came back with:
'Cannot shrink log file 2 (Main_Log) because all logical
log files are in use.'
Can anyone tell me how I can shrink this log file please?
Regards,
VinceVince Beaney wrote:

> Can anyone tell me how I can shrink this log file please?
Check out below KB articles:
INF: How to Shrink the SQL Server 7.0 Transaction Log
http://support.microsoft.com/defaul...kb;en-us;256650
INF: Shrinking the Transaction Log in SQL Server 2000 with DBCC SHRINKFILE
http://support.microsoft.com/defaul...kb;en-us;272318
Log File Grows too big
http://www.support.microsoft.com/?id=317375
Log file filling up
http://www.support.microsoft.com/?id=110139
Considerations for Autogrow and AutoShrink
http://www.support.microsoft.com/?id=315512
http://www.mssqlserver.com/faq/logs-shrinklog.asp
sincerely,
--
Sebastian K. Zaklada
Skilled Software
http://www.skilledsoftware.com
This posting is provided "AS IS" with no warranties, and confers no rights.|||I have had a similar problem. The only thing that worked was running these
commands:
First, backup the log with truncate_only:
BACKUP Log DBNAME with TRUNCATE_ONLY
Then you can run the SHRINKFILE DBCC Command:
DBCC SHRINKFILE (LOGFILE, 10)|||Excellent!
Thankyou, the "INF: Shrinking the Transaction Log in SQL
Server 2000 with DBCC SHRINKFILE" is what I was looking
for.
Thanks,
Vince

>--Original Message--
>Vince Beaney wrote:
>
please?
>Check out below KB articles:
>INF: How to Shrink the SQL Server 7.0 Transaction Log
>http://support.microsoft.com/default.aspx?scid=kb;en-
us;256650
>INF: Shrinking the Transaction Log in SQL Server 2000
with DBCC SHRINKFILE
>http://support.microsoft.com/default.aspx?scid=kb;en-
us;272318
>Log File Grows too big
>http://www.support.microsoft.com/?id=317375
>Log file filling up
>http://www.support.microsoft.com/?id=110139
>Considerations for Autogrow and AutoShrink
>http://www.support.microsoft.com/?id=315512
>http://www.mssqlserver.com/faq/logs-shrinklog.asp
>sincerely,
>--
>Sebastian K. Zaklada
>Skilled Software
>http://www.skilledsoftware.com
>This posting is provided "AS IS" with no warranties, and
confers no rights.
>
>.
>sql

No comments:

Post a Comment