none
how to remove log files RRS feed

All replies

  • You can not remove a log file, which are in use. If you have multiple log file, you have to clear them before you drop it.

    And every database must have at least one log file, it's not possible to remove all. A log file is mandatory.


    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    • Proposed as answer by Tom Phillips Monday, August 12, 2019 5:52 PM
    Monday, August 12, 2019 12:03 PM
  • Hi ajit,

    The transaction log is a critical component of the database. If there is a system failure, you will need that log to bring your database back to a consistent state. As Olaf mentioned, every database must have at least one log file.  I am so strange the reason that you want to remove log files.  Could you please share us the reason?

    By the way, for Deleting Data or Log Files from a Database, a file must be empty before it can be deleted.

    Best regards,
    Cathy Ji

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to  MSDN Support, feel free to contact MSDNFSF@microsoft.com



    Tuesday, August 13, 2019 1:32 AM
  • hi cathy ji

    Actually I don't have more space that is the main reason I want to move log file but there is issue is every database we have single log file.

     so pls suggest me......

    Tuesday, August 13, 2019 4:51 AM
  • but there is issue is every database we have single log file.

    I don't understand why this is an issue?

    You can move a trans log file with detach/move/attach database (files) or with backup&restore, see Move Database Files


    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    Tuesday, August 13, 2019 5:50 AM
  • hi cathy ji

    Actually I don't have more space that is the main reason I want to move log file but there is issue is every database we have single log file.

     so pls suggest me......

    Hi ajit,

    From your description, it seems you can’t remove the log files.  

    >> I want to move log file 

    Did you want to move database log files to other drive to get more space?  Please refer to How to Move SQL Server MDF and LDF Files? If I misunderstood, please let me know.

    Best regards,
    Cathy 


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to  MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Tuesday, August 13, 2019 8:07 AM