Restore a database backup file with a suffix named. bak

Source: Internet
Author: User
Tags microsoft sql server management studio sql server management sql server management studio

1. Open SQL Server Management Studio and right-click a database Selection task---Restore--database


4. In the pop-up window, select the device in the source option--point to select the device--point and then select your backup file name--Add a point to return, this time the device bar should appear the database backup file name you just selected. The backup number defaults to 1 (if you have made multiple backups of the same file, click View next to the backup number, select the most recent backup after the check box)-and then click the option button next to the general
5. In the window that appears, select overwrite the existing database and select Restore with RECOVERY in the recovery state (the database is in a state that can be used by rolling back uncommitted transactions.) Cannot restore other transaction logs). In the middle of the window to restore the database file to be set up in accordance with your SQL installation (you can also specify your own directory), the logical file name does not need to change, move to the physical file name to be based on the machine you have recovered changes, such as your SQL database installed in D:\Program files\ Microsoft SQL Server\MSSQL\Data, then make changes to your recovery machine's directory, and the last file name is best changed to your current database name (as originally Bbs_ Data.mdf, now the database is forum, change to forum_data.mdf), log and data files to do the same way to do the relevant changes (log file name is *_ Log.ldf end of the), here the recovery directory you can freely set, provided that the directory must exist (if you can specify D:\sqldata\bbs_data.mdf or d:\sqldata\bbs_log.ldf), or recovery will be error
6, after the completion of the modification, click on the following to determine the recovery, after the system will automatically prompt success, such as the middle prompt error, please record the relevant error content and ask people familiar with the SQL operation, The general error is nothing more than a directory error or file name duplication or file name error or insufficient space or the database is in use error, the database is in use of the error you can try to close all about the SQL window and then reopen for recovery operations, If you are also prompted for an error that you are using to stop the SQL service and then restart it, the other errors described above can be restored after making the appropriate changes to the error content.

Restore a database backup file with a. bak suffix

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.