How to reclaim free transaction log space in MSSQL 7?

  • Hi:

    I have a SQL Server 7 installation on WIN NT Server 4.0. There is a database transaction log file that is over 2.2GB in size. When I look at the transaction log space using Enterprise Manager in the 'Space Allocated' link for that database, it shows 25MB as used (with a blue bar) and 2140MB as free (with a purple bar), and the total as 2165MB.

    I've run this command:

    dbcc shrinkfile (MyDB_Log, 100)

    DbId   FileId CurrentSize MinimumSize UsedPages   EstimatedPages

    ------ ------ ----------- ----------- ----------- --------------

    11     2      277224      128         277224      128

    (1 row(s) affected)

    DBCC execution completed. If DBCC printed error messages, contact your system administrator.

    And the log file size remains the same after this. I've tried using the 'Shrink Database' and 'Truncate Log' options by right-clicking on the database in Enterprise Manager but no luck.

    How can the free space of 2140MB be reclaimed?

    Thanks,

    AJ.

     

     

     

  • I had this issue in 7.0 for one of my databases. Log could not be truncated and shrinked no matter what. I think it was sort of the bug in 7.0. I did not have this problem with other databases. What I did was to use sp_detach_db and sp_attach_single_file_db to re-create a fresh small log on the development server. I just left it as is on the production server before we upgraded to 2000. I don't have any problems in 2000 with the log size for this database.

    Regards,Yelena Varsha

  • You may have to reset the log pointer to the beginning by issuing dummy commands (e.g., update x to x) to the database.  This was an issue with 7.0 but not with 2000.

    http://groups.google.com/group/microsoft.public.sqlserver.programming/browse_thread/thread/100858e1aa6e98d3/3ff51dfd94808609%233ff51dfd94808609?sa=X&oi=groupsr&start=0&num=3

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply