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

All runs normally,But how can't be auto failover?

View 5 Replies


ADVERTISEMENT

Replication With Mirror Failover Issues

Aug 3, 2007





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,



Any help or suggestions are greatly appreciated.

View 14 Replies View Related

Will SQL Server 2005 Failover Clustering Still Work When The Database Level Is Set To 80?

Nov 2, 2006

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.

View 3 Replies View Related

Sqljdbc DriverManager.getConnection Hangs After Mirror Failover.

Aug 24, 2006

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)

/////////////////////////////////////////////////////////////////////////////
package testconnection;

import java.sql.*;

public class Main
{

/** Creates a new instance of Main */
public Main()
{
}

/**
* @param args the command line arguments
*/
public static void main(String[] args)
{
int i = 0;

while(true)
{
Execute(++i);

try
{
Thread.sleep(5000);
}
catch(Exception e)
{}
}

}

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");

while(rs.next())
{
System.out.println(" Record: " + rs.getString("Field1"));
}
}
catch (Exception e)
{
System.out.println(" FAILED");
e.printStackTrace();
}
}
catch (Exception e)
{
e.printStackTrace();
}
// Close the JDBC objects.
finally
{
if (stmt != null) try { stmt.close(); } catch(Exception e) {}
if (con != null) try { con.close(); } catch(Exception e) {}
}
}
}

View 15 Replies View Related

MSSQL Mirroring : Unable To Access Mirror After Succes Failover

Oct 16, 2007

Hello everybody,

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?

Hope to hear from you soon!

Thank you in advance!

Regards,
W.schmitt
The netherlands

View 6 Replies View Related

Mirroring :: How To Reduce LDF Size While Mirror Enabled With Mirror And Witness Server

Jun 14, 2015

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.

View 4 Replies View Related

Mirror Database-How Do I Remove It From Being The Mirror

Dec 27, 2006

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.

View 1 Replies View Related

SQL Server 2005 Failovery From Only Mirror DB

Nov 20, 2006

Hi Everyone;

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)?



Thanks in advance.

Senol Akbulak

View 6 Replies View Related

What Licensing Is Needed To Mirror A SQL 2005 Server?

May 7, 2008



Hello,

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?

Thanks!

View 3 Replies View Related

Mirroring :: Migrate Mirror Database To New Server

Apr 14, 2015

I need to migrate my SQL server Mirror Database to a new server. my current setup is as below

1. server A principal (192.168.1.100)

2. server B Mirror     (192.168.1.200)

Now i have a new server (Server C) to replace server B as below

1. server A principal (192.168.1.100)

2. server C Mirror     (192.168.1.300)

My question is how to migrate mirror db to new server without any affect or downtime on principal server.

note: SQL SERVER 2008R2 EE(64BIT), Win2008R2 EE 64bit.

View 5 Replies View Related

Not All Database Failover To Mirrored Database Server When MSSQL Service Stopped

Sep 4, 2007

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.

View 5 Replies View Related

SQL Server Admin 2014 :: AlwaysOn Failover Cluster Session Failover

Oct 29, 2015

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.

View 5 Replies View Related

Mirror And Witness Connection In A Disconnected State Immediately After Adding Witness Server To Mirror Session.

Jan 31, 2008


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?

Thanks,

View 9 Replies View Related

Sql Server 2005 Set Up Failover Cluster

Dec 12, 2006

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.

View 3 Replies View Related

SQL Server 2012 :: Mirror Database - Create Stored Procedure

Nov 5, 2014

I have a database which uses "Database Mirroring", and I need to write stored procedure and pull data from "Principal Server".

My Current Logic:

CREATE PROCEDURE abc123
as
BEGIN
IF Server01 = 'ONLINE'
BEGIN

[Code] .....

The problem I am facing is: Stored procedure is not created because "One of the server is not Online"...

View 4 Replies View Related

SQL Server Admin 2014 :: Can Use Different Index On Main DB And Mirror Database

Oct 31, 2015

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.

View 3 Replies View Related

Database Mirroring. Asp Application (IIS 6.0) Does't Forward Connections To Mirror Server

Mar 28, 2007

Hi!

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 :

PROVIDER=SQLNCLI.1;Server=ServerA,1433;Failover Partner=ServerB,1433;Database=MYDBNAME;Network=dbmssocn;Integrated Security=SSPI;

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

View 10 Replies View Related

Need SQL Server Failover Cluster 2005 Info

Apr 16, 2008



Hi all,

I need some help to known more about basics of SQL Server 2005 failover cluster . pls provide me link to
known the concept.
Thanks,
Nav

View 6 Replies View Related

Mirroring :: 2012 Database Mirror Missing Witness Server Information?

Oct 24, 2015

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.  

View 7 Replies View Related

Can I Mirror A Sql Server 2000 DB In Sql Server 2005?

Aug 2, 2007

Can I use Databse Mirroring to mirror a DB from 2000 in to Sql server 2005?

View 7 Replies View Related

SQL Server 2005 Failover Cluster Install Tips

Feb 8, 2008

I've never performed this type of installation. Any tips/ tricks you could provide would be greatly appreciated.

View 10 Replies View Related

SQL Server 2005 Failover Cluster Installation Hang

Jun 11, 2008

Hai -

Currently i am do sql server 2005 failover cluster installation on win 2003 server.

It is showing preparing to install please wait and there is no progress from last two hours.

Is there any way to check whether installation is going on or where can i check log files for this installation.

Please advise asap.

Cheers:)
vsh

View 7 Replies View Related

DSNLess Connection With Failover On SQL Server 2005 Cluster ?

Nov 20, 2006

Hi,

We have configured two SQL Server 2005 in a cluster (without Witness).

We have severals ASP (using ADO) that are connecting to SQL Server 2005 with SQL Native Client in a DSNLess connection String :

driver={SQL Native Client}; server=MAINMAIN; Failover Partner=BCKUPBCKUP; uid=log;pwd=pwd;database=MyBase

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 ?

Regards.



View 1 Replies View Related

DSNLess Connection With Failover To A SQL Server 2005 Cluster

Nov 20, 2006

Hi,

We have configured two SQL Server 2005 in a cluster (without Witness).

We have severals ASP (using ADO) that are connecting to SQL Server 2005 with SQL Native Client in a DSNLess connection String :

driver={SQL Native Client}; server=MAINMAIN; Failover Partner=BCKUPBCKUP; uid=log;pwd=pwd;database=MyBase

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 ?

Regards.

View 1 Replies View Related

Sql Server 2005 SP2 Unattended Install For Failover Cluster

Jan 17, 2008



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.

start /wait c:1sqlserversp2SQLSERVER2005SP2-KB921896-x86-ENU.exe /allinstances /quiet.

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


View 1 Replies View Related

Database Mirroring Vs SQL Server FailOver (Performance)

Mar 15, 2006

Hi there.

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 ?





View 8 Replies View Related

Cluster Failover Setup With Virtual Server 2005 R2 Sp1.. Question...

Dec 28, 2007



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?

Can anyone comment on this?

Thanks in advance.

View 4 Replies View Related

SQL 2005 Failover Cluster Installs But Sql Server Service Will Not Start

Nov 26, 2007

Hello all,

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

Privileges: -
Restricted Sid Count: 0
Access Mask: 0x4

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)..

View 5 Replies View Related

Mirroring :: Manual Failover Did Not Get Back Database On Secondary Server?

Jun 22, 2015

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

View 3 Replies View Related

SQL Server Admin 2014 :: AlwaysOn HA - Database Stuck In Initializing After Failover

Oct 23, 2015

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.

View 6 Replies View Related

Guidelines For Creating A Database Snapshot On A Mirror Database

Nov 24, 2006

Hi guys, can I know the steps on creating a database snapshot on a mirror database? Thx for the assistance. :)



Best Regards,

Hans

View 1 Replies View Related

SQL 2005 SP2 Mirror Setup

Mar 7, 2007

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.

View 1 Replies View Related

Recover Mirror Database From Snapshot Database

Feb 28, 2008

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.

View 7 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved