Database backup and recovery

Source: Internet
Author: User
Backup and recovery of databases 1. Open SQLServerManagementStudio → Database: practice_20.gl is the database we need to back up. 2. Right-click the database to be backed up. 3. Click "delete" and then "add". 4. Select the backup path, and enter the number of backups in the "file name" location.

Backup and recovery of databases 1. Open SQL Server Management Studio → Database: practice_20.gl is the database we need to back up. 2. Right-click the database to be backed up. 3. Click "delete" and then "add". 4. Select the backup path, and enter the number of backups in the "file name" location.

Backup and recovery of databases 1. Open SQL Server Management Studio → Database: practice_20.gl is the database we need to back up.

2. Right-click the database to be backed up.
3. Click "delete" and then "add"
4. select the backup path and enter the name of the database you want to back up in the "file name" location (it is best to add a date after the name of the database you backed up to facilitate future search ), then, click "OK" to complete database backup.

Database restoration 1. Select the database you want to restore "Practice_JWGL", right-click the database, and choose task> restore> database.

2. In the displayed "Restore database" dialog box, select "source device", browse, add files, and select backup files.

3. Select the central source check box and click OK. (Backup options can be verified after backup)

Transact-SQL
-- Completely back up the database to the physical Backup device Backup DataBase Practice_JWGLTo disk = 'e: \ database \ practice_jwgl_20121.bak 'Go -- back up the database differential to the physical Backup device Backup DataBase Practice_JWGLTo disk = 'e: \ DataBase \ practice_jwgl_20121.bak 'With differentialGo -- verify whether the backup file on the physical backup device is valid Restore verifyonly from disk = 'e: \ DataBase \ pai'go -- restore database Practice_JWGLfrom practice_jwgl_20151121with file = 1, replacemove 'practice _ Your GL 'to 'e: \ DataBase \ Practice_JWGL.mdf ', move 'practice _ javasgl_log 'to 'e: \ DataBase \ practice_javasgl_log.ldf' go
With file = 1 to specify the 1st backup sets in the backup file.
-- Restore database practice_‑glfrom practice_‑gl_20151121with file = 2, recoverygo
The with norecovery parameter table indicates that the database is in the "restoring" State and does not perform any operations on the committed transactions. If no data is written, the default with recovery indicates rolling back uncommitted transactions.
The steps for restoring the database are: full database restoration-differential database restoration-tail log database restoration.
-- Open the master database use mastergo -- restore the complete database restore database practice_mongoglfrom practice_mongogl_20151121with file = 1, norecovery, replacego -- restore the differential database restore database practice_mongoglfrom mongofile = 2, restore log practice_javasglfrom practice_javasgl_20151121with file = 3, recoverygo

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.