SQL Server Restore Database operations

Source: Internet
Author: User
Tags backup

Restore Database

Enterprise Manager

--Right Key "database"

--All Tasks

--Restore Database

--"Revert to Database Library" to enter the restored database name

--Restore Select "From Device"--Select device--add--Add your backup file--OK, back to database restore interface

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

--option--modifies the physical file name in "Move to physical file name" to the file name to be stored in your data file

--If the database you want to restore already exists, select QZ Restore on existing database-

-Determine

--or with SQL statements:

Restore database databases from disk= ' C: your backup filename '

Restore Database

Actions in Enterprise Manager:

1. Perform a full recovery

Enterprise Manager--right--"database"--All tasks--Restoring a database

--"Restore to Database Library" Enter the restored database name, set to: Test

---Restore Select "From Device"--Select device--add--Add your backup file

--OK, back to the database restore interface

--"Restore Backup Set", select "Database-Full"

--option--modifies the physical file name in "Move to physical file name" to the file name to be stored in your data file

--Select "QZ Restore on Existing database" If the database you are restoring already exists

--"Restore completion status", select "Make database no longer running, but can restore additional transaction log"

-Determine

--or with SQL statements:

Restore database databases from disk= ' C: Your full backup filename ' with NORECOVERY

2. Differential recovery

Enterprise Manager--right--"database"--All tasks--Restoring a database

--"Restore to Database Library" Select Database name: Test

---Restore Select "From Device"--Select device--add--Add your backup file

--OK, back to the database restore interface

--"Restore Backup Set", select "Database-diff"

--"Restore completion status", select "Make database no longer running, but can restore additional transaction log"

-Determine

--or with SQL statements:

Restore database databases from disk= ' C: Your differential backup file name ' WITH NORECOVERY

3. Log Recovery

Enterprise Manager--right--"database"--All tasks--Restoring a database

--"Restore to Database Library" Select Database name: Test

---Restore Select "From Device"--Select device--add--Add your backup file

--OK, back to the database restore interface

--"Restore Backup Set", select "Transaction log"

--"Restore completion status", select "Make database can continue to run, but cannot restore other transaction log"

-Determine

--or with SQL statements:

Restore log database from disk= ' C: Your log backup file name ' with recovery

--Resolve the detailed steps to restore the database directory incorrectly:

1. Methods in Enterprise Manager:

--Right Key "database"

--All Tasks

--Restore Database

--"Revert to Database Library" to enter the restored database name

--Restore Select "From Device"--Select device--add--Add your backup file--OK, back to database restore interface

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

--option--modifies the physical file name in "Move to physical file name" to the file name to be stored in your data file

--If the database you want to restore already exists, select QZ Restore on existing database-

-Determine

2. Using the SQL statement method (assuming your backup file is named: C:xx.bak

--Lists the logical file names in the backup file

Restore filelistonly from disk= ' C:xx.bak '

--Use statement recovery, using the Move option based on the logical filename listed above

Restore database name after recovery

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/restore between the Enterprise version should be noted for the same thing:

1. To pay attention to the settings at the time of backup, do not specify multiple backup files, or restore to specify multiple backup files

2. Pay attention to the media handling of the backup problem, with the rewrite, rather than append, otherwise restore the time to specify the backup number

3. Pay attention to the way the backup, with full backup, rather than other backup methods, or restore the other backup file support

Related Article

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.