uncategorized

還原DB發生Cannot execute as the database principal because the principal "dbo" does not exist...

今天把某台的DB Server中的資料庫還原到另一台DB Server時候,發生這樣的訊息

Cannot execute as the database principal because the principal “dbo” does not exist, this type of principal cannot be impersonated, or you do not have permission

想說平常做備份還原都沒有遇到這問題,怎這次會遇到這樣問題,查了一下還原DB Log,並未發現甚麼錯誤,那樣到底是哪邊出問題

原來是DB Owner不見了,會發生這問題我猜想因該是因為不同台的DB Server內的帳號是不一致,導致還原DB到這台主機時候,找不到原先DB Owner,這時候只要重新給一個DB Owner帳號就可以囉