SQL Server's simplest database recovery process with the same name.

Source: Internet
Author: User

I. Cold Backup Recovery

1. net stop MSSQLSERVER # If the default DB instance that is installed shuts down SQL Server's database

2. Copy SQL Server data files are mainly MDF data files and the LDF disk files.

3. If the database takes a full log mode log file is more than the case, you can first process the log file.

1. Checkpoint

2. Task-Shrink-log file. Modify Size

3. Reports-Sort by disk size-Show all tables

4. Truncate the unwanted log tables and backup tables

5. Shrink MDF data file

4. Go to the database you want to restore to

SA Login Attach Database file

Note If you are prompted with a problem at this point, add the Everyone permission to the MDF and LDF files and change the read-only property

5. Global security access to the database The new user has the same name as the user before the backup was restored.

Open the SQL window for Query Analyzer

User Databaseschema Name

Execute sp_change_users_login ' update_one ', ' username ', ' username '

Associating a logged-in user with a database owner

Backup Recovery Complete

Two. Hot backup process.

Backing Up the database

Copy bak file

Recovering a Database

Adding SQL Server users

Execute SP Command

Complete.

SQL Server's simplest database recovery process with the same name.

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.