Optimization SQL Commands

  • what are the SQL Commands used by the optimization section of the maintenance plan?

    specifically to "reorganize data and index pages" and to "remove unused space from the database"

    your help or leads are greatly appreciated.

    thanks,

    Les

  • You can rebuild indexes with DBCC INDEXDEFRAG OR DBCC DBREINDEX

    Shrinking parts of the database can be done with DBCC SHRINKFILE

  • One way to find out (I think) is to run Profiler [capturing certain information] during the time this maintenance plan runs ...

  • the maintenance plan runs a dbcc dbreindex for all user tables with the free space set to whatever you specify. If you set reporting tab to log to a file you can see what it does in the logfile it produces

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

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

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