Database backup file Restore method

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

Database backup file Restore method

Jason.lin 2017-11-10 Friday

Work for several years, and now found that the previous period of time encountered problems of the solution recently often remember, and have to re-query the solution, time-consuming and laborious, have been thinking to do a blog record these methods, convenient to remind themselves, while now mention the resignation time more ample time, decided from now to pick up the blog this piece. The following no nonsense, began the first essay!

I. Description of the situation

Now in the process of finishing the handover work, in the course of a long time to see the former colleague left behind the code, decided to rethink the idea, He used. NET to build a simple web framework, with the use of databases and login Web pages, because a long time ago, the need to set up a database on this machine, find a half-day only found a mes_2017022201115 file, no other information.

Ii. Solutions

To view the relevant files of the project, at least there is a suspected database backup files ...

The first step, I opened the file with a text editor, found the content as shown, the file starts with tape, and contains the word Microsoft SQL Server RAID, Baidu query found that there is an explanation may be "SQL Server database tape backup files."

Figure1 text Editor opens mes_2017022201115 first line

Second, try opening this mes_2017022201115 file to see if there is any valid information, then go to the MSDN website https://docs.microsoft.com/, search for "View database tape backup" in SQL and learn that using the restore The HEADERONLY statement gets the backup database information as shown, changing the path to the path of our file, and the database information appears after the run.

Figure2 View Database disk backup file SQL statement

FIGURE3 View Database disk backup file results

The third step, this step is clear, we take the file as a backup file, restore the MES database can, here reference Lionden "

Backup and restore of SQL Server 2008 database (go To) "( reprint This blog), paste it here and no longer do the duplication of work



First, SQL Backup of the database :

1. Open Start menu → program →microsoft SQL Server 2008→SQL server Management studio→ database: dsideal_school_db is the database of students we need to back up

Figure (1)

2, select the database to be backed up "dsideal_school_db", right click → tasks → backup, (2):

Figure (2)

3. In the "Backup Database-dsideal_school_db" dialog box that opens, click Delete, then click "Add", (3):

Figure (3)

4. In the "Select Backup Destination" dialog box that pops up, (4)

Figure (4)

5, choose the path of the backup (such as the "D" Jiangxi-student-database backup folder), file type select "All Files", "file name" that location fill in the name of the database you want to back up (preferably after the name of the database you backed up with a date to facilitate later search), followed by a continuous click "OK" button to complete the backup operation of the database, (5):

Figure (5

Second, SQL Restoring the database :

1. Select the database you want to restore "dsideal_school_db", right click → tasks → restore → database, (6):

Figure (6)

2. In the "Restore Database-school_web_db" dialog box that appears, select "Source Device", and then click on the "..." button later, (7):

Figure (7)

3. In the "Specify Backup" dialog box that appears, click the "Add" button, (8):

Figure (8)

4, find the path of the database backup, select the database you want to restore "dsideal_school_db" (Note: File type Select all files), and then " two times " click the "OK" button, (9):

Figure (9)

5. In the "Restore Database-dsideal_school_db" dialog box that appears, tick the check box before "Select the database under user restored backup set" (10)

Figure (10)

6. Then select "Option", tick "Overwrite existing database", (11):

Figure (11)

Third, restore the database problem solution

When restoring the database "dsideal_school_db", sometimes you will encounter the problem "because the database is in use, so you cannot gain exclusive access to the database", we can follow the following steps to resolve this problem

1. Right-click the database "dsideal_school_db" and select "Properties", as

2. In the Database Properties-dsideal_school_db dialog box that appears, select options, and in status under Other options, locate restrict access. Select "Single_user" and click "OK" button, such as:

3, follow the normal restore database steps, restore the database.

Database backup file Restore method

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.