已答覆 Free up log space

  • Wednesday, May 02, 2012 5:19 PM
     
     

    OS: Windows Server 2003 SP2 R2 Enterprise

    SQL Server: 2008 R2 Enterprise

    Database: Simple Recovery Mode

    I am trying to free up log space from a database. But, I am unable to. select log_reuse_wait, log_reuse_wait_desc from sys.databases returns 6 and 'REPLICATION'. The Database ID for this database is 6 but there is no REPLICATION set up. I was wondering how I could bring log_reuse_wait_desc from REPLICATION to NOTHING, and then run, dbcc shrinkfile(log, 1000)

    What I have tried:

    1. DBCC SHRINKFILE (Database_log, NOTRUNCATE)
    2. DBCC SHRINKFILE (Database_log, TRUNCATEONLY)
    3. DBCC SHRINKFILE (Database_log, 1000)
    4. sqlperf(logspace) returns 94% log space used

    I could try attach and detach of database as the last step. But, wanted to find out if there are other ways to release log space.

    Thank you.

    -Jeelani

All Replies