Rules for searching log files when attaching database files to SQL Server

Source: Internet
Author: User
Question proposal
Different phenomena occur when attaching a single database. Some environments can be attached successfully, while others cannot. After an attempt, the following rules are found.

Additional rules
Search for log files in the following order.
1. Search for the log file whose name matches the current folder where the database file is located. Name matching means that the log file is the database file name + _ log. LDF.
2. Search for the log files used when the database was last separated. If yes, the log file is used.
3. If neither 1 nor 2 is found, create a log file in the current folder with the database file.

In one attempt, because 2nd rules are met, the log file has been replaced with an unmatched log file. In this way, attaching operations that do not seem to have any problems will always fail.

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.