Sunday, February 19, 2012

Error while shrinking transaction log

Hi all,

while I shrinked transaction log using command "dbcc shrinkfile (logfile)" in query analyzer, the error message " cannot find logfile in sysfiles" was shown up.

The I list out content of sysfiles, and found that sysfiles doesn't contain logfile.

Can anybody tell me how to eliminate error in order to shrink transaction log?

Thanks in advances.

PaulYou need to enter the correct filename for your tempdb database. Default is templog. Right click on tempdb to find your correct filename.
Try:
USE tempdb
go
DBCC SHRINKFILE (TEMPLOG)|||Martsar,

Thanks for your input.

I checked and found that my syntax and log file name were correct, but preceding error message was still there. But I did successfully to shrink TEMPLOG.|||to check the filenames of db and log execute from your database:

use yourDB
go
sp_helpfile

The syntax to shrink db and log is:
DBCC SHRINKDATABASE (N'dbName/or logName', 0)

Also, try to shrink log in EM.

No comments:

Post a Comment