Optimization job

  • we have very critical databases running n 24/7 production environment. I want

    to set optimization job (Reorganize data/index pages AND Remove unused space

    from database files)

    Whats the impact on the system if I set these optimization jobs? During

    these jobs, will application slow or performance down?

  • Don't run the 'remove unused space' task. If you run that after rebuilding indexes, it'll result in worse fragmentation than before the rebuild. No reason to shrink a database.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • This is what I have for all my db accept system:

    EXECUTE master.dbo.xp_sqlmaint N'-PlanID 05C26610-E745-4EF0-9788-D7CCB8A02939 -Rpt "E:\MSSQL\LOG\SAVVIS Full Recovery Model DB Maintenance Plan0.txt" -WriteHistory -RebldIdx 10 -RmUnusedSpace 50 10 '

    This is for system:

    EXECUTE master.dbo.xp_sqlmaint N'-PlanID AE8C432A-46CF-4BEF-8873-A483AFADE908 -WriteHistory -RebldIdx 10 -RmUnusedSpace 50 10 '

    What do I need to change it?

    Thank you

  • Don't use the remove unused space option. Go into the maintenance plan designer and remove that task.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Do I need to remove for both system and all databases? What happend in future if I remove this option and why do I need to remove it? Thank you

  • Why No reason to shrink a database? what happens web online when this happens?

  • Would something like ‘Torn Pages’ be detected or handled by the optimization job?

  • No. That would be the data integrity task.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • How, do you know that? I want to know which db changes to 0 status, which to 16 and maybe change options. Thank you

  • Krasavita (7/15/2009)


    How, do you know that?

    How do I know what?

    The database integrity task is a DBCC CheckDB, so it will detect any torn pages, among other corruptions if present.

    I want to know which db changes to 0 status, which to 16 and maybe change options.

    None of the maintenance plans are going to change the database options. Only an explicit ALTER DATABASE statement issued by one of the admins is going to do that.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Will any torn pages on, can cause locking when running integrity job?

  • Also,Integrity job swowing in lSQLogs that ran as DBCC CheckDB,but optimization ran in job history I see and not showing in logs, why is that?

  • CheckDB doesn't take locks regardless of what database options are on or off. The point of torn pages, which you would know if you'd read the link I provided for you in another thread, is all about detecting partial writes if there's a problem with the IO subsystem. If it's not on, you risk not being able to detect (and fix) corruption if it occurs.

    As for your second question, because CheckDB writes results into the error log no matter how it's run. Index rebuilds don't write results into the error log regardless of how they're run. It's got nothing to do with the maint plans themselves.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Thank you

Viewing 15 posts - 1 through 14 (of 14 total)

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