Update Statistics and Backup

  • Is it better to run a full backup before or after Updating Statistics?

  • If you are planning to use the back up in QA then I would suggest before. Then the QA does not need to do a Update stats. I have not seen any performance impact on back up or update stats based on the order.

    -Roy

  • jbrewer (11/23/2011)


    Is it better to run a full backup before or after Updating Statistics?

    I am kind of curious on what all information SQL Server Backup stores. Because I know in Oracle, when you backup you can backup related statistics as well. Thus update stats before backup makes sense there. Not sure on SQL Server.

    I was trying to find in BOL. No luck so far.

  • It seems they work independently.

    Does a database backup/restore update statistics?

    http://sqlserverpedia.com/blog/sql-server-backup-and-restore/does-a-database-backuprestore-update-statistics/

  • Thanks:-)

  • Dev (11/23/2011)


    jbrewer (11/23/2011)


    Is it better to run a full backup before or after Updating Statistics?

    I am kind of curious on what all information SQL Server Backup stores. Because I know in Oracle, when you backup you can backup related statistics as well. Thus update stats before backup makes sense there. Not sure on SQL Server.

    Oracle backup would *always* backup performance statistics - same as SQL Server does.

    What you can do using the proper DBMS_ Oracle package is to take a Performance Statistics "backup" and "restore" it as it pleases you but this is NOT a database backup at all.

    _____________________________________
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at Amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
  • What you can do using the proper DBMS_ Oracle package is to take a Performance Statistics "backup" and "restore" it as it pleases you but this is NOT a database backup at all.

    I lost you man... What do you mean?

  • Dev (11/23/2011)


    What you can do using the proper DBMS_ Oracle package is to take a Performance Statistics "backup" and "restore" it as it pleases you but this is NOT a database backup at all.

    I lost you man... What do you mean?

    I mean you can "backup" the performance stats of a particular table then re-apply these performance stats to the same table or to a different version of it like on development or UAT.

    _____________________________________
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at Amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
  • PaulB-TheOneAndOnly (11/23/2011)


    Dev (11/23/2011)


    What you can do using the proper DBMS_ Oracle package is to take a Performance Statistics "backup" and "restore" it as it pleases you but this is NOT a database backup at all.

    I lost you man... What do you mean?

    I mean you can "backup" the performance stats of a particular table then re-apply these performance stats to the same table or to a different version of it like on development or UAT.

    That is a different utility all together. It's designed only for Stats backup. I am talking about regular backups. Even regular backups store stats information which can be restored with regular restore operations.

  • I am trying hard to find one article which says "SQL Server backup preserves stats as well". There is no switch in backup command for stats (if I would like to switch it off).

    p.s. I refer to STATISTICS when I say 'stats'. This clarification is required because Backup Command has STATS switch for STATUS.

  • As far as I know when a Back up is done, it preserves the Stats as well.

    -Roy

  • Roy Ernest (11/23/2011)


    As far as I know when a Back up is done, it preserves the Stats as well.

    Can you please lead me to some evidence? (Curiosity kills the cat but I can't refrain from that :-D)

  • Roy Ernest (11/23/2011)


    As far as I know when a Back up is done, it preserves the Stats as well.

    I would be very surprised of the contrary.

    @dev: try it yourself: backup a database, restore it and see that stats are preserved.

    -- Gianluca Sartori

  • Dev (11/23/2011)


    Roy Ernest (11/23/2011)


    As far as I know when a Back up is done, it preserves the Stats as well.

    Can you please lead me to some evidence? (Curiosity kills the cat but I can't refrain from that :-D)

    Not an official MSDN page, but still a good reference:

    http://sqlserverpedia.com/blog/sql-server-backup-and-restore/does-a-database-backuprestore-update-statistics/

    -- Gianluca Sartori

  • Gianluca Sartori (11/23/2011)


    Roy Ernest (11/23/2011)


    As far as I know when a Back up is done, it preserves the Stats as well.

    I would be very surprised of the contrary.

    @dev: try it yourself: backup a database, restore it and see that stats are preserved.

    If I could... I would :-D(courtesy: Rocky Balboa)

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

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