การ Restore ข้อมูล

คลิกขวาที่ mydatabase -> Tasks -> Restore -> Database

เลือกจาก Database Backup หรือ โฟเดอร์ที่ได้ทำการระบุไว้

ทำการคลิกที่ Add เพื่อ Browse เลือกไฟล์ที่ได้ทำการ Backup ไว้

เลือก Record ทีได้ Backup ไว้

เลือก Option กรณีที่ต้องการให้ Replace Database ตัวที่มีอยู่

โปรแกรมทำการ Restore เรียบร้อย
การ Restore ข้อมูลทั้งก้อน หลังจากทีได้ Copy mydatabase.mdf,mydatabase_log.ldf ไว้แล้ว ให้ทำการ Copy กลับไปยังโฟเดอร์ C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQL2008\MSSQL\DATA\ ในกรณีที่มี Database เดิมอยู่แล้วให้ทำการลบทิ้งก่อนครับ

Copy mydatabase.mdf และ mydatabase_log.ldf ไปไว้ที่เดิม

คลิกขวาที่ Database -> Attach

เลือก Add

เลือก Database โดยเลือก mydatabase.mdf

โปรแกรมจะแสดงรายละเอียดของ Database ที่ต้องการ Restore เลือก OK

แสดง mydatabase ซึ่งข้อมูลจะยังอยู่ครบทุกอย่าง และเหมือนกับข้อมูลที่ได้ Backup ไว้ในขั้นตอนการ Backup ทุกประการครับ
ref : http://www.thaicreate.com/tutorial/sqlserver-2008-backup-restore.html
No comments:
Post a Comment