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

Unable to set up Mirroring in EC2 instance

$
0
0

I am trying to set up High Safety Mirroring  without automatic failover in 2 EC2 instances for my client.

These instances run on 64 bit Windows Server 2012 R2 and have SQL Server 2014 Standard Edition.

While creating the second EC2 instance the hostname was identical to the the first EC2 instance. The system administrator changed the name of the host so that Principal and Mirror have different hostnames.

I used sp_addserver to change the name of the instance to match the host name and dropped all rows from the sys.sysservers in the Mirror instance.

Now when I try to start mirroring I get the error "The server network address "....." can not be reached or does not exist. Check the network address name and that the ports for the local and remote endpoints are operational. (.Net SqlClient Data Provider)" and the mirror database's status changes to 'In Recovery' from 'Restoring'

I was using port 5022 so verified that the port was open and listening. Also Windows firewall has been turned off on both the instance. I am able to connect to Mirror from Principal using the hostname of Mirror from Management Studio and Vice Versa. Even I the t-sql statement  

ALTER DATABASE [<dbname>] SET PARTNER = 'TCP://<PrincipalHostname>:5022' 

runs fine on Mirror.

Its when I run the statement

ALTER DATABASE [<dbname>] SET PARTNER = 'TCP://<MirrorHostname>:5022' 

I get the error.

I tried the steps listed in https://social.msdn.microsoft.com/Forums/sqlserver/en-US/71961bdf-a9f3-4cb6-84ef-cb2e3afd6194/database-status-principal-disconnected-network-address-can-not-be-reached?forum=sqldisasterrecovery but wasn't able to set up mirroring.

I asked my sysadmin to create a separate EC2 instance so that I can configure mirroring over there. The new Mirror instance that was created allows me to connect to the Mirror from Principal(and vice versa) using Private IP and Not hostname. This time I get the same error while trying to execute the statement on the Mirror 

ALTER DATABASE [<dbname>] SET PARTNER = 'TCP://<PrincipalIP>:5022' 

The following statement executes successfully in the Principal

ALTER DATABASE [<dbname>] SET PARTNER = 'TCP://<MirrorIP>:5022' 

Please share some ideas to resolve this.


Prasenjit Gupta DBA Tata Consultancy Services Ltd.


3 node alwayson cluster

$
0
0

Hi Experts,

I need to setup a MS-SQL 2012 alwayson setup with the mentioned specification:

1. 3 node windows cluster, 2 nodes in DC1 and 1 node in DC2. OS is Windows 2012 standard

2. One clustered instance in DC1 and one standalone in DC2.

3. There is no sharing of storage between DC1 and DC2,

4. Have an option of adding a file share at DC3 which is accessible from DC1 and DC2.

Please guide me how to go about the quoram model for this cluster so that if the 2 nodes in DC1 fail, the cluster is up on third node in DC2 with alwayson availabilty group accessible.


Recovering Backup Server with Log Shipping

$
0
0

I have two SQL 2014 servers, one main production server and one backup server.  

I have successfully implemented log shipping from the main to the backup.  Now that I have that set up, if the main server goes down, how do I get the backup server up and running?

Thanks in advance.

Same database for failover and reading

$
0
0
I have 5 databases that need to stay together. Can I have a replica on a secondary server that is not just a hot failover but is also readable? That way I would have to have two copies.

Alan

SQL HA Availability Groups in MS Azure IaaS

$
0
0

I have a SQL 2012 R2 HA configured in Azure Iaas VMs, using Availability groups. it has 2 SQL nodes & 1 Listener server (in ILB) under same cloud service. Currently I have only one SQL named instance.

There is a customer requirement that, they wanted multiple SQL named instances in those two SQL nodes, and they need to be in Availability groups.

It is already known that 'Only one availability group listener is supported per cloud service' . Now If I create new named instance & create a new Availability group - how to attach the listener there ?

If Azure doesn't support multiple listeners per cloud service - how to deploy this kind of requirement & what are best possible options ? is there any roadmap to support this ?

if Client wants to stick to the options of multiple named instances on these nodes  (like on-premise) - what is best option here ? Deploying them on different set of servers will increase the cost.

Thanks for your suggestion here.

Help on Jobs in ALWAYS ON AVAILABILITY GROUPS

$
0
0

I have Setup Always on Availability Groups between 2 servers( 1 active  server read/write and 1 passive not readable )and i have a Script that i wanted to put in Jobs and i want to run the jobs only on primary at any time..

Server 1 is primary---jobs check if primary , if yes execute the job

Server 2 is secondary--Jobs check if primary, if no then exit from job ....

when failover happens 

Server 1 is secondary--Jobs check if primary, if no then exit from job ....

Server 2 is primary---jobs check if primary , if yes execute the job

so i am using below scripts to test with a TESTDB database which is Read/;write on primary and not readable on secondary..

jobs runs well at Primary , but on secondary it fails ... 

USE MASTER 
GO
DECLARE @ServerName NVARCHAR(256)  = @@SERVERNAME 
DECLARE @RoleDesc NVARCHAR(60)

SELECT @RoleDesc = a.role_desc
    FROM sys.dm_hadr_availability_replica_states AS a
    JOIN sys.availability_replicas AS b
        ON b.replica_id = a.replica_id
WHERE b.replica_server_name = @ServerName

IF @RoleDesc = 'PRIMARY'



BEGIN
USE TestAG
Insert into CheckAvailabilityRoleJobs(InsertDate,ServerName,RoleDescription)
SELECT GETDATE(),@@SERVERNAME, a.role_desc
FROM      sys.dm_hadr_availability_replica_states AS a
JOIN sys.availability_replicas AS b ON b.replica_id = a.replica_id
where   b.replica_server_name=@@SERVERNAME
END


ELSE 

BEGIN 

      RETURN   
END 

I wanted to keep this job running 24X7 on both servers, but insert happens only on Primary at any time , in secondary the JOB exits with out actually inserting...

the script  is running good on PRIMARY, but when i try to run on SECONDARY it is failing ...

the script should actually exit on SECONDARY after checking Primary or not but it is trying to connect TESTAG database which is not accessible on secondary

Msg 976, Level 14, State 1, Line 16
The target database, 'TestAG', is participating in an availability group and is currently not accessible for queries. Either data movement is suspended or the availability replica is not enabled for read access. To allow read-only access to this and other databases in the availability group, enable read access to one or more secondary availability replicas in the group.  For more information, see the ALTER AVAILABILITY GROUP statement in SQL Server Books Online.

any help?

 

Set synchronization time from primary replica to secondary replica.

$
0
0

Hi All

As per our client requirement we want to set synchronization time from primary replica to secondary replica after 20 minutes. Is it possible in MSSQL AlwaysOn Availability Groups in SQL Server 2012?

 

Rgds,

Inder

JMD

Licensing for Clustering with Logshipping

$
0
0

Hi,

We want to setup SQL 2012 (Active/Passive) cluster for new client. In addition we plan to setup DR using log shipping at remote site. I know that in Active/Passive cluster licenses are required for Active node only, also in case of DR using log shipping/mirroring we do not require license for secondary if we are not using for any reporting or backup. But in this combination I will be using Active/Passive cluster at primary and DR using log shipping. So I will need to procure license only for Primary or DR as well.

Thanks in advance.


Difference between SQL server 2012 Cluster Always on with Disk sharing and mirroring

$
0
0

Hello,

Can someone help me to understand the advantage/disadvantage or difference between Always on with WSFC disk sharing and Mirroring ?

Thanks,

Karthik R


Karthik R

Availability Group latency query.

$
0
0

Greetings. I want to start tracking, and eventually alert on excessive AG latency. I've taken most of the query from this link and also modified it a bit to come up with the query below. However, it's not behaving quite as I'd expected. To test this I shut down the Secondary node in my AG. While the syncState and syncHealth values do change immediately when I rerun the query, no other values do. So my "seconds behind primary" values never gets above 0, and I also expected to see a discrepancy between the last_sent_time and last_recieved_time values, but they're always the same. My end goal is to be able to insert these values into a table and alert on the values, but I first need to make sure that my collection is correct. Should I simply rely on syncState and syncHealth for what I'm after, or is there better info to alert on?

Thanks!

SELECT AGS.NAME AS AGGroupName
    ,AR.replica_server_name AS InstanceName
    ,HARS.role_desc
    ,Db_name(DRS.database_id) AS DBName

    ,AR.availability_mode_desc AS SyncMode
    ,DRS.synchronization_state_desc AS SyncState
	,DRS.synchronization_health_desc as SyncHealth
    ,DRS.last_hardened_time
    ,DRS.last_redone_time
    ,DRS.log_send_queue_size
	,DRS.redo_rate
    ,DRS.redo_queue_size AS 'Redo_Queue_Size(KB)'
	,last_sent_time, last_received_time


      /*
    if the last_hardened_lsn from the primary server == last_hardened_lsn from secondary server
    then there is NO LATENCY
    */
    ,'seconds behind primary' = CASE
            WHEN EXISTS (
                    SELECT DRS.last_hardened_lsn
                    FROM (
                        (
                            sys.availability_groups AS AGS INNER JOIN sys.availability_replicas AS AR ON AGS.group_id = AR.group_id
                            ) INNER JOIN sys.dm_hadr_availability_replica_states AS HARS ON AR.replica_id = HARS.replica_id
                        )
                    INNER JOIN sys.dm_hadr_database_replica_states DRS ON AGS.group_id = DRS.group_id
                        AND DRS.replica_id = HARS.replica_id
                    WHERE HARS.role_desc = 'PRIMARY'
                        AND DRS.last_hardened_lsn = DRS.last_hardened_lsn
                    )
                THEN 0
            ELSE datediff(s, last_hardened_time, getdate())
            end
FROM sys.dm_hadr_database_replica_states DRS
LEFT JOIN sys.availability_replicas AR ON DRS.replica_id = AR.replica_id
LEFT JOIN sys.availability_groups AGS ON AR.group_id = AGS.group_id
LEFT JOIN sys.dm_hadr_availability_replica_states HARS ON AR.group_id = HARS.group_id
    AND AR.replica_id = HARS.replica_id
ORDER BY Db_name(DRS.database_id)

Thanks in advance! ChrisRDBA



SQL Server Multisite Clustring- Quorum Model Configuration

$
0
0

Hi All,

We are going to plan for Disaster Site for SQL Server 2008 R2.

Primary Site- 2 Node Failover Cluster

DR Site ...same replica will be deployed on DR Site using san to san replication.

what will be our quorum model and configuration..can any one help???

SQL 2012 AlwaysON and CDC Revenge

$
0
0

Current Environment: Our current environment is a 2 node cluster SQL Server 2012 AlwaysON.

We also utilise CDC to capture changes as per the business requirement. 

Problem: We've experienced in the event of AlwaysON failover, CDC breaks and it doesn't start or harvest changes to the logs until it is manually re-enabled on the new primary. Like BOL said:

https://msdn.microsoft.com/en-us/library/hh403414(v=sql.110).aspx

"Harvesting Changes for Change Data Capture Without Replication:
In order to resume the harvesting of changes after failover, the stored procedure sp_cdc_add_job must be run at the new primary to create the local capture job.
The following example creates the capture job. EXEC sys.sp_cdc_add_job @job_type = 'capture';"

However in the event of partner server unreachable on failover you will not be able to restart CDC because log reader cannot process changes until they are hardened on the secondary server (which is now broken).

My query is if this is the case then how do we resume CDC automatically with only one node in AlwaysON cluster?

Secondly is it possible to automate this process (resuming CDC) without taking the database out of availability mode?

Questions on Always on AG?

$
0
0

Hi All,

We are planning to setup Alwayson AG on our env for HA and DR.

Was curious to know whether the following setup is ideal for AlwaysOn AG on SQL server 2014?

Primary Data Center:

Node 1: SQLserverPFC1

Node 2: SQLserverPFC2

A/A  cluster on Primary DC

DR data center:

Node 1: SQLserverDFC1

Node 2: SQLserverDFC2

A/A cluster on DR  DC

Now in the above scenario SQLserverPFC1 would be the Primary replica and rest all other would be my secondary replica's in Asynchronous mode(as recommended by microsoft for Alwayson Ag with FCI solution).


Quorum setting for One Avaiablity Group on Two FCIs in Two Datacenters

$
0
0

Hello all,

This is a bit tricky so wonder if anyone can help me out to understand better. 

We need to find the best Quorum setting for following configuration:

           1 AG on 2 FCIs in 2 Datacenters and one Standalone SQL instance in one of the Datacenter

According to MS (https://msdn.microsoft.com/library/hh270280#RecommendedAdjustmentstoQuorumVoting), the recommended setting is "Do not give votes to nodes in Secondary site".  So, we just gave votes to all nodes  in Primary site (two nodes) and to a Standalone SQL instance, which is a Node Majority mode.  However, we can't failover AG to this Secondary site with this configuration and got the error: "The current WSFC
cluster quorum vote configuration is not recommended for this availability
group
" and it points to the same MS site showing above.

Can someone help me about this?  This really confuses me.

Thanks much in advance!!

Access to files on shared drive when SQL cluster is shut down?

$
0
0

Sorry if this is a newbie question. Spent a couple of hours researching this but can't find an answer.

Is there a way to get access to the files on the shared drive from either of the nodes when the SQL Cluster is shut down? It doesn't look like there is, but hoping there is some trick. I see how it can be done with a Windows Cluster but not a SQL Cluster. Thanks.


Cannot connect to HA - SQL 2014 IaaS

$
0
0

Hi, 

We created an environment in Azure (IaaS) and have following environments setup already using following link:

https://msdn.microsoft.com/en-us/library/azure/dn249504.aspx?f=255&MSPPError=-2147217396

 

Issue is that nodes can see each other and sync for data is happening. 

As far as HA setting in SQL, There is One Availability Group, One Primary, one secondary replica, one database for sync and one listener. 

I can connect to each individual node and everything is showing fine but cannot connect to HA Group. Did we miss anything in setting up the environment? 


Best Wishes, Arbi; Please vote if you find this posting was helpful or Mark it as answered.

Questions on Always on AG?

$
0
0

Hi All,

Just wanted to validate whether the following architecture is suitable for Always On AG?

Node1

Node2

Node 1 and Node 2 are joined through WSFC 

Two active/active SQL cluster's on Node 1 and Node2

SQLFCI1 on node 1 and add node on Node2

SQLFCI2 on node 2 and add node on Node1

Now two of my databases on SQLFCI1 will be under ALWAYSonAG group named 'AOG' i.e. SQLFCI1 would be my primary replica and SQLFCI2 would be my secondary replica.

Now, if my Node 1 fails then SQLFC1 would be failedover to Node2 and then there would be two instances of SQL server running on the same Node i.e. on Node2

Is this possible as far as the Always on AG is concerned?

Hope you all understood the architecture else I can draw a diagram of the same.


aa

Creation of a store procedure in always on database infrastructure

$
0
0

Hello,
I would ask if there some precaution on creating stored procedure on a database member of an always on group.
I copied the stored procedure on all nodes but I'm not sure if this is enough to make it works in case of failover ?
thank you very much


Luca Pozzoli


about SQL SERVER "always on"

$
0
0

Hi,everyboby

https://social.msdn.microsoft.com/Forums/getfile/728837

the  attached diagram is about the SQL SERVER "always on" system(or failover cluster?), one physical server with one Virtual Servers for 1 x SQL Server Enterprise ,and another physical server with one Virtual Servers  for 1 x SQL Server Enterprise,  two physical server will be connected with one disk array (HP P2000 G3 FC MSA,double controller) by 2 HBA card.

Is this configuration technically feasible ? Can one Windows 2012 standard edition provide free license for two Hyper V virtual server ?  

thank you all



Add node to sql server 2012 cluster

$
0
0

Hi everyone,

Can I add a new node to an existing sql server 2012 cluster witthout stopping all the current resources?

Currently, there are 2 nodes and 3 sql server instances, which can not be shutdown. Is the process of adding nodes a "online" process?

Thanks !!

Viewing all 4532 articles
Browse latest View live


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