Attach

  • I have dettached a database and re attached but after attaching i see that some of the tables we not visible, any reason ?

    hint : I remember getting a message (not error) after attaching syaing somethign about aliases...

  • Looks like i lost so many tables in the database with the message "The dependent aliases were dropped" , how do i recover without restore the older bcakup copy.

    I am lso not finding this informational message in any of the sql logs or system event logs, I am trying to find what other databases got a message of dropping aliases during my dettach and attach.

  • Looks like not many had this kind of issues, that is interesting.

  • It looks like tables (or schemas) ownership issue. I have never had this issue, but you can try to transfer ownership to another user http://technet.microsoft.com/en-us/library/ms187359.aspx%5B/url%5D.

  • All tables had "dbo" as the owner.

  • I can't see how detach-attach would have any effect on the database. There must have been some other action that occured either before or after.

  • Hi,

    If it is fine, then try detaching the database and attache again, this time note the message that is displayed and post it. That might help finding if the issue is related to attaching the DB.

    Thank you

    [font="Verdana"]Renuka__[/font]

  • It still sounds strange to me and could not figure out actual cause. I am also planning to do this on regular basis so as to move my dev databases to production but now i am kinds not confident to do this but i have to 😉

    What precautions i can take before dettaching, could some list some admin actions to do before attaching ? like update statistics etc...

  • The best precaution is a full backup.

  • Before you detach database check which login mapped to dbo user in database, also run DBCC CHECKDB. When you detach database use @skipchecks = 'false' option to make sure statistics updated. When you attach database - specify database owner the same as it was before you detached database (using SQL Server Management Studio).

    But I never use attach DB for the databases migration. Using backup/restore is much clean way of doing this. Especially if SQL Server versions of source and destination SQL Server are different. I inherited attached databases once and there was strange issue with them constantly - file growth from time to time had changed from 1000 Kb to 1000%.

Viewing 10 posts - 1 through 9 (of 9 total)

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