Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
dTub
Скачать

SNHA28: How data loss might happen and how to prevent data loss from forced manual failover in AG

Автор: ARSLANOV

Загружено: 2025-07-12

Просмотров: 165

Описание:

Welcome to the channel! In this session, we explore how data loss can occur during a forced manual failover in a SQL Server Availability Group (AG) and what you can do to prevent it.

🔍 What Causes Data Loss in AG?
In an AG setup with a Primary and an Asynchronous Secondary (DR), transactions are committed on the Primary and then sent to the DR.
If a network outage or Primary failure occurs before the transaction reaches the DR, and a manual failover is performed, the DR becomes the new Primary without knowledge of the un-transferred transaction.
When the original Primary comes back online, it demotes itself to Secondary and discards the uncommitted transaction, resulting in data loss.

⚠️ Key Risk Scenario
1. A transaction is committed on the Primary.
2. Before it reaches the DR, a failure occurs.
3. Manual failover is done to the DR.
4. The DR never received the transaction → Data is lost.

💡 How to Prevent It
The session promises a demonstration on how to do this effectively.

Full course sessions:
🚀►   • Learning path: SQL Server Availability Gro...  
🧑‍💼►Follow me on Youtube
🧑‍💼►Follow me on LinkedIn -   / bobirmirzo-arslanov-548960173  
Full course sessions:
🚀►   • Learning path: SQL Server Availability Gro...  

Watch all my playlists here:
🚀►Full course on Troubleshooting sessions:    • Troubleshooting  
🚀►Full course on Encrypting connections to SQL Server-    • Full course on Encrypting connections to S...  
🚀 ►SQL Server replication session:    • SQL Server replication  
🚀 ►SQL Server Always On Availability Group:    • SQL Server Always On Availability Groups (AG)  
🚀 ► SQL Server internals:    • SQL Internals  
🚀 ► Course in On-memory OLTP:    • Course on In-Memory OLTP  

Below is tablediff command
=====================
USE distributeddb
GO
-- To allow advanced options to be changed.
EXEC sp_configure 'show advanced options', 1
GO
-- To update the currently configured value for advanced options.
RECONFIGURE
GO
-- To enable the feature.
EXEC sp_configure 'xp_cmdshell', 1
GO
-- To update the currently configured value for this feature.
RECONFIGURE
GO

-- Run the difference command
SET QUOTED_IDENTIFIER ON

DECLARE @TableNames as table (
id int identity(1,1),
tableName varchar(100))

DECLARE @sTableDiff nvarchar(1000)
DECLARE @tableName varchar(100)
DECLARE @counter int
DECLARE @maxCount int

INSERT INTo @TableNames
SELECT name
FROM sysobjects WHERE type = 'U'

SET @counter = 1

SELECT @maxCount = COUNT(name)
FROM sysobjects WHERE type = 'U'

WHILE @counter @maxCount -- please add bigger sign here to make maxcount bigger
Begin
SELECT @tableName = tableName
FROM @TableNames
WHERE id = @counter
-- You should make sure that SQL Server service account has access to the location specified in '-f'
SET @sTableDiff= ' "C:\Program Files\Microsoft SQL Server\150\COM\tablediff" -sourceserver AG2019-SQLVM-1 -sourcedatabase distributeddb_snapshot -sourcetable ' + @tableName + ' -destinationserver AG2019-SQLVM-1 -destinationdatabase distributeddb -destinationtable ' + @tableName + ' -f F:\diff'

EXEC XP_CMDSHELL @sTableDiff

Set @counter = @counter + 1
End

-- To allow advanced options to be changed.
EXEC sp_configure 'show advanced options', 1
GO
-- To update the currently configured value for advanced options.
RECONFIGURE
GO
-- To disable the feature.
EXEC sp_configure 'xp_cmdshell', 0
GO
-- To update the currently configured value for this feature.
RECONFIGURE
GO

SNHA28: How data loss might happen and how to prevent data loss from forced manual failover in AG

Поделиться в:

Доступные форматы для скачивания:

Скачать видео mp4

  • Информация по загрузке:

Скачать аудио mp3

Похожие видео

SNHA29: How Many Databases Are Too Many in Availability Group cluster?

SNHA29: How Many Databases Are Too Many in Availability Group cluster?

Session 2: Troubleshoot latency coming from missing indexes in SQL Server

Session 2: Troubleshoot latency coming from missing indexes in SQL Server

SNHA22: Troubleshoot slowness in AG cluster due to slow disk I/O

SNHA22: Troubleshoot slowness in AG cluster due to slow disk I/O

SNHA26: What to do when quorum loss happens in AG?

SNHA26: What to do when quorum loss happens in AG?

F[Scala] 2025

F[Scala] 2025

SNHA23: Troubleshoot slow synchronization in AG cluster due to network latency

SNHA23: Troubleshoot slow synchronization in AG cluster due to network latency

LLM и GPT - как работают большие языковые модели? Визуальное введение в трансформеры

LLM и GPT - как работают большие языковые модели? Визуальное введение в трансформеры

Power Query: преимущества и пример использования

Power Query: преимущества и пример использования

КАК УСТРОЕН TCP/IP?

КАК УСТРОЕН TCP/IP?

Kubernetes — Простым Языком на Понятном Примере

Kubernetes — Простым Языком на Понятном Примере

Двойной тире: секрет более умных формул Excel

Двойной тире: секрет более умных формул Excel

Работаем в Excel по-новому или зачем нужна точка

Работаем в Excel по-новому или зачем нужна точка

Microsoft Intune: от нуля до героя

Microsoft Intune: от нуля до героя

Но что такое нейронная сеть? | Глава 1. Глубокое обучение

Но что такое нейронная сеть? | Глава 1. Глубокое обучение

Вся база SQL для начинающих за 1 час

Вся база SQL для начинающих за 1 час

Настроить MicroCloud дома проще, чем вы думаете!

Настроить MicroCloud дома проще, чем вы думаете!

Windows 11 — безнадёжное дело. Поистине, её пора на свалку. Не обновляйтесь с 10-й версии.

Windows 11 — безнадёжное дело. Поистине, её пора на свалку. Не обновляйтесь с 10-й версии.

ЛУЧШАЯ БЕСПЛАТНАЯ НЕЙРОСЕТЬ Google, которой нет аналогов

ЛУЧШАЯ БЕСПЛАТНАЯ НЕЙРОСЕТЬ Google, которой нет аналогов

Apache Spark был сложным, пока я не изучил эти 30 концепций!

Apache Spark был сложным, пока я не изучил эти 30 концепций!

SNHA25: Efficiently synchronize bloated transaction log in AG

SNHA25: Efficiently synchronize bloated transaction log in AG

© 2025 dtub. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]