Hi
I am getting following error when I try to shrink the transaction log:
DBCC SHRINKFILE (wslogdb50_Log, 2000)
Server: Msg 8985, Level 16, State 1, Line 1Could not locate file 'wslogdb50_Log' in sysfiles.DBCC execution completed. If DBCC printed error messages, contact your system administrator.
Any ideas?
Regards
Chandu
Check that you are using the database that you wish to shrink the file of.
What's the output from SELECT NAME FROM SYSFILES ?
Thanks for the prompt response.
I get following output for SELECT NAME FROM SYSFILES:
wslogdb50
wslogdb50_Log.LDF
I am getting "Incorrect Syntax error" when i include .ldf in the DBCC shrinkfile command.
The statement seems to have completed without any error. But, I am getting following message:
Cannot shrink log file 2 (wslogdb50_Log.ldf) because all logical log files are in use.
(1 row(s) affected)
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
Current Size 1257512 Used pages 1257512
The log file increased to 10GB. I need to reduce it ASAP as we are running out of space. Any other alternative? Starting and stopping sql server?
Run the following, replace DBNAME with your database name and FILEID with the file id.
BACKUP LOG DBNAME WITH NO_LOGGOUSE DBNAMEGODBCC SHRINKFILE (FILEID, 128, TRUNCATEONLY)GO
Thanks once again for your help.
What is 128?
I have already run following statement:
backup log wslogdb50 with truncate_only
Excellent !! It worked.
Thanks very much for your help.
HI Nicholas,
I am facing the same problem.
I am unable to understand the what your talking about.
Try shrinking it using the fileid (SELECT NAME, FILEID FROM SYSFILES), use the same syntax, just replace the filename with the fileid.
Please let me know how can i reduce the file size of the database log.
Thanks
Bapi.