Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Commit 64f4092

Browse files
committed
UPdate the include.
1 parent 79c2a10 commit 64f4092

1 file changed

Lines changed: 22 additions & 9 deletions

File tree

docs/includes/ss-force-failover-read-scale-out.md

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Each availability group has only one primary replica. The primary replica allows
99
Use this method when the primary replica is not available and can not be recovered. You can find more information about forced failover with data loss at [Perform a Forced Manual Failover](../database-engine/availability-groups/windows/perform-a-forced-manual-failover-of-an-availability-group-sql-server.md).
1010

1111
To force fail over with data loss, connect to the SQL instance hosting the target secondary replica and run:
12-
```Transact-SQL
12+
```SQL
1313
ALTER AVAILABILITY GROUP [ag1] FORCE_FAILOVER_ALLOW_DATA_LOSS;
1414
```
1515

@@ -21,14 +21,13 @@ The following steps describe how to manually fail over without data loss:
2121

2222
1. Make the target secondary replica synchronous commit.
2323

24-
```Transact-SQL
24+
```SQL
2525
ALTER AVAILABILITY GROUP [ag1] MODIFY REPLICA ON N'**<node2>*' WITH (AVAILABILITY_MODE = SYNCHRONOUS_COMMIT);
2626
```
27-
1. Update `required_synchronized_secondaries_to_commit`to 1.
2827

29-
This setting ensures that every active transaction is committed to the primary replica and at least one synchronous secondary. The availability group is ready to fail over when the synchronization_state_desc is SYNCHRONIZED and the sequence_number is the same for both primary and target secondary replica. Run this query to check:
28+
1. Run the following query to identify that active transactions are committed to the primary replica and at least one synchronous secondary replica.
3029

31-
```Transact-SQL
30+
```SQL
3231
SELECT ag.name,
3332
drs.database_id,
3433
drs.group_id,
@@ -39,16 +38,30 @@ The following steps describe how to manually fail over without data loss:
3938
WHERE drs.group_id = ag.group_id;
4039
```
4140

41+
The secondary replica is synchronized when `synchronization_state_desc` is `SYNCHRONIZED`.
42+
43+
1. Update `REQUIRED_SYNCHRONIZED_SECONDARIES_TO_COMMIT`to 1.
44+
45+
The following script sets `REQUIRED_SYNCHRONIZED_SECONDARIES_TO_COMMIT` to 1 on an availability group named `ag1`. Before you run replace `ag1` with the name of your availability group.
46+
47+
```SQL
48+
ALTER AVAILABILITY GROUP [ag1]
49+
SET REQUIRED_SYNCHRONIZED_SECONDARIES_TO_COMMIT = 1;
50+
```
51+
52+
This setting ensures that every active transaction is committed to the primary replica and at least one synchronous secondary.
53+
4254
1. Demote the primary replica to secondary replica. After the primary replica is demoted, it is read-only. Run this command on the SQL instance hosting the primary replica to update the role to SECONDARY:
4355

44-
```Transact-SQL
45-
ALTER AVAILABILITY GROUP [ag1] SET (ROLE = SECONDARY);
56+
```SQL
57+
ALTER AVAILABILITY GROUP [ag1]
58+
SET (ROLE = SECONDARY);
4659
```
4760

4861
1. Promote the target secondary replica to primary.
4962

50-
```Transact-SQL
51-
ALTER AVAILABILITY GROUP distributedag FORCE_FAILOVER_ALLOW_DATA_LOSS;
63+
```SQL
64+
ALTER AVAILABILITY GROUP ag1 FORCE_FAILOVER_ALLOW_DATA_LOSS;
5265
```
5366

5467
> [!NOTE]

0 commit comments

Comments
 (0)