detaching and attaching databases | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

detaching and attaching databases

What are the points which should be kept in mind while detaching and attaching databases.

Make sure you have a good back up copy of the database you are trying to detach..
DETACH and ATTACH are pretty smooth… I don’t think you will have any problems… Venu
while detaching databse make sure no transaction is active.
Always detach databse with presupplied SPs i.e. sp_detach_db. Same points while attaching i.e. attach it with sp_attach_db or
sp_attach_single_file_db if u have just the mdf file.
Run update statistics on all the table.
Also run dbcc checkdb after attching.
Access the db from applications and other machines to make sure that
the db is connected properly.
While detaching a db by EM,should we check the checkbox "update statistics prior to detach’ for a db which is for both read and write purpose
hi aaronsandy,
i feel its better to run update space usage and update statistics manually under QA and then detach the db.
Why? MeanOldDBA
[email protected] When life gives you a lemon, fire the DBA.
]]>