個人檔案Blogs部落格清單 工具 說明
3月7日

SQL Server Management Studio: Copy Database

When you right click any Database in the SSMS, you can access the Copy Database tool:

CopyDataBase

This feature easily allows you to copy or move a database from one server to another or within one server.

But before you can do this you need to ensure the following conditions:

  • SQL Server Agent service must be running on the destination server
  • SQL Server Integration Services service must be running on the destination server
  • These services must be running with an account that has at least sysdbadmin rights on the target sql server.
  • The source database must not have an owner that is a local account to the source server (e.g. LocalServer1\Tom),
    otherwise the transfer will fail. If it is associated with a local account, change the owner, for instance to sa.

Services

After the prerequisites are confirmed, you can launch the Copy Database wizard. There are currently two ways to copy or move the database:

  1. Use the detach and attach method
  2. Use the SQL Management Object Method

 

Use the SQL Management Object Method

1) is significantly faster but requires a share on the target server and a configured Integration Services Proxy Account on the target server. So the easiest way to copy the source is method 2).

After some view steps in the wizard, you reach the Select Server Objects page where Logins are preselected:

SSO

Copying the Logins is not necassarily required unless you have granted some rights to specific logins, so in some cases you can remove the Logins from the Selected related objects list. in some cases.

 

 

Use the detach and attach method

 

If you decide to use this method to copy or move a database, before you can archive this, you need to create a Credential and a Proxy for the SSIS Package Execution in the SQL Server Agent:

To create a credential that will be later associated to the proxy open Server/Security/Credential and right click to open the popup menu where you select New Credential:

NewCredential

The New Credential Dialog is self explanatory so just configure the required values.

Now you can create a  Proxy:

 

Proxy

In the dialog select a proxy name of your choice and as Credential name select the previously created credential. Select at least “SQL Server Integration Services Package” and that’s it:

ProxyDlg

回應

請稍候...
很抱歉,您輸入的回應過長。請縮短您的回應。
您尚未輸入內容,請再試一次。
很抱歉,目前無法新增您的回應,請稍後再試。
若要新增回應,您的父母必須先給您權限。要求權限
您的家長已關閉回應功能。
很抱歉,目前無法刪除您的回應,請稍後再試。
您已超過每日回應上限次數,請於 24 小時後再試一次。
由於系統顯示您可能傳送垃圾郵件給其他使用者,因此您帳號中的回應功能已遭停用。 如果您認為自己帳號遭錯誤停用,請連絡 Windows Live 支援
請完成下列安全檢查,以完成回應。
您輸入的安全檢查字元必須與圖片或音訊中的字元相符。

若要新增回應,請以您的 Windows Live ID 登入 (若您使用 Hotmail、Messenger 或 Xbox LIVE,則您已擁有 Windows Live ID)。登入


沒有 Windows Live ID?註冊

引用通告

此內容的引用通告是:
http://thomasgerber.spaces.live.com/blog/cns!58B30559C82E269C!695.trak
引述這則內容的部落格