none
How to delete .ldf Log file in SQL Server2008?

    Question

  • Hi,
    There is a database named as flw in SQL Server 2008. We need to delete its .ldf log file. After deleting this log file,this database needs to still be used normally. And if this database is reduced into SQL Server 2008 through its .bak file in future, its .ldf log file will need not to be produced any more.
    How can I finish the aboved requirements in SQL Server 2008?
    Thanks in advance.

    QQ
    Saturday, November 12, 2011 8:12 AM

Answers

  • Hi,
    There is a database named as flw in SQL Server 2008. We need to delete its .ldf log file. After deleting this log file,this database needs to still be used normally. And if this database is reduced into SQL Server 2008 through its .bak file in future, its .ldf log file will need not to be produced any more.
    How can I finish the aboved requirements in SQL Server 2008?
    Thanks in advance.

    QQ

    You absolutely can not delete the log file for the database permanently and you should NEVER delete the file because it provides the transactional consistency for the database.  Deleting the log file can result in complete loss of the database if the database was not cleanly shutdown.

    I think you need to spend some time learning about the logging and recovery process for SQL Server.  If you are properly managing you log file, it should never be a problem.

    http://technet.microsoft.com/en-us/magazine/2009.02.logging.aspx

    If you want to go a non-logged route, SQL Server isn't for you, and you need to look at one of the NOSQL solutions out there, but keep in mind, you don't get all of the ACID properties with those.


    Jonathan Kehayias | Principal Consultant, SQLSkills.com
    SQL Server MVP | Microsoft Certified Master: SQL Server 2008
    Author of Troubleshooting SQL Server: A Guide for Accidental DBAs
    Feel free to contact me through My Blog or Twitter. Become a SQLskills Insider!
    Please click the Mark as Answer button if a post solves your problem!


    Saturday, November 12, 2011 2:36 PM
    Moderator

All replies

  •  

    You should not delete any of the database files it will damage your database.

    If you are running out of Disk Space you can Shrink the log file.


    Nag Pal MCTS/MCITP (SQL Server 2005/2008) :: Please Mark Answer/vote if it is helpful ::
    Saturday, November 12, 2011 9:04 AM
  • Hi,
    There is a database named as flw in SQL Server 2008. We need to delete its .ldf log file. After deleting this log file,this database needs to still be used normally. And if this database is reduced into SQL Server 2008 through its .bak file in future, its .ldf log file will need not to be produced any more.
    How can I finish the aboved requirements in SQL Server 2008?
    Thanks in advance.

    QQ

    You absolutely can not delete the log file for the database permanently and you should NEVER delete the file because it provides the transactional consistency for the database.  Deleting the log file can result in complete loss of the database if the database was not cleanly shutdown.

    I think you need to spend some time learning about the logging and recovery process for SQL Server.  If you are properly managing you log file, it should never be a problem.

    http://technet.microsoft.com/en-us/magazine/2009.02.logging.aspx

    If you want to go a non-logged route, SQL Server isn't for you, and you need to look at one of the NOSQL solutions out there, but keep in mind, you don't get all of the ACID properties with those.


    Jonathan Kehayias | Principal Consultant, SQLSkills.com
    SQL Server MVP | Microsoft Certified Master: SQL Server 2008
    Author of Troubleshooting SQL Server: A Guide for Accidental DBAs
    Feel free to contact me through My Blog or Twitter. Become a SQLskills Insider!
    Please click the Mark as Answer button if a post solves your problem!


    Saturday, November 12, 2011 2:36 PM
    Moderator