Attach big database

  • Could someone please let me know how long it will take to attach a database whose size is aournd 75 gb. both mdf and ldf of the databse is located in the E drive of the server. I need to attach the database in the same server.

    Thanks

  • Attaching a database should only take a couple of seconds no matter how large the database. Since the actual datafile already exists all which needs to be done is updating a couple of system tables like sys.databases.

    [font="Verdana"]Markus Bohse[/font]

  • Hey,

    This should only takes a few seconds, as primarily adding a reference in the master database about file locations and database name.

    Thanks,

    Phillip Cox

    MCITP - Database Administrator|MCTS - SQL Server 2005|MCP - SQL Server 2000

  • With a couple of exceptions:

    1) if the database was from a prior version of SQL Server and direct upgrade is supported to 2005, then all the upgrade steps need to be run on the database during the attach. This can add a bit of time as the various metadata changes are made to the database (metadata was rewritten completely for 2005)

    2) if the database was not cleanly shutdown when it was detached (e.g. if the server crashed and there were a lot of long-running transactions that were active at the time of the crash). In that case, crash recovery will be run on the database when it is attached to the server - that could take a long time depending on how much recovery is needed.

    If neither of these are the case, then Markus and Philip are correct.

    Thanks

    Paul Randal
    CEO, SQLskills.com: Check out SQLskills online training!
    Blog:www.SQLskills.com/blogs/paul Twitter: @PaulRandal
    SQL MVP, Microsoft RD, Contributing Editor of TechNet Magazine
    Author of DBCC CHECKDB/repair (and other Storage Engine) code of SQL Server 2005

  • Thanks for the valuable comments.

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

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