Quantcast
Channel: SQL Server High Availability and Disaster Recovery forum
Viewing all 4532 articles
Browse latest View live

preferred replica is not reflecting on Quering

$
0
0

Hello All,

Seeing a strange issue, when i tried to change Prefered replica from Secondary to Primary, and onrunning below query it is showing 0 on both the servers. i tried to refevert the change back to secondary still same issue. In UI it reflects, howeve when i try to query it shows 0 instead of 1

restarted SQL Services still same

SELECT d.database_name,

  sys.fn_hadr_backup_is_preferred_replica (d.database_name) AS IsPreferredBackupReplicaNow

FROM sys.availability_databases_cluster d

not sure if iam missing any other checks.

SQL Version: 12.0.5522

Thanks in Advance



Looking for the best Always On test battery possible?

$
0
0

Hi there,

we are setting up our DR between different DC is ongoing and we need to test from the scratch our Always On silo.

our schema is the following:

Datacenter A

Physical big monster live 1 <-synchronous-> Physical big monster live 2       <...... asynchronous.........>   Vm1<-synchronous->Vm2

Datacenter B

Vm1<-synchronous->Vm2

Vm1 and Vm2 from A will replicate against other couple of virtual ones in another B.

Does make sense?

Any link would be greatly appreciated!

Enric

SQL 2012 AG failover not changing possible owner during manual failover

$
0
0

Hi,

I/my group have been using AG's in production since CTP1 of SQL Server 2012. We're very well versed in AG behaviors but we have 1 environment that's picked up an odd misbehavior that does not consistently occur.

Some background. The cluster is small and has 2 sites: 2 nodes at site A, 1 node at site B. Node at site B has nodeweight=0x0. Quorum disk exists at site A. 2 FCIs exist between nodes at site A. 2 instances exist on node at site B. 2 AGs are configured; one from each FCI to an instance at site B. Overall, not entirely complex.

The issue we've run into is during patching. We orchestrate hands-on patching for our SQL servers to minimize any possible downtime. We're in .com retail, so we're very sensitive to downtime, planned or otherwise. We patch the inactive node, reboot it, then at a scheduled time we failover into it. The issue occurs post-failover.

Once the failover completes, sometimes the AG doesn't change owner, thus the AG never comes up and the status is resolving. There are no messages about the AG in the SQL errorlog. When reviewing the cluster behavior, we notice that both AGs have an owner of the previous node. We cannot fail the service over to the other node, as it is well known that SQL Server will set the possible owner tenet of the service to the intended operator.

We've got another latent issue - that I wont delve into on this post - that causes these services to failover every once in a while. Interestingly, in that scenario, we've never had an issue with it failing over to a new node successfully. This problem seems to be centered around proactive, manual failover events. What gives?

Update: Windows 2008R2 Ent Sp1 w/ latest/greatest, SQL 2012 Ent Build 6540

Update2: http://pastebin.com/gBM7xFL3 - the SQL errorlog during this 'issue'

AlwaysOn not AlwaysOn

$
0
0

Hi All,

I'm wondering if I have configured something wrong or if this is expected behavior.

I have three nodes configured to all be

Windows Server 2012 R2
SQL Server 2016 Enterprise SP1

Availability Mode: Synchronous Commit
Fail over Mode: Automatic
Primary Role: Allow read/write connections
Readable Secondary: Read-intent Only

I have set up the servers to have a load balance read only (READ_ONLY_ROUTING_LIST=(('Node1','Node2'),'Node3))) etc etc

I'm running some tests to see how the system behaves before we go futher with the idea of using AG

I have two console applications, 1 that inserts one row every second, and another that reads the top row every second (using ApplicationIntent=ReadOnly) both are set to use the listener, no direct connection to the nodes are being created.

if the nodes that i'm hitting are either being promoted to primary or demoted to secondary (in a manual fail over), then the connections to these are lost for around 5-15 seconds 

The node that is already a read only secondary and it not being promoted in the fail over remains connected and read requests continue.

Would you expect this to be the correct behavior for an AlwaysOn Cluster? or have I configured something incorrectly?

Migrar Sql Server Failover Cluster a una nueva SAN

$
0
0
Buenas tardes a todos, escribo para pedir alguna ayuda o guía. Requiero migrar un cluster SQL Server 2012 Enterprise Edition a una nueva SAN, esto debido a que mi SAN antigua se va a dar de baja por antigüedad, la verdad no se por donde comenzar, agradezco el apoyo de la comunidad.

Freddy Encinas M.

Steps to remove mount point tempdb LUNS from an existing Sql Server cluster

$
0
0

Hello, I have researched this already, but just wanted some confirmation before going through the motions as this is not a task we regularly perform. We moved all of our clustered instances' tempdb files to a local (non-shared) fusion IO drive on our existing active-passive 2-node cluster. The task now is to simply remove the Mount Point shared LUN from the cluster to give back the LUN to the Storage team. Below are the steps we plan to take. For those who do this task more regularly, do they look accurate? Thanks!

Step 1 - From Failover Cluster Manager on one of the nodes: Remove the tempdb drive dependency from the Sql Server Service for each clustered instance - Roles> Select One> Resources > Select the Sql Service at bottom > Rt click Properties > Dependencies > Find the dependency > OK Repeat for remaining clustered instances.. Step 2 - Take the disk OFFLINE or Maintenance Mode in FCM before doing step 3 Step 3 - From Failover Cluster Manager on one of the nodes: Remove the tempdb drive’s visibility to the Sql Server cluster - Roles> Select One> Resources > Select the Sql Service at bottom > Rt click > Remove from SQL Server (instancename)> should show Available Storage at this point Repeat for remaining clustered instances..


script to automatical force a manual failover?

$
0
0

Hi,

I'm looking for options to do a manual failover between 2 SQL Server 2012 in asynchronous mode.

So when my main server A become unavailable after X minutes, I want to automaticaly switch to my server B, which is in alwayson but an async mode.

I do not want to use the synchornous mode for performance reasons, my sever B is on a remote site and the latency between the 2 sites causes too many performance issues. so the ascynchronous mode is better for us.

and we are ready to lost some transactions.

my problem is to have an automated process to switch between the nodes in case of a crash instead of waiting for a DBA to receive an alert and manually do the switch (which can be long and I want my database available in the 15 minutes)

I found this:

https://blogs.msdn.microsoft.com/alwaysonpro/2016/01/14/enhance-alwayson-failover-policy-to-test-sql-server-database-data-and-log-drives/

does this script can be used to do what I want to do? or does this script still required an automated fail over option (and so a synchronous alwayson option)?

Cannot write to database after failover

$
0
0

Hi Guys,

I have alwaysOn on SQL server 2012. 1 primary and 2 secondary replicas. I have also setup the config below 

My problem now is ..when I failover from the primary server (EMR-SVR) to the secondary server in the same subnet (EMR-SVRII), the application is able to connect and to the database and view data. However, the application is not able to write to the database. I get an error that says the database is readOnly.

In the "Connections in Primary Role" tab, I have selected "allow all connections" Should I change this to "allow Read/write"? or is there something else I am missing. The database fails over but I am not able to write to it.

Thanks for all the help 

Richard


..forever is just a minute away*



Database revert from snapshot failed when I use Azure Blob storage

$
0
0
Please see details
 
 
SELECT @@VERSION
 
Microsoft SQL Server 2014 (SP2-GDR) (KB3194714) - 12.0.5203.0 (X64)
                Sep 23 2016 18:13:56
                Copyright (c) Microsoft Corporation
                Developer Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1) (Hypervisor)
 
User’s databases placed in Azure Blob storage.
 
Step 1
USE [master]
GO
 
CREATE DATABASE [MyDB]
ON  PRIMARY
( NAME = N'MyDB', FILENAME = N'https://***/MyDB.mdf')
LOG ON
( NAME = N'MyDB_log', FILENAME = N'https://***/MyDB_log.ldf')
GO
 
All is OK
 
Step 2
CREATE DATABASE [Snapshot_MyDB] ON (NAME = [MyDB], FILENAME = 'https://***/MyDB_Snapshot.ss') AS SNAPSHOT OF [MyDB]
GO
 
All is OK
 
Step 3
ALTER DATABASE [MyDB] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
GO
 
All is OK
 
Step 4
RESTORE DATABASE [MyDB] FROM DATABASE_SNAPSHOT = 'Snapshot_MyDB';
GO
 
Msg 5120, Level 16, State 145, Line 17
Unable to open the physical file "https://***/MyDB_log.ldf". Operating system error 183: "183(Cannot create a file when that file already exists.)".
Msg 3013, Level 16, State 1, Line 17
RESTORE DATABASE is terminating abnormally.
 
 
Is there any possibility to restore database from snapshot?
Is it a bug?

Should Activity Group Databases Not Automatically Start Re-synchronizing after failover?

$
0
0

When I failover during testing (SQL Server 2016) I am noticing that my AG databases stop synchronizing across all servers.  Do I manually have to go tell them each one of them to start re-synchronizing every time on each replica everytime I perform a failover?  I have quite a few databases and the list grows daily.

fyi-  My current setup is 2 synchronous replicas and 1 asynch replica.

Is There An AlwaysOn Activity Group Log? I want to see which server was primary when

$
0
0
Is there a way/single place to look to see when failovers have occurred to see which server was the primary and when for an availability group?  The only way I have found is look at separate logs on each server.  I am hoping there is a better/easier way!

Always On Clustering - Setup and Best Practice

$
0
0

Hi

I am very new to using Always On, currently we are using mirroring between our SQL servers.

One thing I'm having trouble getting my head around is the clustering of the servers, especially as our SQL servers are VM's.

My current setup has 3 Hyper-V hosts clustered for HA and the SQL VM's are sitting on these.

My question is, does Always On require a cluster setup on the SQL machines themselves? And if so how will this cause me any issues with my HA cluster on the Host machines?

Pete

heavy Blocking in alwayson availability groups - synchronous-commit

$
0
0

Hi ,

Can someone please help me on how to Avoid blocking in alwayson availability groups - synchronous-commit?

 I did Set Up Alwayson Availability Groups- Synchronous commit, 1 readable secondary,Backups on primary

I have 2 Servers A(primary), B(Secondary) 1 mile away from primary, both are physical boxes with 16 CPU, 250+Memory and Good Disks-never had any performance problems....

We moved Server B secondary  to a different location 15 miles away from primary and after 2-3 weeks we started having BLOCKING problems and making all applications break.. spoke to network and sys engg team and they  say ALL good from their end n/w is up and healthy,  and then once i changed the Synchronous mode to ASYNC mode  everything works good no issues found since 1 month, now we are planning to change back to SYNC mode as we want automatic failover, I am Afraid that blocking might be causing again.. can someone please help me understand how to solve the blocking issue ..

as of now, we have 16 database, 500GB ins size total, Availability mode=Async commit, Failover =manual, connections in primary role=Allow all connections, Readable secondary=yes , session timeouts=10( both for primary and secondary)

Thanks,

Windows 2012 R2/SQL 2016/Block Storage - Availability Options

$
0
0

Hello,

I have been tasked with building a Highly Available SQL server. This server will be the database used for a Citrix DaaS environment. Always on SQL is not necessarily required, but an extended outage is not acceptable.

I have 2 nodes: Node 1 and Node 2 - I have configured MS Fail over cluster on both Nodes.

I have available 500GB Block storage that has been presented to both nodes.

I have configured my cluster and gone through validation, but validation states: "No disks were found on which to perform cluster validation tests"

The disks are online in the Cluster management console.

My question, do I need to have a failover cluster if I am using block storage? My drive is a block storage volume that has its own life cycle management. Database files that are stored in block storage can easily be moved to another SQL Server in case of disaster.

Is there any advantage in using the recover ability of block storage and the availability of MS clustering? 

Many Thanks,



Always on secondary replica out of sync

$
0
0

Hi,

I am on SQL Server 2014 Always ON configured with three nodes. Two nodes are configured as synchronous commit and one node is configured asynchronous commit.

The secondary node which was configured as synchronous commit is out of sync due to some VMHOST issue. I want to find how long can I stay in this state.

How can I predict the log size requirements for the the primary replica? If I am able to predict the amount of log size generated, I will be able to predict how long can I have the secondary replica in this state. 

I know the general recommendation will be to remove the secondary replica, so that the log will be truncated.

Any suggestions??

Regards,
kccrga


-kccrga http://dbatrend.blogspot.com.au/



Log shipping copy and restore jobs are failing.

$
0
0

Hi 

I am setting up log shipping from SQL server 2012 to SQL server 2014. Configuration went successful also secondary db initialized and setup correctly . However LSCopy and LSRestore jobs are failing with below error.

*** Error: Could not retrieve copy settings for secondary ID '18b7e302-26bc-4483-beda-87896af67568'.(Microsoft.SqlServer.Management.LogShipping) ***
*** Error: The specified agent_id 18B7E302-26BC-4483-BEDA-87896AF67568 or agent_type 1 do not form a valid pair for log shipping monitoring processing.(.Net SqlClient Data Provider) ***

*** Error: Could not log history/error message.(Microsoft.SqlServer.Management.LogShipping) ***

 Error: The specified agent_id 18B7E302-26BC-4483-BEDA-87896AF67568 or agent_type 1 do not form a valid pair for log shipping monitoring processing.(.Net SqlClient Data Provider) ***

Full control to SQL agent service accounts are on backup folders.

Any idea what may be the issue?

Read off the secondary readable replica fails in a alwayson cluster

$
0
0

Hi there,

I use System Centre Operations Manager 2012 R2 and I use an always-on SQL cluster for the backend.

Issue I have here is even though the secondary replica is configured as readable but every time I failover to secondary SCOM loses its connection to the database with the following error

SCOM version: 2012R2 RollUp 9

SQL version: 2012

SQL 2012 protect Merge Replication Publisher

$
0
0

Hi all, we are designing a DR solution for one of our customers and we need some help.

We will have 2 Win2012R2 Hyper-V Servers connected to a SAN. We will setup a 2-node Win2012R2 Guest SQL 2012 Std Failover Cluster. We will use merge replications with 4 subscribers (SQL 2012 Std) for some branch offices. We want to protect our publisher in case of disaster. So we intend to have another Wind2012R2 Server with SQL2012Std  on different infrastructure (on the same building).

What kind of protection (log shipping, mirroring)  should we use for the published database and also for the system databases (master, model, distribution etc)?

Thank you in advance, George

Configure Always On SQL Server 2016 With Cross Domain

$
0
0
Hi All,

I have 2 SQL Server 2016 EE one is in my local data center and another one is on the cloud. users accessing local data center. now I want to configure always on between local server and cloud server for DR and HA purpose. both servers are not in same domain. so kindly suggest how to configure always on.


-‌‌‌- Ragu Thangavel

Ragu Thangavel

SQL Server 2016 Managed Backup to Azure - On demand backup fails

$
0
0

We are running SQL Server 2016 Std edition in Azure, and have configured Managed Backup (previously SmartAdmin from 2014).

When running the backup on demand stored procedure, one of our databases fails with the following message:

EXEC managed_backup.sp_backup_on_demand @database_name = 'mydatabase', @type = 'Database'

Msg 45202, Level 17, State 3, Procedure sp_add_task_command, Line 65 [Batch Start Line 37]
Timed out after 120 seconds waiting for Smart Admin job to complete. Please run the stored procedure again.

We are patched up to SQL Server SP1 + CU1.

What gives?

Viewing all 4532 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>