The log file for database is full

后端 未结 12 828
时光取名叫无心
时光取名叫无心 2021-02-08 17:15

So our SQL Server 2000 is giving me the error, \"The log file for database is full. Back up the transaction log for the database to free up some log space.\"

How do I go

相关标签:
12条回答
  • 2021-02-08 17:40

    If it's a non production environment use

    dump tran <db_name> with no_log;
    

    Once this has completed shrink the log file to free up disk space. Finally switch database recovery mode to simple.

    0 讨论(0)
  • 2021-02-08 17:43

    You may want to check related SO question:

    • How do you clear the transaction log in a SQL Server 2005 database?
    0 讨论(0)
  • 2021-02-08 17:43

    Well you could take a copy of the transaction log, then truncate the log file, which is what the error message suggests.

    If disk space is full and you can't copy the log to another machine over the network, then connect a drive via USB and copy it off that way.

    0 讨论(0)
  • 2021-02-08 17:53

    Rename it it. eg:
    old-log-16-09-08.log

    Then the SQL server can use a new empty one.

    0 讨论(0)
  • 2021-02-08 17:54

    To just empty it:

    backup log <dbname> with truncate_only  
    

    To save it somewhere:

    backup log <dbname> to disk='c:\somefile.bak'
    

    If you dont really need transactional history, try setting the database recovery mode to simple.

    0 讨论(0)
  • 2021-02-08 17:54

    ether backup your database logs regularly if you need to recover up to the minute or do other fun stuff like log shipping in the future, or set the database to simple mode and shrink the data file.

    DO NOT copy, rename, or delete the .ldf file this will break your database and after you recover from this you may have data in an inconsistent state making it invalid.

    0 讨论(0)
提交回复
热议问题