SQLTeam.com | Weblogs | Forums

Steps to be taken post Restrore


#1

Hi All,

Recently I developed code to delete data from sql server but due to some logical errors had to request the DBA for a database restore from a previous day's copy. I would like to know my activities as a developer post the restore i.e. do I need to update the statistics, re-build the indexes and re-compile objects. Please suggest.

Thanks in Advance


#2

HI,

Can someone please suggest

Thanks


#3

You should not have to update statistics or rebuild indexes simply because you restored. The restore operation would restore the database exactly in the same state as it was when you backed it up. So assuming you had regular maintenance plans, you would be fine without doing anything extra.

My concern would be about the changes that happened since the last backup - i.e., whether new data was added or updated that you would not have in the database. Sounds like that is not a concern in your case. If so you are all set.


#4

It sounds like you are restoring to the same location; the same server. When restoring to a different server, you may need to sync the Logins and Users. While they might have the same names, their SIDs may be different which renders the Users orphaned.


#5

Hi James,

There were NO changes done during the back-up and restore so I believe this is fine. Many Thanks for your response.

Hi Stephen,

The restore was within the same server.

But , once the DBA tried restoring the back-up from a different location but after the restore the stored procedures were running very slow. Not sure what might be the reason ?

Thanks for your help!!


#6

It may be that the hardware capabilities and configuration of the new server is different from the original server. Also, are there other processes either within SQL Server or outside of SQL Server that are competing for resources on the new server?

Although likely not the cause of slow running queries on the second server, one thing you need to be aware of is that when you restore to a different server, the users that existed in the database on the original server may not be associated with the corresponding logins on the new server. A "login" is a server level entity and a "user" is a database level entity.

You can find and fix such orphaned users using the method described here.