Failover Not Work When Principal Server Is Down

Aug 7, 2006

Hi,

Here is my testing environment:

Database server: SQL Server 2005 Developer Edition with SP1
Application: An application developed by Visual Studio 2005 using C# (.Net framework 2.0) and ADO .Net 2.0.

Principal server: computerA
Mirror server: computerB
Witness server: computerC
Mirroring mode: High availability with auto failover

Connection String:
Data Source=computerA;Failover Partner=computerB;Initial Catalog=test_mirroring;Persist Security Info=True;User ID=sa;

Code used for failover:

while (true)
{
thisDataSet = new DataSet();

try
{
thisConnection = new SqlConnection(connectionString);
thisAdapter = new SqlDataAdapter(SQL, thisConnection);
thisAdapter.Fill(thisDataSet, name);
break;
}
catch (SqlException e)
{
thisConnection = null;
thisAdapter = null;
thisDataSet = null;
}
}

Test Case:

(Part A) At the beginning of the test, computerA was in principal role. I started my testing application and connected to computerA without any problem. Then I disconnected the connection of computerA to the network by unplugging the network cable of computerA. The failover of database from computerA to computerB was carried out without problem. computerB was in principal role at that time. The application was pending for about 45 seconds and running again without problem. Then I re-connected computerA to network and it became the mirror server. computerB was still in principal role. Up to this point, all works fine, but the problem was coming next. (Part B) I disconnected computerB from network, database failover occurred, computerA became principal again. But my application cannot switch the database connection to computerA and then kept pending. Then, I re-connected computerB to network. It was surprised that the application switched the database connection to computerA successfully at that point.

My questions:

1. I think Part B is abnormal, isn€™t it? The application should be able to failover from computerB to computerA, because it works fine when failover from computerA to computerB.
2. Is there anything wrong in my code leads to the abnormal behavior of the application in Part B.
3. How can I achieve Part B? Any suggestion or idea?


Thanks for your attention.

View 6 Replies


ADVERTISEMENT

How Can Initiate A Failover If The Principal Server Is Offline?

Feb 27, 2008



Say i create a mirroring for a database without witness server, if the principal server is offline, can i make the mirroring database online?

thanks in advance.

View 7 Replies View Related

Login Failed Connecting To New Principal After Failover

Jan 2, 2007

Hello,

I have setup database mirroring on two Windows 2003 R2 x64 servers using SQL Server 2005 SP1 Developer Edition. Our application is connecting to SQL Server using a SQL Server login. The application is using ADO and SQL Native Client to connect to the server. After a failover, our app attempts to reconnect to the database. The reconnect fails with the error:

Cannot open database "db1" requested by the login. The login failed.

The login is not associated with a user in the new principal database. I run sp_change_users_login to reconnect the user and login. sp_change_users_login says that it fixed 1 orphaned user. Our app then reconnects successfully.

I have tried several failovers, and each time I see the same behavior. The association between the login and user gets lost.

The issue is definitely with the login. I tried using sa to connect to the database, and then our app was able to reconnect after a failover.

Is this a known issue with database mirroring? Is it fixed in SP2?

Thanks,

Heather

View 3 Replies View Related

Code To Programmatically Failover A Principal Database.

Mar 12, 2008



Hi Guys,
I was wondering if there is a system procedure / T-SQL code to programmatically Failover a Database from Principal to mirror mode?

also,
We noticed that at times few of all the databases that were kept on 'Principal' mode get randomly 'Failover'. Does anyone have any idea?

If so, pls respond.

Thank you.


View 9 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

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

Principal Db In Principal, Synchronizing State, The Mirror In Restoring State

Sep 26, 2007

We have mirroring setup for 5 dbs, 4 of which are synchronized and 1 which is in "synchronizing" state on the principal and "restoring" state on the mirror. Mirroring for all dbs has been working fine for the past several months and we have a witness that has allowed automatic failover in the past without problems.

This database has several bulk inserts performed throughout the day and am sure there is some latency due to the size of these transactions.

Not sure as to why this is happening all of a sudden, but the db in question has been in this state for the past 12 hrs. I checked the mirroring status on the principal and it states that it is "synchronizing: data is being transferred from principal to mirror", but the mirror server states that db is in "restoring" state. Can anyone suggest as to how I can get the database on the mirroring server to get back to "mirror, synchronizing/restoring..." state? Or suggest on how I can troubleshoot this?

Thanks in advance.

View 3 Replies View Related

Server Principal Already Exists

Jul 7, 2014

I have deleted a windows login user under security in SQL 2012 Management Studio. The users have also been removed from the associated databases. When I try to add back the login, I receive the message 'The server principal 'xxxx' already exists'. What do I need to do so that I can re-add the login ?

View 1 Replies View Related

Cannot Use The Special Principal 'sa'. (Microsoft SQL Server, Error: 15405)

Dec 31, 2007

Hello All, I'm hoping someone else has run into this, because I can't find any posts about it that are helpfull.
I just updated our Dev SQL 2005 db to be able to use new 2005 key words with the script:
 EXEC sp_dbcmptlevel 'myDbName' , 90 
This is all well and good until I notice my sa account no longer has a user mapping to my database. In managment studio when I go to Security - Logins - and sa properties If I try to add user sa to my Db I get the following errors:
>>>------------------------------------------------------------------------------------------------------------->>>
 Create failed for User 'sa'.  (Microsoft.SqlServer.Smo)
Cannot use the special principal 'sa'. (Microsoft SQL Server, Error: 15405)
<<<-------------------------------------------------------------------------------------------------------------<<<
I'm access the SQL Server through a client on my local machine, the Server is set to mixed authentication, actual check box is labeled Sql Server and WIndows Authentication Mode. Hopefully I'm just doing something dumb, which is highly likely since I'm a developer and not a DBA.
Thanks in advance

View 2 Replies View Related

No Failover And Client Crashes ODBC DSN Setting For Failover In Connection String

Mar 3, 2007

We have set up Mirroring with a witness server and everything works fine when we failover from the SQL Management console.

However, if we failover when our Maccola client is connected, the client blows up - clearly because it can no longer connect to the database.

The ODBC DSN used by the Maccola client shows a checkbox for the 'select a failover server' but the checkbox is grayed out.

Also the summary of settings for the DSN at the end of the wizard reveals that the failover to server (y/N) option is set to N.

The default setting for this DSN is 'populate the remaining values by querying the server' but it doesn't appear to be getting the settings for failover from the server or any other interactive DSN settings either. The server is clearly set for mirroring.

Another suspicious item is that the DSN cannot connect to the server with SA permissions, even though the server is set to mixed security and we use the correct authentication.

Is it possible that the client MACHINE is not authenticating with the domain or sql server properly. We are logged into the client with the domain account that is the SQL admin account on the sql server box.

We should be able to interact with the sql server settings through the ODBC DSN on the client shoulnd't we?

Are we missing a service pack on the client?

Thanks,

Kimball

View 1 Replies View Related

Recovery :: AlwaysOn Failover Cluster And Active Sessions Failover Scenario

Oct 29, 2015

1. In alwaysON fail over cluster, 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 3 Replies View Related

The Server Principal XYuser Is Not Able To Access The Database Ydb Under The Current Security Context

May 23, 2007

SQL2005 on winserver 2003. I have a view in Xdb that accesses tables in 2 different databases (Xdb and Ydb) on the same server. I have mixed mode security. I have a SQL user (XYuser) that has read access to all tables and views on both databases, yet when I try to access the view using a C# windows application I get the following error:



The server principal "XYuser" is not able to access the database "Ydb" under the current security context



This same scenario works under SQL 2000. I looked through the postings and tried to set TRUSTWORTHY ON on both databases but that didn't help. I can access any other views or tables on the SQL 2005 server, just not the one that joins the tables cross databases. Any help is much appreciated... john

View 17 Replies View Related

Windows Server Principal Denied Access To Database Under Current Context

May 1, 2007

Hi guys. I created a database "MyDatabase" using an AD Account "user01" which is a member of a domain group "GroupA". I have created a login in my SQL Server 2005 for this AD group. I have also added the said login as a user of my database. I created other AD users and put them in the same group. When I try to access the database using the other users, I get this message

The server principal "MyDomainuser02" is not able to access the database "MyDatabase" under the current security context.

This KB tells me that my situation is triggered by the first case in which the owner of the database is windows authenticated. I have already set the database to be TRUSTWORTHY. I haven't tried CERTIFICATES though. I believe I haven't done anything complex to warrant this solution.

I'm really lost with the myriads of principals and securables that SQL2005 has. All I want is just to execute a certain set of stored procedures. I can't do this because I can't even execute "USE MyDatabase". What are the permissions I need to give to "GroupA" ?

View 5 Replies View Related

SQL Server 2005 Express: The Database Principal Owns A Schema In The Database, And Can Not Be Dropped.

Jan 11, 2006

I recently added a new user to my database.  Now I want to delete that user, but I keep getting the error above.  What do I need to do to delete my recently added user?

View 4 Replies View Related

SQL Server Failover:

Jan 22, 2007

 
I have to figure out a way to handle a failover in SQL Server 2005. I was reading a few articles about it.
1. Do I need to do anything in application layer to let a failover occur in SQL Server 2005
2. I have a web site that connects to a production server, the connection string is defined in web.config. If I implement Mirroring in SQL Server 2005, and when failover occurs, shouldn’t I change the connection string to point the application to the new server?

View 2 Replies View Related

SQL Server Failover:

Jan 23, 2007


I have to figure out a way to handle a failover in SQL Server 2005. I was reading a few articles about it.
1. Do I need to do anything in application layer to let a failover occur in SQL Server 2005
2. I have a web site that connects to a production server, the connection string is defined in web.config. If I implement Mirroring in SQL Server 2005, and when failover occurs, shouldn€™t I change the connection string to point the application to the new server?

View 1 Replies View Related

Cannot Use The Special Principal 'sa'

Aug 29, 2006

Hello,

I am starting to use SQL Server 2005. I am having trouble connecting remotely. I tried to enable the 'sa' user and got this error:

Cannot use the special principal 'sa'

Is the 'sa' user no longer valid for remote connections?

Thank you





View 11 Replies View Related

SQL - Clustering For Failover SQL - Server

Sep 24, 2002

Hi all,

We are the studying the possibilty of implementing SQL - Clustering for
Failover server.

Are there any third party tools readily available.
Any suggestion or checklist ??

Any suggestions or comments will be appreciated.

Thanks and have a great day.

View 1 Replies View Related

Replication :: Server 1 And Server 2 In Mirroring Relationship With Automatic Failover

Sep 24, 2015

I'm looking at a setup where they have server1 and server2 in a mirroring relationship with automatic failover. 

Server1 is the principalThey are using transactional replication to replicate asingle databse to server3 is AWS.Distribution database is on Server1All Agents (log reader, snapshot, distributor) run on Server1Server2 has not been set up for replication...My understanding is that in this set up you would normallly place the distribution database on a separate server and enable publication on the mirror, Server2.

What happens if they failover? Replication would stop, and presumably records added while the mirror is the active database would not be marked for replication?How would they recover?  Failback and reinintialize

View 3 Replies View Related

GRANT .... AS &&<database Principal&&>

Apr 19, 2008




I am trying to grant various users permissions and am using the following sql command


GRANT Delete ON Resident TO hector AS barbara


barbara is a member of the fixed server role sysadmin and has Delete permission on the Resident table.

I log in to the server as barbara and try and execute this command and get:
Msg 15151, Level 16, State 1, Line 1
Cannot find the object 'Resident', because it does not exist or you do not have permission.


If I just run

GRANT Delete ON Resident TO hector

then everything works fine but the grantor is then dbo. I want to be able to have it recorded that barbara was the one that actually gave hector permissino to delete on the Resident table. Is there a way to do this?

View 2 Replies View Related

Principal To Proxy Problem

Aug 8, 2007

I can successfully execute my package via Business Studio but when I schedule it in SQL Agent I get the error message, 'could not get proxy data for proxy id = 2.' I am trying to execute the scheduled job with that proxy (call it abcd_proxy) because I have a logon id (call it abcd) with access to a specific network drive folder, which holds a required source flat file. The abcd logon is defined as a sysadmin account. I am unable to see that the abcd logon id is an added principal within the abcd_proxy, which I think is because the abcd logon principal has a sysadmin role. My proxy id = 2 definition looks to be defined the same way that my first proxy id was.

Does anyone have an idea about what the message means and how I can fix it?

View 1 Replies View Related

Not In Correct State To Become Principal

Jan 4, 2006

I am using asynchronous mirroring. When I try to failover on the mirror server using €śalter database xxx set partner force_service_allow_data_loss€? (having disconnected the primary server from the network) it sometimes fails to failover (it reports that the database is not in the correct state to failover). I can re-connect the primary server, get them sync€™d again, then unplug the primary and it will failover ok.

Any ideas... or is this just an issue that will be fixed in the next SP?

View 5 Replies View Related

How To Only Backup Principal, Not Mirror

Apr 13, 2007

I have a Server Agent Job that does a full backup of my principal database. I then have a separate job which does an incremental backup of the log files every 20 mins throughout the working day - the incremental backup sends me an email if it fails.

If I establish a failover to the mirror server, the backups continually try to run, sending me an email every 20 mins telling me that it can't back up the database as it's a Mirror.

Is there any way to script a method in the job that checks to see if the DB is a principal or mirror. if it's a principal I want the backup to happen, if it's a mirror I want it to skip the job.

Thanks in advance to anyone that can help

Niels

View 8 Replies View Related

One Node Could Not Up In Server Failover Cluster

Jul 23, 2015

We have 2 nodes window Server 2012 R2 and SQL Server 2012 Enterprise Version cluster setup. We can switch roles and Node to one node to another and revert back to previous node with out any issues. But we are facing when one Node is restarted. We could not restart that Node in cluster Service start in Failover cluster Manager. Error Details is displayed as below inside double code."Cluster node NODE1 could not to join the cluster because it failed to communicate over the network with any other node in the cluster. Verify the network connectivity and configuration of any network firewalls."

I checked windows firewall. windows firewall is all of in Node1, Node2, SAN and DC.I have disabled and enabled the Internal and private network of Node 1. I have validated the cluster. it is showing no error though.

Node1:
Public IP: 10.10.0.11
SubNet Mask:255.255.255.0
Default Getway: 10.10.0.1
Prefered DNS: 10.10.0.10 (Ip of DNS)

[code]....

Private Network: Not configured.pinging to each other ip is successful from one node to another.

View 9 Replies View Related

Mirrored Linked Server Failover.

Sep 18, 2006

We have a mirror setup, with a third server that needs to be linked to this mirrored setup. The link server setup only allows you to specify the primary server. How will the linked server setup know what the secondary server is? Thanks

View 1 Replies View Related

Mirrored Linked Server Failover.

Sep 18, 2006

We have a mirrored db setup, with a third server that needs to be linked to this mirrored setup as a linked server. The link server setup only allows you to specify the primary server. How will the linked server setup know what the secondary server is? Thanks

View 1 Replies View Related

SSIS Service Not Available On A/P Failover Server

Dec 17, 2007

Greetings,
Ever since our sql2005 A/P failover cluster failed over to the 'B-passive node', I have a failing SSIS scheduled job with a 'missing component' error. While verifying services in computer management and sql surface area config, It appears that the SSIS service is not available because its not listed therefore cant be started. I have examined both nodes and the primary "A-active node' shows the SSIS service but the passive node unlisted. The server has failed over before during normal scheduled updates and sevice pack installs however this is the first occation we have not failed back to the primary node for normal operation. Any ideas or clues would be appreciated.

View 6 Replies View Related

SQL Server Failover Clustering Licensing

Mar 14, 2008



I have 2 Windows 2003 r2 servers with a SQL failover cluster installed across the 2 node. Generally I have been running off node1 with node2 as the failover partner. I have purchased the correct licensing for noe1 and from the following I do not need to purchase a license for node2:


Failover clustering is a process where the operating system and SQL Server 2005 work together to provide availability in the event of an application failure, hardware failure, or operating-system error. Failover clustering provides hardware redundancy through a configuration in which critical resources are transferred automatically from a failing machine to an equally configured server to help ensure continuity of service.


When doing failover support, a server is designated as the passive server. The purpose of the passive server is to absorb the data and information held in another server that fails. A passive server does not need a license if the number of processors in the passive server is equal to or less than the number of processors in the active server. The passive server can take the duties of the active server for 30 days. Afterwards, it must be licensed accordingly

http://www.microsoft.com/sql/howtobuy/activepassive.mspx

My questions are:


1) If I switch my cluster instace to point to node2 for testing node2 in case of a failover, would I need to purchase another licence ? This means I am not doing the repointing because of an 'event of an application failure, hardware failure, or operating-system error' ? Can you please provide information from MS ?


2) How are SQL Licences bound to the windows install in a SQL Server failover cluster configuration ? For instance if node1 legitimately fails due to an 'event of an application failure, hardware failure, or operating-system error' and you failover to node2. Then you think, stuff (forget about) node1 as I have 1 set of licences for SQL Enterprise already and therefore can run with a legitimate licence on node2. Can you please clarify ?


3) I have heard that only one server needs a license in a failover cluster. Then how does this fit in with any of the questions from above:

'The passive server can take the duties of the active server for 30 days. Afterwards, it must be licensed accordingly' ?

In the event of a legitimate failure, node2 would be running off the license purchased. So why are MS restricting the use of it for 30 days ?

View 5 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

Error With Linked Server After Failover

Feb 22, 2007

Hi all,

The following query that uses a linked server is giving me the error message below after I initiate a failover (ALTER DATABASE Northwind SET PARTNER FAILOVER). I have SQL Server 2005 SP2. I think that without the service pack there is another error too.

The query is run from a database other than northwind of course.
select * from DualLink.northwind.dbo.Test1


Please note that:
without a failover it works perfectly
it always work if I try to run it a second time - only the first time it fails.
it fails the first time for each of the open connections. A new connection that was open after the failover will work fine.


A transport-level error has occurred when sending the request to the server. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)

A transport-level error has occurred when sending the request to the server. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.)

The linked server is defined as

EXEC master.
dbo.sp_addlinkedserver
@server = N'DualLink',
@srvproduct=N'',
@provider=N'SQLOLEDB',
@catalog=N'northwind',
@provstr=N'Server=(local);FailoverPartner=MyIPAddr;'

EXEC master.dbo.sp_addlinkedsrvlogin
@rmtsrvname = 'DualLink',
@useself = false,
@locallogin = 'sa',
@rmtuser = 'sa',
@rmtpassword = 'MyPwd'

Thanks,
Avi

View 1 Replies View Related

Explanation Wanted About The Service Principal Name ( SPN )

Jun 26, 2007

Hello,



In the ErrorLog of my Sql Server , i found this line :

2007-06-26 05:35:18.37 Serveur The SQL Network Interface library could not register the Service Principal Name (SPN) for the SQL Server service. Error: 0x54b, state: 3. Failure to register an SPN may cause integrated authentication to fall back to NTLM instead of Kerberos. This is an informational message. Further action is only required if Kerberos authentication is required by authentication policies.


Operating System XP Home SP2

SQL Server 2005 Express Edition with Advanced SP1 )



( idem for another workstation with XP Pro SP2 and same version of SQL Server 2005 Express



My problem is :

i want use the windows authentification but my computers are on Worhkgroup linked by a router ( no window server )

i have read that's possible to connect from a remote computer to a computer having a SQL Server 2005 Express through SPN

How can i do it ? ( activating NTLM ? but how ?)

I'm writing a C# program which must be executing on several computers with a SQL Server 2005 Express installed on a particular computer. These computers will belong to a domain of Windows Server 2003.

As i can't connect to this "normal" network, i am trying to simulate this network at home because i want to test this program and especially the possible locks problems.

I don't know whether i'm querying with the "correct" forum.

Sorry for my poor english.

I shall appreciate any help about this problem

Have a nice day

View 1 Replies View Related

Principal 64Bit- Member On 32Bit

Dec 14, 2006

Hi all,
I've got two VLDBs on 64bit hardware platform + 64Bit-W2003K Std R2 + 64Bit SQL2005 Std Edition.
If I set this guy up as the Principal, can I have the standby/member on 32Bit HW + 32Bit W2003 Std + 32Bit SQL2005?

Will this actually work?

Regards,
Uday Shivamurthy

View 4 Replies View Related

In What Situations Principal Database Might Become Unavailable ?

Dec 13, 2006

Is it correct to say

in any case exept when data or log file not available pricipal db will be availabe

and manual failover could be done only from from principal?











View 1 Replies View Related







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