xp_sqlmaint won't shrink DB, but dbcc will

  • Has anyone else had this problem?

    In both 7.0 and (now) 2000, when I

    use DBCC SHRINKDATABASE, I can shrink the DB itself--but when I set up a

    maintenance plan to shrink, say, weekly, for all 150+ DBs in our system, it

    uses xp_sqlmaint, which doesn't work.

    In my tests, first I try xp_sqlmaint, and it always--ALWAYS--takes just 1 second, even on large DBs. Then I run dbcc shrinkdatabase, and it shrinks.

    Even if I tell sqlmaint to leave only 1%

    free space for DBs over 1 MB (which should catch everything), it still won't

    shrink the DB proper.

    I have obtained and used the very nice script to shrink bloated log files, but this is different. If I change the SQL Server Agent job to use DBCC I won't get the benefits of xp_sqlmaint,

    like easily telling it which DBs to do (in the maintenance plan), doing more than one operation in the same job, and getting a log file (and automatically deleting old logs).

  • This was removed by the editor as SPAM

  • There is a great script for shrinking databases on this website and it works great both for SQL 7.0/2000(some changes need to be done for SQL 2000. I'm not sure where the script is right now but i have downloaded and will post it tomorrow.

  • Below is the link for a script which shrinks log.

    http://qa.sqlservercentral.com/scripts/contributions/26.asp

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

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