code_junkie

Why does DBCC SHRINKFILE work inconsistently in a database job?

Nov 12th, 2011
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. 'Cannot shrink log file 2 (Claim_Log) because all logical log files are in use.'
  2.  
  3. DBCC SHRINKFILE (N'Claim_log' , 0, TRUNCATEONLY)
  4.  
  5. 'Executed as user: *. Cannot shrink log file 2 (Claim_Log) because all logical
  6. log files are in use. [SQLSTATE 01000] (Message 9008) DBCC execution completed.
  7. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000]
  8. (Message 2528). The step succeeded.'
  9.  
  10. Execute SP_ReplicationDbOption {DBName},Publish,true,1
  11. GO
  12. Execute sp_repldone @xactid = NULL, @xact_segno = NULL, @numtrans = 0, @time = 0, @reset = 1
  13. GO
  14. DBCC ShrinkFile({LogFileName},0)
  15. GO
  16. Execute SP_ReplicationDbOption {DBName},Publish,false,1
  17. GO
Add Comment
Please, Sign In to add comment