You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/database-engine/availability-groups/windows/monitor-performance-for-always-on-availability-groups.md
+16-20Lines changed: 16 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -143,7 +143,7 @@ The below queries create stored procedures to estimate RTO and RPO without relyi
143
143
144
144
1. On the target secondary replica, create stored procedure **proc_calculate_RTO**. If this stored procedure already exists, drop it first, and then recreate it.
145
145
146
-
```sql
146
+
```sql
147
147
if object_id(N'proc_calculate_RTO', 'p') is not null
148
148
drop procedure proc_calculate_RTO
149
149
go
@@ -174,8 +174,7 @@ The below queries create stored procedures to estimate RTO and RPO without relyi
174
174
declare @group_database_id uniqueidentifier
175
175
declare @group_id uniqueidentifier
176
176
declare @RTO float
177
-
178
-
177
+
179
178
select
180
179
@is_primary_replica =dbr.is_primary_replica,
181
180
@is_failover_ready =dbcs.is_failover_ready,
@@ -186,7 +185,7 @@ The below queries create stored procedures to estimate RTO and RPO without relyi
if @is_primary_replica is nullor @is_failover_ready is nullor @redo_queue_size is nullor @replica_id is nullor @group_database_id is nullor @group_id is null
191
190
begin
192
191
print 'RTO of Database '+ @secondary_database_name +' is not available'
@@ -197,7 +196,7 @@ The below queries create stored procedures to estimate RTO and RPO without relyi
197
196
print 'You are visiting wrong replica';
198
197
return
199
198
end
200
-
199
+
201
200
if @redo_queue_size =0
202
201
set @RTO =0
203
202
else if @redo_rate is nullor @redo_rate =0
@@ -213,7 +212,7 @@ The below queries create stored procedures to estimate RTO and RPO without relyi
213
212
print 'replica_id of Database '+ @secondary_database_name +' is '+convert(nvarchar(50), @replica_id)
214
213
print 'group_database_id of Database '+ @secondary_database_name +' is '+convert(nvarchar(50), @group_database_id)
215
214
end
216
-
```
215
+
```
217
216
218
217
2. Execute **proc_calculate_RTO** with the target secondary database name:
219
218
```sql
@@ -230,7 +229,7 @@ group_database_id of Database DB4 is 39F7942F-7B5E-42C5-977D-02E7FFA6C392
230
229
### Create a stored procedure to estimate RPO
231
230
1. On the primary replica, create stored procedure **proc_calculate_RPO**. If it already exists, drop it first, and then recreate it.
232
231
233
-
```sql
232
+
```sql
234
233
if object_id(N'proc_calculate_RPO', 'p') is not null
235
234
drop procedure proc_calculate_RPO
236
235
go
@@ -261,39 +260,36 @@ group_database_id of Database DB4 is 39F7942F-7B5E-42C5-977D-02E7FFA6C392
0 commit comments