Restore a database using SQL Server

Source: Internet
Author: User

Restore database

Enterprise Manager

-- Right-click "Database"

-- All tasks

-- Restore database

-- Enter the restored database name in "Restore to Database"

-- Restore select "from device" -- select device -- add your backup file -- OK, and return to the database restoration page.

-- Backup number -- Select Content -- select the backup content you want to restore

-- Option -- change the physical file name in "move to physical file name" to the name of the data file to be stored.

-- If the database to be restored already exists, select "qz restore on the existing database "-

-OK

-- Or use an SQL statement:

Restore database from disk = 'C: \ your Backup Filename'

Restore database

Operations in Enterprise Manager:

1. Complete recovery

Enterprise Manager -- Right-click "Database" -- all tasks -- Restore database

-- Enter the restored database name in "Restore to Database" and set it to test.

-- Restore select "from device" -- select device -- add your backup file

-- OK. Return to the database restoration page.

-- "Restore backup set", select "database -- full"

-- Option -- change the physical file name in "move to physical file name" to the name of the data file to be stored.

-- If the database to be restored already exists, select "qz restore on the existing database"

-- "Recovery completed", select "make the database no longer run, but can restore other transaction logs"

-- OK

-- Or use an SQL statement:

Restore database from disk = 'C: \ your full Backup Filename 'with norecovery

2. Restore the difference

Enterprise Manager -- Right-click "Database" -- all tasks -- Restore database

-- In "Restore to Database", select database name: test.

-- Restore select "from device" -- select device -- add your backup file

-- OK. Return to the database restoration page.

-- "Restore backup set", select "database -- difference"

-- "Recovery completed", select "make the database no longer run, but can restore other transaction logs"

-- OK

-- Or use an SQL statement:

Restore database from disk = 'C: \ your differential Backup Filename 'with norecovery

3. Log Recovery

Enterprise Manager -- Right-click "Database" -- all tasks -- Restore database

-- In "Restore to Database", select database name: test.

-- Restore select "from device" -- select device -- add your backup file

-- OK. Return to the database restoration page.

-- "Restore backup set", select "transaction log"

-- "Restore completed", select "enable database to continue running, but cannot restore other transaction logs"

-- OK

-- Or use an SQL statement:

Restore log database from disk = 'C: \ your log Backup Filename 'with recovery

-- Detailed steps to solve the problem of restoring database directories:

1. Methods in Enterprise Manager:

-- Right-click "Database"

-- All tasks

-- Restore database

-- Enter the restored database name in "Restore to Database"

-- Restore select "from device" -- select device -- add your backup file -- OK, and return to the database restoration page.

-- Backup number -- Select Content -- select the backup content you want to restore

-- Option -- change the physical file name in "move to physical file name" to the name of the data file to be stored.

-- If the database to be restored already exists, select "qz restore on the existing database "-

-OK

2. Use the SQL statement (assume that your backup file name is c: \ xx. bak

-- List logical file names in backup files

Restore filelistonly from disk = 'C: \ xx. Bak'

-- Restore with the Statement. Use the move option based on the Logical file name listed above.

Name of the database after the restore database is restored

From disk = 'C: \ xx. Bak'

With move 'logical data file name 1' to 'C: \ physical data file name 1'

, Move 'logical data file name 2' to 'C: \ physical data file name 2'

...

, Move 'logical data file name n' to 'C: \ physical data file name N'

There is nothing to pay special attention to, and the backup/restoration between the Enterprise Edition should pay attention to the same thing:

1. Pay attention to the Backup Settings. do not specify multiple backup files. Otherwise, you must specify multiple backup files during restoration.

2. Pay attention to the backup media processing method. Rewrite it instead of append it. Otherwise, you must specify the backup number during restoration.

3. Pay attention to the backup method. Use full backup instead of other backup methods. Otherwise, other backup files will be supported during restoration.

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.