PDA

View Full Version : انتقال دیتابیس به یک سیستم دیگر



mahdi68
سه شنبه 19 بهمن 1389, 20:27 عصر
سلام
آیا امکان داره دیتابیسی که با SQL Server Management studio ایجاد کردیم انتقال بدیم به یک سیستم دیگه و در اون سیستم روش کار کنیم ؟ چطوری میتونم این کار بکنم ؟
متشکرم

حمیدرضاصادقیان
سه شنبه 19 بهمن 1389, 21:04 عصر
سلام.
شما هم میتوانید دیتابیس رو Detach کرده و فایلهای mdf,ldf رو منتقل کنید.هم میتوانید از دیتابیس backup تهیه کرده و در سیستم مقصد اونو restore کنید.

mahdi68
سه شنبه 19 بهمن 1389, 22:23 عصر
من در منو درختی روی دیتابیس کلیک راست کردم و از Task >>Detach زدم که دیتابیسم از لیست درختی حذف شد ! چجوی میتونم به حالت اولیه برگردونم ؟
متشکرم

m.soleimani
سه شنبه 19 بهمن 1389, 23:27 عصر
دوباره attach‌ش کن


To attach a database





In SQL Server Management Studio Object Explorer, connect to an instance of the Microsoft SQL Server Database Engine, and then expand that instance.

Right-click Databases and click Attach.

In the Attach Databases dialog box, to specify the database to be attached, click Add; and in the Locate Database Files dialog box, select the disk drive where the database resides and expand the directory tree to find and select the .mdf file of the database; for example:

C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\Adventure Works2008R2_Data.mdf
http://i.msdn.microsoft.com/Hash/030c41d9079671d09a62d8e2c1db6973.gif Important Trying to select a database that is already attached generates an error.


Optionally, to specify a different name for the database to attach as, enter the name in the Attach as column of the Attach Databases dialog box.

Optionally, change the owner of the database by selecting a different entry in the Owner column.

When you are ready to attach the database, click OK.
http://i.msdn.microsoft.com/Hash/030c41d9079671d09a62d8e2c1db6973.gif Note A newly attached database is not displayed in the Databases node of Object Explorer until the view is refreshed. To refresh the view at any time, click in Object Explorer, and then click Refresh on the View menu.