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

Switching Back From the Secondary Back to the Primary Node

$
0
0

Hello,

We have 2 node SQL2k12 x64 AlwaysOn cluster (ServerA and ServerB. ServerA is the primary and should be the primary at any given point of time unless there is a fail-over to the secondary). Due to some networking issues (which is being looked at), the fail-over from the primary to the secondary happens quite frequently. No data loss so far. Would like to create a script which checks the current status of the primary node and see whether it is currently the primary or the secondary node. If it is secondary node (replica_server_name in the below shown script is other than ServerA, it should execute the script to fail-over back to the primary node after certain time interval (say after 30 min). Below script will show the name of the current primary node (replica_server_name). So, basically, I think there is need for a IF, THEN ELSE statement included. Can you please help on this?

IF SERVERPROPERTY ('IsHadrEnabled') = 1
BEGIN
SELECT
   AGC.name -- Availability Group
 , RCS.replica_server_name -- SQL cluster node name
 , ARS.role_desc  -- Replica Role
 , AGL.dns_name  -- Listener Name
FROM
 sys.availability_groups_cluster AS AGC
  INNER JOIN sys.dm_hadr_availability_replica_cluster_states AS RCS
   ON
    RCS.group_id = AGC.group_id
  INNER JOIN sys.dm_hadr_availability_replica_states AS ARS
   ON
    ARS.replica_id = RCS.replica_id
  INNER JOIN sys.availability_group_listeners AS AGL
   ON
    AGL.group_id = ARS.group_id
WHERE
 ARS.role_desc = 'PRIMARY'
 order by rcs.replica_server_name
END

Thanks.

Victor


Victor


SQLServer 2012 AAG - Removing Replicas after the Node has been evicted from WSFC

$
0
0

We initially had a 3 node SQLServer 2012 AAG (Primary1, Secondary2 and DR1) at our DataCenter . In the process of migrating to a new data center at a different physical location, we set up 3 more nodes and evicted the DR node and added the new set of 3 replicas (Secondary3, Secondary4 and DR2).

Here is a summary:

Already Existing: Primary1, Secondary2 and DR1 in the AAG

New Nodes: Secondary3, Secondary4 and DR2

Added Replicas: Secondary3, Secondary4 to the AAG

Changed Primary Replica : Secondary3 to Primary Replica – Primary2 and made Primary1 Secondary Replica Secondary1

Evicted: DR1  and removed from AAG à Had to evict first since SQLServer 2012 AAG supports only 5 replicas at a time

Added Replicas: DR2

At this point time we have : Primary2, Secondary2, Secondary4, DR2, Secondary1

Things looked good so far.

Now is where the problem starts:

Nodes Secondary1 (old Primary) and Secondary2 were evicted from WSFC before they could be removed from AAG leaving these replicas as Orphan. Because of this, the AAG thinks that the two replicas still exist and is not truncating the logs of the databases and due the this the Drives are filling up.

In SSMS, Availability Groups à Availability Replicas I see the two replicas being X-ed (in red) out. Does this mean, I can remove the replicas (Right clickà Remove from Availability Group) without it affecting the AAG negatively?

Thanks,

rgn

SQL SERVER

$
0
0

Planning to setup 2 instance on same server .how do we setup max and min memory 

total i have 60 GB physical memory and Instance1 needs 60% and instace2 needs 40% memory so how I can leave for windows .can you please send the script.

1. leave the memory for windows 

2. min and max for 1st instance 

3. min and max for 2nd instance 

SQL SERVER MIGRATION

$
0
0
Planning to migrate from SQL 2008 to SQL 2016 . can you suggest migrate less or zero down time and what is the best process .

Switch-SQLAvailability error during DB Restore in AlwaysON Group

$
0
0

Can anyone share your inputs on below and how to fix the issue and possible causes of failure.

I ma trying to restore a DB using PS script and at one step it is failing during the role change test and during failover.

All Databases are Synchronized and BCP is Synchronizing and alwaysOn AG is in green and Healthy.

But still I am facing below issue , please help.


Best Regards,SQLBoy

SQL 2000

$
0
0

Hi,

May i know how to generate report of Last Activity on All the databases in SQL 2000? 

Not sure where the information is stored. Tried sysdatabases but no good.

Thankyou

Licence about DB Mirroring Failover (SQL Server 2012)

$
0
0

Hi All, 

Due to there's drive degradation issue in my primary SQL server, I fail-over all the databases to the secondary server (act as passive) temporarily. Right now I just wondering how's the licence is. As I know passive server can be temporary use but how many days can it covered? 30 or 90 days? 

For the SQL licencing, I purchased 1 x SQL Server 2012 Standard 12 core license with Software Assurance.

SQL edition : Microsoft SQL Server 2012 Standard Edition 

High Availibility method : Database Mirroring 

Hope can get some clarification from here. Thanks everyone. 

Best Regards, 

                  Han 




Update the port on Aways On Availability Group Listener showed up in setting but did not work

$
0
0

We want to change the port of our Always on listener, I ran the SQL to update the port to 1433 from a non-standard port. All three of the instances use a non-standard port. But the listener continued to connect on the previously set port.

I checked the setting and it had changed.

I ran this:

ALTER
AVAILABILITYGROUPgroupname
MODIFY LISTENERN'listenername'(PORT=1433);

I checked the setting on the server, it had changed, but you still could only connect to the listening group on the previously set up port.

What am I missing?

Thanks


HADR_AR_CRITICAL_SECTION_ENTRY waits during failover.

$
0
0

Hey guys, how are you?

I got a huge wait for this on a failover (90min):

Does anybody could help understanding what needs to be written and where?

It is not clear to me what really is runtime state and what could prevent a failover to finish as expected.

Thank you.


Luiz Mercante | MCITP SQL 2008 | MCTS SQL 2008 | MTA Database Fundamentals | MCTS Windows Apps | MCTS Windows Network | MCP 2003 | sqldicas@outlook.com | http://sqldicas.com.br --> Se a resposta foi útil de alguma forma, classifique como resposta ou vote como útil.

Will backup contain these transactions

$
0
0
Good morning Experts,
There are some transactions that start before the backup runs. These transactions end after the backup completes. So, will the backup contain these transactions? 
 

Kiran

Change SCCM databse to High AG SQL Listener

$
0
0

I have created Always on with SQL1 as Primary and SQL2 as Secondary and in Asynchronous mode. SQLLST is the virtual name for the listener.

I tried to change the SCCM DB from SQL 1 to SQLLST but it failed.

Is it coz the Listener has only one Primary Replica from SQL 1? I mean is it possible to point to listener in my case?

Running SQL2017 and SQL2016 on 2 Node Server2016 Failover Cluster

$
0
0

Hello I have a 2 node Server 2016 Failover Cluster that currently has SQL Server 2017 running in a HA Group on both nodes.

Can I install an instance of SQL2016 as a second instance with all the HA benefits to both versions of SQL.

Has anyone else done this that can share the steps?

Thanks in advance 

Wayne

had two nodes but one node failed because of hardware issue

$
0
0

I have a two node(Active/Active) SQL server cluster with multiple named instances and one of the node failed because of hardware issue. Luckily all services are currently running on the other node. Infrastructure team has built a brand new node with new hardware and handed to me to install SQL server services and I just have few questions.

1. if there is anyone who went through this situation? what are the steps?

2. Once the installation of all named instances is complete, does the failover cluster installation takes care the accounts as well (windows and sql accounts on currents online node)

appreciate?


Not all objects get Sync among always-on databases

$
0
0

Do all objects in always-on databases get sync'ed between replicas? 

I found Sequence Object is not. If you create a Sequence (start with 1, increment by 1 with default cache), you will find after failover, the sequence number between replicas are different, which means they didn't get sync'ed.

Should all objects in always-on database get sync'ed?

SQL Server Snapshot Replication error 22018

$
0
0

I am trying to get snapshot replication between two MSSQL servers to work but am receiving errors. Any help will be much appreciated!

My setup: Publisher/Distributor: SQL 2008 R2 Subscriber: SQL 2016

I am just trying it with a simple test table named Cars containing:

Car_ID   Car_Name1   Hummer2   Porsche3   Tesla4   Bently5   Lotus Elise6   Mini

In the Replication Monitor I get the following errors:

Error messages: The process could not bulk copy into table '"dbo"."Cars"'. (Source: MSSQL_REPL, Error number: MSSQL_REPL20037) Get help: http://help/MSSQL_REPL20037 metadata query failed Invalid character value for cast specification (Source: MSSQLServer, Error number: 22018) Get help: http://help/22018 Unspecified error


Powershell Command to Failover Cluster

$
0
0

Hi Guys,

I am still learning Powershell. I have a requirement to Create a PowerShell Command to Failover Everything Running on a Node A Over to Node B. 

I will be having List of Such Nodes in a File.txt file and this powershell command should run on each Node and Failover Anything running on this Node over to another Node. Lets say it will always be Two node( NodeA and NodeB) cluster.

Here is command I am trying:

#FreeNode
$SrvNames = Get-Content -Path 'C:\PS\SrvList.txt'
foreach ($Server in $SrvNames)
{
invoke-command -computername $Server -ScriptBlock { Get-ClusterNode $Server | Get-ClusterGroup | Move-ClusterGroup}
}

SrvList.Txt will have List of Servers such as Server1, Server2, Server3....

Thanks,


Kindly mark the reply as answer if they help

Data repication to SQL from Proprietary DB

$
0
0

Hi

I am looking to establish tables replication from proprietary DB to SQL DB near real time. I am not sure what method I cound get it.  I fould this artical may help me to do table sync from propritery DB to SQl Server. But I noted on propritery DB tables
do not have any "Id" column to identify raws uniquely.
Q1. Can we create in Sql Server side "sequence" which create unique id when insert a record.
CREATE SEQUENCE [<schema_name>.] <sequence_name>
Then create a trigger on table when add a records then add new sequence no to relevent raw. (We do not able to change the application codes)

Q2.Any other way to do replicate data(change data uptodate) on this scenario 

link:

https://www.mssqltips.com/sqlservertip/1704/using-merge-in-sql-server-to-insert-update-and-delete-at-the-same-time/

many Thanks


Can an availability group span more than one cluster in 2014

$
0
0

i had an interview question that relates to availability groups and cluster. I have not seen an availability group span more than one cluster in 2014.  Perhaps this is something that can be done in 2017 with distributed availability groups.

Not able to Restore DB from Virtual Data Disk in SQL 2014 Standard Fail over cluster

$
0
0

Hello All,

we are having 3 fail over clustered disks in SQL server 2014 standard environment. If one shut down , the primary disks are automatically working from Secondary server. So Fail over is working fine between those pri & sec servers. We have given a path of data , Log & Backup according to the shared iScsi Virtual disks. 

But when we try to restore any backup from Data Drive we are getting the below error. Meantime from the log drive , the restore going fine, No issue. Only Data drive having this issue. Please do the needful ...,

Error " Cannot use file for clustered server. Only formatted files on which the cluster resource of the server has a dependency can be used.Error. 5184

Add Azure Replica button missing/not present

$
0
0

OS: Server 2012r2

MSSQL 2016 SP1 eval edition, confirmed latest updates.

Cluster type is Failover Cluster (not fci). It is in AWS and is a 2 node always on availability group. The nodes are in different subnets.

Problem:

I am trying to test the Add Azure Replica option, however the button is not there on the Add Replica page. Anyone else run into this? Wondering if Eval edition is the cause, but it is supposed to provide full Enterprise Edition functionality.

Viewing all 4689 articles
Browse latest View live


Latest Images

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