A case of database mirroring-database subject and image disconnected

Source: Internet
Author: User

Background: Today, I checked the status of the Image Database in an instance on a server and found that the status of all the mirrored databases in the master database is Principal/disconnected. Besides the image database tfs_tfs2005collection, the status of other image databases is mirror/recovering/pending.

Solution: Step 1: first check whether the database servers on both sides can ping each other --- confirm OK Step 2: Telnet each other database listening port (we use 1433 here) ---- confirm OK Step 3: telnet the port of the database image endpoint to each other (we use 5022 here) ----- confirm OK Step 4: restart the endpoint used by the database image on the master instance and the image instance: Use master

Go
Alter endpoint endpoint_name state = stopped;
Go
Alter endpoint endpoint_name state = started;
Go

In addition to database A, other database images will return to normal.


Then, the problem of tfs_tfs2005collection database image is solved. the status of the tfs_tfs2005collection image database is not mirror/recovering/pending, but similar to that of a normal database (which does not contain any status). However, when we access this database, the system prompts that the database cannot be accessed.

Execute select * From SYS. databases. The state_desc of the database is recovery_pending. That is to say, the recovering of the database is blocked.

View the database logs in the image database:

Unable to open the physical file "D: \ data \ tfs_tfs2005collection \ log \ tfsversioncontrol. LDF ". operating System Error 32: "32 (the process cannot access the file because it is being used by another process .) ".

A file activation error occurred. The physical file name 'd: \ data \ tfs_tfs2005collection \ log \ tfsversioncontrol. ldf' may be incorrect. Diagnose and correct additional errors, and retry the operation.

Then I tried the following methods:

In addition, the methods you have tried are as follows:

1:Alter database tfs_tfs2005collection set partner resume------ Invalid

2:

Alter endpoint endponitname state = stopped

Alter endpoint endponitname state = started ----- invalid

3: Alter database tfs_tfs2005collection set partner = 'tcp: // principal: 8080' --- invalid

And an error is reported.

MSG 945, Level 14, state 2, line 1

Database 'tfs _ tfs2005collection 'cannot be opened due to inaccessible files or insufficient memory or disk space. see the SQL Server errorlog for details. we found that the data files and log files of the tfs_tfs2005collection database can be copied. Normally, an error is reported when you move the data files and log files of an online database (indicating that the file is in use and cannot be copied or moved ). later, processexplorer was used to check which program is occupying the data or log files of the tfs_tfs2005collection database, and no results were returned. at last, you have to restart the server of the image instance. After the instance is started, check that the image of the database tfs_tfs2005collection is restored to normal. strange events. it is suspected that the OS cannot access the data and log files of the tfs_tfs2005collection database for some unknown reason, and then the image fails.

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.