Thursday, August 18, 2011

BACKUP AND RESTORE A DATABASE

The following are the steps for backup and restoring a database.

BACKUP A DATABASE:
Step: 1 Take a database you want to make a backup. Suppose the name is Example.dbo
Step: 2 Right click on the Example database go to tasks go to backup source is the same Example. In the destination, remove the already selected destination. Then click add click browse. Type the file name you need to make as a backup file. Suppose ExampleBackUp.bak is my backup file. .bak is must.
Step: 3 Click ok then ok then ok. If everything is fine, you will be seen a message like database Example is successfully restored.
Step: 4 Now there is a backup for your database Example.dbo

RESTORE A DATABASE:
Now if you need to restore the database for which you have took a backup. The following steps needed to be followed.
Step: 1 Right click on databases, click restore database.
Step: 2 Type the database name you need to be restored as Example in the destination. On the source, click from device then browse click add. Then in the backup list, you will be made visible with the name with which you have taken the backup of your database. In this example, I have taken my database name as ExampleBackUp.bak it is visible in the list. Click that. Click ok. Again click ok.
Step: 3 Now, in the Select the backup sets to restore, tick the Restore check box.
Step: 4 Finally, click ok.
Now click refresh. Expand the databases, you can find your database along with your tables.

2 comments: