terça-feira, junho 22, 2021

SQL 2019 - Always on Step by Step

 Domain: maykonrds.site

SQL Server 01: sql1

SQL Server 02: sql2

On your domain controller create an object account and disable, I created SQLCluster computer object:

 

Give them permission to the user who will create the Cluster, in my case is maykonsql.

 

Install the failover cluster on both servers (sql1 and sql2), on powershell:

>Install-WindowsFeature -Name Failover-Clustering -IncludeManagementTools 

Open the cluster and do a validation:

 

 

After validation create the cluster:

 

The cluster name needs to be the object that you created on your Active Directory.

 

 Install SQL Server on SQL1 and SQL2 (Standalone Installation).

After that Enable the Always on SQL Configuration Manager - SQL Server Services - Check Enable Always on Availability Groups for sql1 and sql2:

 

 Go to SQL Always On High Availability - New Availability Group Wizard:

 

Type a name:

 Add your database:

 

Add a replica (sql2):

 

 Select the synchronization preference:

 

 


Add a listerner (You can create a listerner on the Wizard as well).


sexta-feira, março 26, 2021

SQL Replication: The option "INLINE=ON" is not valid for this function - SQL Server 2019

Scenario, the database was created on a SQL Server 2012, and was migrated to SQL 2019, when I was setting up replication I received the following error:

Message
Replication-Replication Snapshot Subsystem: agent My_pub-3 failed. The replication agent had encountered an exception.
Source: Replication
Exception Type: Microsoft.SqlServer.Replication.ReplicationAgentSqlException
Exception Message: The option "INLINE=ON" is not valid for this function. 

I am not a Database Administrator and the easy solution that I found was drop and recreate the function, after that the replication works fine.

On SQL Management Studio: