DBCC SHRINKFILE always works when I run it manually on a log file, even when I get the following message:
'Cannot shrink log file 2 (Claim_Log) because all logical log files are in use.'
When I run it from a job, however, it only shrinks the log about one third of the time. The other times, it just remains large (about 150Gb). There is never any error other than the one listed above. This is the statement that I use:
DBCC SHRINKFILE (N'Claim_log' , 0, TRUNCATEONLY)
I have "Include step output in history" enabled on the job step. Is there something else I can do to get more information on why this isn't working?
Here is the full message from the log:
'Executed as user: *. Cannot shrink log file 2 (Claim_Log) because all logical log files are in use. [SQLSTATE 01000] (Message 9008) DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000] (Message 2528). The step succeeded.'
I have already tried kicking users out of the db and setting it to single user mode.