SQL Server image certificate expiration Processing

Source: Internet
Author: User

Today, the primary server in the image is maintained and restarted. After restart, the image disconnect is found. xp_readerrorlog 0, 1 is used to check the error log and the following information is found:

 
DatabaseRefreshing connection Error5 'Connection handshake failed. The certificate used by this endpoint was not found: Certificate Expired. Use DBCC checkdb in master database to verify the metadata integrity of the endpoints. State 85.'

Previously, I thought that the certificate was damaged due to restart. Therefore, I checked whether the certificates of the following host and backup host exist:

SelectName, start_date, expiry_date
FromSYS. Certificates
WhereNameNot Like '##%'

Check and find that the host certificate expiry_date time is, and now it is 13th. You can draw a conclusion that although the certificate expires, if the image is not disconnected, the certificate can still be used continuously, until the image is disconnected.

Then the certificate is replaced, the host is re-created, the new certificate is modified, and the endpoint is backed up to the backup machine:

 Use Master
Go
-- Principal_cert_new if no endpoint is deleted, the new certificate name is required.
Create Certificate principal_cert_new With Subject = ' Mirror ' , Start_date = ' 2012-01-01 ' , Expiry_date = ' 2099-06-01 ' ; -- Select a date for Certificate replacement after N years (6.1 has passed)
Go
Alter Endpoint endpoint_receiving
For Database_authentication ing (Authentication = Certificate principal_cert_new)
Go
Drop Certificate principal_cert
Go
Backup Certificate principal_cert To File = ' D: \ certificate \ principal_cert.cer ' ;

Backup Machine, restore the host certificate and reply to the image:

  use  master 
go
Create certificate principal_cert_new authorization authorization _user from file = ' D: \ certificate \ principal_cert.cer ';
go
alter database mydb set partner resume
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.