dbcc shirnkfile utility

  • I am attempting to remove free space from a database and yet to be successfull. I have attempted other methods but having diffculty.

    Here is the script:

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

    USE capturetrack

    GO

    DBCC SHRINKFILE (ct_dat, 10000)

    GO

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

    The following error comes back after 30 minutes of execution:

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

    Server: Msg 5042, Level 16, State 3, Line 1

    The file 'CT_dat' cannot be removed because it is not empty.

    Server: Msg 3140, Level 16, State 1, Line 1

    Could not adjust the space allocation for file 'CT_dat'.

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

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

    The database size is as following:

    used/free

    data 7076.063/6163.63

    log 65.21/38.6

    Thanks.

  • try to backup the file i.e database or log and then run shrinkfile. Try it couple of time as it might not succeed the very 1st time.

  • Are you running SQL Server 7.0 and service pack is below sp3? If it is, Read KB article at http://support.microsoft.com/default.aspx?scid=kb;en-us;254253. It was a SQL Server bug.

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

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