none
alter database failed due to an invalid server connection string in principal server. RRS feed

  • Question

  • hi

    the error is alter database failed due to an invalid server connection  string in principal server.

    pls help....

    ajitkumar

    Tuesday, August 6, 2019 4:58 AM

All replies

  • Can you show whole error message?

    Best Regards,Uri Dimant SQL Server MVP, http://sqlblog.com/blogs/uri_dimant/

    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting: Large scale of database and data cleansing
    Remote DBA Services: Improves MS SQL Database Performance
    SQL Server Integration Services: Business Intelligence

    Tuesday, August 6, 2019 6:48 AM
  • hi ,

    when I m configure mirror, I m getting the error .

    I m getting the error 927..

    Database 'tester' cannot be opened. It is in the middle of a restore. (Microsoft SQL Server, Error: 927)


    Tuesday, August 6, 2019 7:51 AM
  • Hi 

    What is the status your db? online ofline restoring and another? If online database could be corrupted. Firstly you try fix database after this use database. 

    Best Regards,

    Natig


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. 

    Tuesday, August 6, 2019 8:26 AM
  • hi,

    My Database is not corrupted. It is working very well.

    But when I was configuring mirror , then got the error 927 

    Database 'tester' cannot be opened. It is in the middle of a restore. (Microsoft SQL Server, Error: 927)

    so pls give the perfect  solution

    Ajit kumar

    Tuesday, August 6, 2019 9:56 AM
  • --On Mirror Server, execute the following TSQL:

    USE MASTER;
    GO
    ALTER DATABASE <Database_Name> SET PARTNER = 'TCP://<Principal Server>:5022'
    GO
    --On Principal Server, execute the following TSQL:

    USE MASTER;
    GO
    ALTER DATABASE <Database_Name> SET PARTNER = 'TCP://<Principal Server>:5023';
    GO
    ALTER DATABASE <Database_Name> SET WITNESS = 'TCP://<Principal Server>:5024';
    GO


    Best Regards,Uri Dimant SQL Server MVP, http://sqlblog.com/blogs/uri_dimant/

    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting: Large scale of database and data cleansing
    Remote DBA Services: Improves MS SQL Database Performance
    SQL Server Integration Services: Business Intelligence

    Tuesday, August 6, 2019 10:29 AM
  • hi,

    I have done this process , which is given by you.

    but still my database not synchronize mode in principal server ,mirror server is IN recovery mode.

    Pls help

    if need any step.

    Tuesday, August 6, 2019 11:38 AM
  • Restart the db mirroring end point:

    --To stop 
    ALTER ENDPOINT<Endpoint Name> STATE=STOPPED

    --To start
    ALTER ENDPOINT<Endpoint Name> STATE=STARTED

    Best Regards,Uri Dimant SQL Server MVP, http://sqlblog.com/blogs/uri_dimant/

    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting: Large scale of database and data cleansing
    Remote DBA Services: Improves MS SQL Database Performance
    SQL Server Integration Services: Business Intelligence

    Tuesday, August 6, 2019 11:58 AM
  • hi

    I did, there are same problem.

    Database 'tester' cannot be opened. It is in the middle of a restore. (Microsoft SQL Server, Error: 927)

    mirror server--restoring  mode

    no effect in principal mode--


    Tuesday, August 6, 2019 12:40 PM
  • Hi ajitkumar,

    Could you please check your steps that configuring database mirroring? Please refer to use T-SQL configure database mirroring.

    What is your SSMS version? And could you please share a screenshot when error occurred?

    By the way, see if below link is useful. https://social.msdn.microsoft.com/Forums/en-US/69e1c6b5-3573-4b13-8e60-5f93bd71dba1/sql-2016-unable-to-start-mirroring?forum=sqldatabasemirroring

    Best regards,
    Cathy Ji

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to  MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Wednesday, August 7, 2019 7:29 AM
  • Hi

    Go To Sql Server confgration Manager

    Sql Server Network configuration

    Prootocols for SQLEXPRESS:

    Change Named Pipes to Enabled

    change Tcp/ip to Enabled

    after restart your pc.

    Best regards.

    Hakkim.

    Wednesday, August 7, 2019 9:59 AM
  • hi,

    when I was configure mirroring thru GUI option (ssms18.1) I got the error .step(1)

    Database 'tester' cannot be opened. It is in the middle of a restore. (Microsoft SQL Server, Error: 927)mirror server--restoring  mode .....no effect in principal mode--..

    another option ..t-sql used..step--2

      ALTER DATABASEAdventureWorks2017 SETPARTNER='TCP://POC-SQL01:7022;'

    error--then getting this

    ALTER DATABASE command failed due to an invalid server connection string.

    Wednesday, August 7, 2019 10:11 AM
  • Hi ajit,

    In the database mirroring endpoints do not specify the instance name.  Did SQL01 is your instance name?  Did POC is your server name?  AdventureWorks2017 or tester is your mirror database ?

    For example in my environment: 

    USE master;  
    GO  
    ALTER DATABASE TSQL SET PARTNER = 'TCP://m1.contoso.com:7022'
    GO  

    In this example, TSQL is mirror database name, m1.contoso.com is my full computer name, 7022 is port. Could you please try again in your environment, and share us result?

    Best regards,
    Cathy

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to  MSDN Support, feel free to contact MSDNFSF@microsoft.com



    Thursday, August 8, 2019 7:04 AM