Why SQL Server 2005 Database Mirror Can't Failover?
Jun 28, 2006
Hello All,
I've tried to replicated exactly what it says in the online documentation. At the end of the post are the SQL statements issued.
1. Enable encrypted outbound connections on the primary server
2. Enable encrypted outbound connections on the mirror server
3. Enable encrypted outbound connections on the witness server
4. Enable encrypted inbound connections on the primary server
5. Enable encrypted inbound connections on the mirror server
6. Enable encrypted inbound connections on the witness server
7. Set mirror''s partner to the primary
8. Set primary''s partner the mirror
9. Set principal€™s witness.
Every step run''s normally,but why can''t auto failover.
I used the following Script:
/* -------- 1. ENABLE OUTBOUND CONNECTIONS ON THE PRIMARY -------- */
use master;
go
DROP USER PrincipalLogin1
DROP LOGIN PrincipalLogin1
DROP USER PrincipalLogin2
DROP LOGIN PrincipalLogin2
GO
Create login PrincipalLogin1
with password='PrincipalLogin'
go
Create user PrincipalLogin1
from login PrincipalLogin1
go
Grant connect on endpoint::Principal_Endpoint_Mirroring to PrincipalLogin1
go
---stop
create certificate MirrorCertForPartnerPub
authorization PrincipalLogin1
from file = 'd:BackupCertMirrorCertForPartner.cer';
go
Create login PrincipalLogin2
with password='PrincipalLogin'
go
Create user PrincipalLogin2
from login PrincipalLogin2
go
Grant connect on endpoint::Principal_Endpoint_Mirroring to PrincipalLogin2
go
create certificate WintnessCertForPartnerPub
authorization PrincipalLogin2
from file ='D:BackupCertCertForDBRole.cer'
GO
ALTER DATABASE Mirrortest
SET PARTNER = 'TCP://10.1.40.158:5022'
GO
ALTER DATABASE Mirrortest
SET witness = 'TCP://10.10.11.30:7000'
GO
select * from sys.certificates
/* -------- 2. ENABLE OUTBOUND CONNECTIONS ON THE MIRROR -------- */
--On Mirror
--Remove the database
--Connect to either partner.
--Issue the following Transact-SQL statement:
ALTER DATABASE Mirrortest SET PARTNER OFF
--Optionally, you can recover the former mirror database. On the server instance that was the mirror server, enter:
--RESTORE DATABASE Mirrortest WITH RECOVERY;
RESTORE DATABASE [Mirrortest] FROM
DISK = N'D:BackupCertMirrortest.bak'
WITH FILE = 1, NORECOVERY, NOUNLOAD, REPLACE, STATS = 10
GO
select * from sys.endpoints
drop endpoint Mirror_Endpoint_Mirroring
select * from sys.certificates
Create certificate MirrorCertForPartner
with subject ='this is the certificate for mirror',
start_date='06/25/2006'
backup certificate MirrorCertForPartner
to file='d:ackupcertMirrorCertForPartner.cer'
CREATE ENDPOINT Mirror_Endpoint_Mirroring
STATE=STARTED
AS TCP (LISTENER_PORT=5022)
FOR DATABASE_MIRRORING (
Authentication=Certificate MirrorCertForPartner
,ROLE=ALL)
GO
/* -------- 3. ENABLE OUTBOUND CONNECTIONS ON THE WINTESS -------- */
--On Witness
USE [master]
GO
select * from sys.certificates
drop certificate CertForDBRole
GO
create master key
encryption by password='asdf'
Create certificate CertForDBRole
with subject='this is a certificate for pricipal role',
start_date='06/25/2006'
backup certificate CertForDBrole
to file='c:CertForDBRole.cer'
select * from sys.endpoints
drop endpoint Witness_Endpoint_Mirroring
CREATE ENDPOINT Witness_Endpoint_Mirroring
STATE=STARTED
AS TCP (LISTENER_PORT=7000)
FOR DATABASE_MIRRORING (
Authentication=Certificate CertForDBRole
,ROLE=ALL)
GO
/* -------- 4. ENABLE INBOUND CONNECTIONS ON THE PRIMARY -------- */
use master;
go
DROP USER PrincipalLogin1
DROP LOGIN PrincipalLogin1
DROP USER PrincipalLogin2
DROP LOGIN PrincipalLogin2
GO
Create login PrincipalLogin1
with password='PrincipalLogin'
go
Create user PrincipalLogin1
from login PrincipalLogin1
go
Grant connect on endpoint::Principal_Endpoint_Mirroring to PrincipalLogin1
go
---stop
create certificate MirrorCertForPartnerPub
authorization PrincipalLogin1
from file = 'd:BackupCertMirrorCertForPartner.cer';
go
Create login PrincipalLogin2
with password='PrincipalLogin'
go
Create user PrincipalLogin2
from login PrincipalLogin2
go
Grant connect on endpoint::Principal_Endpoint_Mirroring to PrincipalLogin2
go
create certificate WintnessCertForPartnerPub
authorization PrincipalLogin2
from file ='D:BackupCertCertForDBRole.cer'
GO
ALTER DATABASE Mirrortest
SET PARTNER = 'TCP://10.1.40.158:5022'
GO
ALTER DATABASE Mirrortest
SET witness = 'TCP://10.10.11.30:7000'
GO
select * from sys.certificates
/* -------- 5. ENABLE INBOUND CONNECTIONS ON THE MIRROR -------- */
use master;
go
DROP USER MirrorLogin1
DROP LOGIN MirrorLogin1
DROP USER MirrorLogin2
DROP LOGIN MirrorLogin2
GO
Create login MirrorLogin1
with password='MirrorLogin'
go
Create user MirrorLogin1
from login MirrorLogin1
go
Grant connect on endpoint::Mirror_Endpoint_Mirroring to MirrorLogin1
go
--stop
create certificate PrincipalCertForPartnerPub
authorization MirrorLogin1
from file = 'd:BackupCertPrincipalCertForPartner.cer';
go
Create login MirrorLogin2
with password='MirrorLogin'
go
Create user MirrorLogin2
from login MirrorLogin2
go
create certificate WitnessCertForPartnerPub
authorization MirrorLogin2
from file ='D:BackupCertCertForDBRole.cer'
GO
Grant connect on endpoint::Mirror_Endpoint_Mirroring to MirrorLogin2
go
ALTER DATABASE Mirrortest
SET PARTNER = 'TCP://10.10.116.42:5022'
GO
ALTER DATABASE Mirrortest
SET WITNESS = 'TCP://w7mis02:5024'
GO
/* -------- 6. ENABLE INBOUND CONNECTIONS ON THE WITNESS -------- */
use master;
go
DROP USER WitnessLogin1
drop login WitnessLogin1
DROP USER WitnessLogin2
drop login WitnessLogin2
Create login WitnessLogin1
with password='WitnessLogi*n@'
go
create user WitnessLogin1
from login WitnessLogin1
go
create certificate PrincipalCertForPartnerPub
authorization WitnessLogin1
from file = 'c:ackupcertPrincipalCertForPartner.cer';
go
--***************************************
Create login WitnessLogin2
with password='WitnessLogi*n@'
go
create user WitnessLogin2
from login WitnessLogin2
go
create certificate MirrorCertForPartnerPub
authorization WitnessLogin2
from file = 'c:ackupcertMirrorCertForPartner.cer';
go
Grant connect on endpoint::Witness_Endpoint_Mirroring to WitnessLogin1
go
Grant connect on endpoint::Witness_Endpoint_Mirroring to WitnessLogin2
go
I'm trying setup a proof of concept for a client but I€™m having issues with mirroring and replication.
With the help of http://technet.microsoft.com/en-us/library/ms151799.aspx I€™ve done the following..
The setup is as follows, I have several instances of SQL Server
A+B are mirrored with each other, with A being the principle and B the mirror
C is the distributor
E is subscribes to A, with parameters for PublicationFailoverPartner set to B
The mirroring between A+B works fine, I can manually fail each and the databases keep in step.
Without testing the mirroring failover, the replication between A+C+E also works.
However when I test the mirror to failover between A+B no transactions are replicated though to E. The publication moves from A to B in the Server Management Studio.
The logs state that the log reader agent can not gain access to A, however nothing is recorded regarding any attempts to contact B. In the replication monitor the error message
"The concurrent snapshot for publication ABCXYZ is not available because it has not been fully generated of the Log Reader Agent is not running to activate it. If generation of the concurrent snapshot was interrupted, the Spapshot Agent for the publica..." (cut off).
"the process could not execute 'sp_replcmds' on 'A'
I have checked that the SQL Server Agents are running on all agents,
I have checked that that server B is set at the PublisherFailoverPartner on server C agent configuration; I'm now at a lost as to what is wrong,
We want to use sql 2005 failover clustering feature, so that upgrade sql 2000 is necessary. But some of the stored procedures built in 2000 are not working directly in 2005, set the compatibility level to 80 could make them work. In this case, can somebody here tell me if down grade the database level will affect failover clustering running properly? e.g. will data still be synchronized properly? Thanks in advance.
When performing a failover the DriverManager.getConnection method never returns from it's call. I used a modified version of the test program included in the sqljdbc help file (below). If the principle server is server2 and a failover is performed, the program works just fine. If the priciple server is server1 and a failover is performed, the hang occurs. The sql servers are not on a domain, are in the same workgroup, have certificates setup between them. Sqljdbc version used is 1.1.1501.101. I rolled back to version 1.1.1320.0 and the DriverManager.getConnection exceptioned. Not sure if this is a setup issue or a common problem. Anyone have any suggestions or seeing similar issues?
Thanks
- tc
Version 1.1.1501.101 - System hangs on DriverManager.getConnection method. Version 1.1.1320.0 - Exception: java.nio.channels.UnresolvedAddressException at sun.nio.ch.Net.checkAddress(Net.java:30) at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:451) at java.nio.channels.SocketChannel.open(SocketChannel.java:146) at com.microsoft.sqlserver.jdbc.DBComms.<init>(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithFailover(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(Unknown Source) at java.sql.DriverManager.getConnection(DriverManager.java:525) at java.sql.DriverManager.getConnection(DriverManager.java:193) at testconnection.Main.Execute(Main.java:115) at testconnection.Main.main(Main.java:35)
private static void Execute(int iteration) { // Create a variable for the connection string. String connectionUrl = "jdbc:sqlserver://server1;" + "databaseName=TestDb;integratedSecurity=true;" + "failoverPartner=server2";
// Declare the JDBC objects. Connection con = null; Statement stmt = null;
try { System.out.println("(" + iteration + ") Connection Test"); // Establish the connection to the principal server. Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); System.out.println(" Get Connection."); con = DriverManager.getConnection(connectionUrl); System.out.println(" Connected to the principal server.");
// Create and execute an SQL statement that inserts some data. stmt = con.createStatement(); ResultSet rs = stmt.executeQuery("SELECT * FROM TestTable"); System.out.println(" SUCCESS");
while(rs.next()) { System.out.println(" Record: " + rs.getString("Field1")); } } // Handle any errors that may have occurred. catch (SQLException se) { try { // The connection to the principal server failed, // try the mirror server which may now be the new // principal server. System.out.println(" Connection to principal server failed, " + "trying the mirror server."); con = DriverManager.getConnection(connectionUrl); System.out.println(" Connected to the new principal server."); stmt = con.createStatement(); ResultSet rs = stmt.executeQuery("SELECT * FROM TestTable"); System.out.println(" SUCCESS");
I'am currently testing a MSSQL 2005 mirroring implementation with automatically failover.
1 principal server ====> Server A 1 mirror server ====> Server B 1 witness server ====> Server C
When server A fails Server B becomes Principal. ( which is the general idea ) This is working perfectly.
The problem is when i try to connect to the mirror Server B ( actually the new principal )
I use the .NET connection string with the failover parameter ( even without the parameter ) the connection fails. ( the general error : unable to connect, or connection property has not been initialized )
Data Source=ServerA; Failover Partner=ServerB;Initial Catalog=DBMTest;uid=dbuser;pwd=dbpassword;
This connection property works fine when server A (original principal) is online.
When i run the SQL profiler with the mirror db as profile, i dont see the traffic.
So you think the mirror server has a network problem or was not connfigured for remote access. i thought that also, but when i create a 'stand alone - non mirrored' database the same application with the same connetion string ( well.....different db) works fine.
The problem must be in the whole mirroring implementation....... ( my idea )
Does anyone had the same problem, or better, doed anyone know how to solve it?
I am using SQl Server 2012 Database Mirroring with around 40 gb as mdf and 1 gb as ldf. Now my ldf size increased . How to reduce ldf size while mirror enabled with mirror server and witness server. Can shrink the ldf with mirror enables.
I was trying to test mirroring and now would like to delete the mirror database but it says I need to remove database mirroring first. I deleted the endpoint and cannot figure out how to remove the mirroring. Can someone please help.
I have a SQL Server 2005 DB server (SRV1) and a mirror DB server (SRV2) without witness server. I saw that there is a "Failover" button on Mirror window of SRV1. When click it servers changes roles.
My question is that: If my mirrored DB server crashs and I can not open windows or if I lost all data on SRV1, how can I failover from only mirror DB (SRV2)?
I hope this is in the right forum, I'm new to MSDN. I'm also not an expert in SQL, so please bear with me as I was unable to find an answer by searching the archives.
We have a single SQL 2005 Standard installation with 30 user CALs on a Server2003R2 box. We have another Server 2003 box in a remote but connected location that we previously used for backup replication. What we'd like to do is use some of the replication features in SQL 2005 to replicate the data over every night to the other box, onto which we would install another copy of SQL 2005. This would not be a server accessed by clients, but simply a "live backup", that in the event of a catastrophic failure, could be manually set up to operate as a SQL server in place of the failed primary server. I don't need any kind of automatic "failover", just the ability to replicate the data over to the other system so I have two SQL Servers that synchronize from one to the other overnight.
I was told that I wouldn't need to buy the user CALs again, that the 30 user cals would translate over if the primary server fails and has to be replaced by the cloned server. But what do I buy for the SQL server itself? A boxed version is a bit pricy and comes with 5 CALs which apparently I wouldn't need. Then I noticed that on softwaremedia.com the open license version, which can be bought a la carte, lists a requirement of buying at least 5 cals or a processor license. What exactly do I need to do this, and how can I get it for the least amount of further spending?
We have a Prinicipal, a Mirror and a Witness server. We have automatic failover configured between the Prinicipal and Mirrored server. When we stop MMSQL service on Prinicipal, not all the databases failover to the Mirrored instance. Any suggestions would be welcomed as we have a tight deadline to get this in Production.
1. Once fail over to secondary replica, what will happen to connected session in primary node? can the session fail over to secondary seamlessly or need to re-login. what happen committed transactions which has not write to disk. 2. Assume I have always on cluster with three nodes, if primary fails, how second node make write/ read mode. 3. after fail over done to 2nd secondary node what mode in production(readonly or read write). 4. how to rollback to production primary ,will change data in secondary will get updated in primary.
After adding the Witness Server to the Mirror session, the Witness Connection state between the Mirror and Witness Connection is Disconnected and the state between Principal and Witness Connection is Connected.
The procedures defined in Books Online was used to setup Database Mirroring...when the Witness server was added to the Mirror session, only the alter database T-SQL statement was executed on the Principal server.
ALTER DATABASE <db_name> SET WITNESS = 'TCP://<servername>:<port>'
After executing the above statement, a few seconds later the state between Principal and Witness Connection changed to Connected and the state between Mirror and Witness Connection remains Disconnected.
The Mirror session is not using Certificates, every server is on the same domain, using the same domain login account, and all servers have SP2 installed running Enterprise Edition.
Any idea's why the state between Mirror and Witness Connection remains Disconnected?
We have sql server 2005 installed locally on 2 servers and want to set up failover clustering. Do we need to uninstall what we have then install as failover cluster? Thanks.
We use SQL server always on feather on my database and we distribute statement on main database server and mirror database server for raise performance.
My police for split statement is DML (insert, update and delete) statement go to main DB and Read Data (select) statement go to mirror DB.
I want know can I use different index on main DB and mirror Database?
Because some index are used in mirror DB not used in main database.
I have setup a database mirroring session without witness - ServerA is the principal, ServerB is the mirror,. Each SQL Server instance is hosted on its own machine on sql2005 EE SP2. The mirroring is working correctly. If I submit to server ServerA command:
ALTER DATABASE MYDBNAME SET PARTNER FAILOVER
, ServerB becomes the principal, it means that mirroring works correctly.
My issue is with the SQL Native Client and a front-end ASP application (actually IIS 6.0 site) that needs to make use of this database. I have setup my front-end application to use SQL Native Client and specified the failover server in connection string. Here is the connection string that I am using :
Everything works perfectly on my front-end application when ServerA is the principal. If I execute on server ServerA command:
ALTER DATABASE MYDBNAME SET PARTNER FAILOVER
, ServerB becomes the principal, and the failover occurs correctly on the database side. The problem is that my front-end application is not able to query the database on ServerB. The error appears:
Microsoft SQL Native Client error '80004005'
Cannot open database "MYDBNAME" requested by the login. The login failed.
This behavior my appication till I unload IIS 6.0 pool application. After that my front-end application becomes work correctly with ServerB.
When I swap server, I execute on server ServerB command:
ALTER DATABASE MYDBNAME SET PARTNER FAILOVER,
my IIS 6.0 application automaticly turn back to ServerA without any action on my side.
I am using SQL Native Client last version http://download.microsoft.com/download/2/7/c/27c60d49-6dbe-423e-9a9e-1c873f269484/sqlncli.msi (issued in February 2007). Has anyone experienced this issue? I'm thinking that it's a problem in the SQL Native client
missing witness server information and the fail-over is broken suddenly? 4:00am no maintenance job. I have one sql job on 10pm for backup on database transaction log only.
I can see the primary have problem then perform fail-over to mirror database, the auto fail-over was broken.
I re-build the sql mirror is OK , but i want to find the root cause.
Windows application event was full when there have many failed event, i have increase log size for application event. Â
When using this connection string, the connection to MAIN is alrigth, but when we simulate a unavailability situation on "MyBase" or on the entire MAIN instance, the new connection are joining the MAIN and not the BCKUP SQL Server.
We tryed several Connection Strings including Failover_Partner, Initliag Catalog instead of database... but no one succed in joining the BCKUP SQL Server.
I precise that the DNS on the PC that connect to SQL server is configured and both MAIN and BCKUP are resolved in command line or in explorer.
Is there an other driver that must be used, or is there an other parameter to set in the connection string ?
When using this connection string, the connection to MAIN is alrigth, but when we simulate a unavailability situation on "MyBase" or on the entire MAIN instance, the new connection are joining the MAIN and not the BCKUP SQL Server.
We tryed several Connection Strings including Failover_Partner, Initliag Catalog instead of database... but no one succed in joining the BCKUP SQL Server.
I precise that the DNS on the PC that connect to SQL server is configured and both MAIN and BCKUP are resolved in command line or in explorer.
Is there an other driver that must be used, or is there an other parameter to set in the connection string ?
Hello All, I am trying the following script to upgrade SQL Server 2005 SP1 to SP2. I have an Active Passive cluster configuration. I have default instances of SQL Server. I am using the following script.
The sql server install fails to run. When I used the above command with just
start /wait c:1sqlserversp2SQLSERVER2005SP2-KB921896-x86-ENU.exe /quiet still the summary.txt file came with authentication success and that is all. I changed the above script and did
start /wait c:1sqlserversp2SQLSERVER2005SP2-KB921896-x86-ENU.exe /instancename=instancename of the cluster
This worked, however the install patched the passive node (DB engine, all the cluster unaware components) but failed to patch the DB engine on the Active node. I had to run the SQL Server sp2 install manually but still it did not patch the DB engine on the primary node
1. Can someone please help me with this issue as I want the unattended install to work. so it installs both active and passive node. I will post the final output and also the ADS script to do this as a bonus if this works.
Here is the summary.txt file.
********************************************************************************** Processes Locking Files Process Name Feature Type User Name PID msftesql Database Services Service 5152 MSSQLSERVER Database Services Service 4412 ResrcMon.exe Database Services Application SHOMSCSService 4688 ********************************************************************************** Product Installation Status Product : Setup Support Files Product Version (Previous): 3042 Product Version (Final) : Status : Not Selected Log File : Error Description : ---------------------------------------------------------------------------------- Product : Database Services (MSSQLSERVER) Product Version (Previous): 2153 Product Version (Final) : Status : Failure Log File : C:Program FilesMicrosoft SQL Server90Setup BootstrapLOGHotfixSQL9_Hotfix_KB921896_sqlrun_sql.msp.log Error Number : 29506 Error Description : MSP Error: 29506 SQL Server Setup failed to modify security permissions on file D:Microsoft SQL ServerMSSQL.1MSSQLData for user sqlservice. To proceed, verify that the account and domain running SQL Server Setup exist, that the account running SQL Server Setup has administrator privileges, and that exists on the destination drive. ---------------------------------------------------------------------------------- Product : Integration Services Product Version (Previous): 3042 Product Version (Final) : Status : Not Selected Log File : Error Description : ---------------------------------------------------------------------------------- Product : SQL Server Native Client Product Version (Previous): 3042 Product Version (Final) : Status : Not Selected Log File : Error Description : ---------------------------------------------------------------------------------- Product : Client Components Product Version (Previous): 3042 Product Version (Final) : Status : Not Selected Log File : Error Description : ---------------------------------------------------------------------------------- Product : MSXML 6.0 Parser Product Version (Previous): 1129 Product Version (Final) : Status : Not Selected Log File : Error Description : ---------------------------------------------------------------------------------- Product : SQLXML4 Product Version (Previous): 3042 Product Version (Final) : Status : Not Selected Log File : Error Description : ---------------------------------------------------------------------------------- Product : Backward Compatibility Product Version (Previous): 2004 Product Version (Final) : Status : Not Selected Log File : Error Description : ---------------------------------------------------------------------------------- Product : Microsoft SQL Server VSS Writer Product Version (Previous): 3042 Product Version (Final) : Status : Not Selected Log File : Error Description : ---------------------------------------------------------------------------------- ********************************************************************************** Summary One or more products failed to install, see above for details Exit Code Returned: 29506
I´m running some tests in a database with Mirroring and without Mirroring. As expected there is a performance hit using Database mirroring.
The tests i´m running are just simple functions inserting and updating the database, and then counting the number of sucedeed inserts and updates in a time interval.
My question here is: What if i use Sql Server failover mechanism?
I know that failover time will increase and management is more complex, but what can i expect in terms of performance ?
Curious on how this will work.. if i install sql 2005 standard edition on one virtual server.. to a fixed disk (actually 2 fixed disks.. one for C, one for D).. then install another 2005 standard edition on another virtual server.. do i just rerun the setup and suddenly the failover cluster option will NOT be greyed out?
I am intsalling SQL 2005 in an activepassive cluster. The OS is Windows 2003 with SP1. Everything installs OK but the sql server service cannot start afterwards. There are many access errors in the Security Event log - see example below - and numerous "SSPI handshake failed with error code 0x8009030c while establishing a connection with integrated security; the connection has been closed. " errors in both the SQL and Application event logs. I have tried installing SQL in both mixed mode and under Windows Authentication and get the same errors. I can install SQL 2005 outside of the cluster on both nodes. Other items of note: This was a SQL 2000 cluster. I uninstalled SQL 2K, the virtual name was changed (IP remained the same) and the DNS entry was updated to reflect the new name. Early in the installation process - 3 or 4 days ago - I got a few errors about the Server Principal Name had to be updated but when I do a setspn -l the both nodes are listed and the entries look fine, though there are no entries for the sql service (MSSQLSvc). Not sure if there should be entries for the virtual name, but there aren't any for either the old or new name. Does the new virtual name need to be added to AD? Here is the security error - Event ID is 560 and it looks like there's a problem with Remote Access and is generated when trying to access either node: Category: Object Access Type: Failure Audit Event_ID: 560 User: NT AuthorityNetwork Service Object Open: Object Server: SC Manager Object Type: SERVICE OBJECT Object Name: RemoteAccess Handle ID: - Operation ID: {0,134558507} Process ID: 1516 Image File Name: C:WINDOWSsystem32services.exe Primary User Name: CM-OHCO-DS006B$ Primary Domain: SWNA Primary Logon ID: (0x0,0x3E7) Client User Name: NETWORK SERVICE Client Domain: NT AUTHORITY Client Logon ID: (0x0,0x3E4) Accesses: Query status of service
One other informational message that may be of use - looks like there's a problem with dll's for remote access, though this isn't pertaining to SQL: The description for Event ID ( 0 ) in Source ( srmservice ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: srmservice error: 0, Started the agent (srmagent.exe)..
I have SQL Server 2008 R2 database mirroring setup with witness. Below database connection string is used by the application  jdbc:sqlserver://<Server_A>MSSQLSERVER;databaseName=<Mirrored_DB>;port=1433;failoverPartner=<Server_B>MSSQLSERVER  During some maintenance activity at the OS side , I tried to manually failover database from Server_A to Server_B. It took long time for failover to Server_B. While failing over the Mirrored_DB database goes in In Recovery status and application is not able to connect to database. I waited for long time more than 40 mins for database to come online on Server_B but it did not work.So I have recovered database on Server_B using RESTORE DATABASE Mirrored_DB WITH RECOVERY.  After database was recovered on Server_B application was not able to connect to database with error as "The database <Mirrored_DB> on server Server_BMSSQLSERVER is not configured for database mirroring".  My Question is
Why manual failover did not get back database on secondary server upwhy the original  connection string below is not able to connect to the database while database is online on Server_B  but without mirroring
 jdbc:sqlserver://<Server_A>MSSQLSERVER;databaseName=<Mirrored_DB>;port=1433;failoverPartner=<Server_B>MSSQLSERVER
We had to failover our primary db server for maintenance to our secondary replica. The primary was rebooted during maintenance. We failed back after the maintenance and one of the databases is not synchronizing.
I checked sys.dm_hadr_database_replica_states, and it is showing that it is INITIALIZING.
It has been in this state for more than 45 mins now. The last_sent_time, last_received_time, last_hardened_time and last-redone_time are all stuck with a time stamp 45 mins ago.
They haven't changed. How do i resume this database and bring it back in sync?
I tried suspending and resuming the data movement, but hasn't worked.
I'm trying to setup a SQL 2005 SP2 Mirror in between two mashines with no witness server.
I have successfully established the following:
1. Backup The Database on Principal Server: OK!
2. Copy the backup over to the mirror server: OK!
3. Restore the Database on Mirror Server: OK!
4. Establish Endpoint on Principal Server: Encyrption Disabled OK! TCP - PORT 5022
4.1 Test Script: Checks fine (values match)
SELECT e.name, e.protocol_desc, e.type_desc, e.role_desc, e.state_desc, t.port, e.is_encryption_enabled, e.encryption_algorithm_desc, e.connection_auth_desc FROM sys.database_mirroring_endpoints e JOIN sys.tcp_endpoints t ON e.endpoint_id = t.endpoint_id 5. Establish Endpoint on Mirror Server: Encyrption Disabled OK! TCP - PORT 5022
5.1 Test Script: Checks fine (values match) (same script as above)
6. Specify Principal server from Mirror server: OK! Connecting with IP
7. Specify Mirror server from Principal server: OK! Connecting with IP
8. View Mirror Information:
8.1 Test Script: Shows everything in NULL
SELECT mirroring_state_desc, mirroring_partner_name, mirroring_witness_name, mirroring_witness_state_desc, mirroring_role_desc, mirroring_safety_level_desc FROM sys.database_mirroring
Mirror endpoints are still in red even though they initialized correctly. Mirror monitor shows no mirrors are up. SQL Logs shows: The Database Mirroring protocal transport is now listening for connections. Any help would be appreciated.
I have a mirred database and have snapshot created from the mirroed database. I can do data selecting from the snapshot. But when the pricipal server is down , I can re-active the mirroed database.( I did succesfully upto this). Then I need to restore the database from snapshot and which failing with following error message.
Code Snippet Msg 5123, Level 16, State 1, Line 3 CREATE FILE encountered operating system error 3(error not found) while attempting to open or create the physical file 'E:sql_datadevitst_mirrorlog st_mirror_log.ldf'. Msg 5024, Level 16, State 2, Line 3 No entry found for the primary log file in sysfiles1. Could not rebuild the log. Msg 5028, Level 16, State 2, Line 3 The system could not activate enough of the database to rebuild the log. Msg 3013, Level 16, State 1, Line 3 RESTORE DATABASE is terminating abnormally.