適用於: SQL Server 2022 (16.x) 及以後版本
Azure SQL 資料庫
Azure SQL Managed Instance
Azure Synapse Analytics
鏡像資料庫 在 Microsoft Fabric
中 SQL 資料庫在 Microsoft Fabric
設定目前資料庫內容之變更摘要的選擇性效能設定。
此系統預存程式可用來微調下列專案的作業效能:
Syntax
sys.sp_change_feed_configure_parameters
[ [ @maxtrans = ] max_trans ]
[ , [ @pollinterval = ] polling_interval ]
[ , [ @autoreseed = ] autoreseed ]
[ , [ @autoreseedthreshold = autoreseed_threshold_percent ]
[ , [ @dynamicmaxtrans = ] transactions ]
[ , [ @dynamicmaxtranslowerbound = ] transactions_lower_bound ]
[ ; ]
Arguments
[ @maxtrans = ] max_trans
數據類型為 int。指出每個掃描週期中要處理的交易數目上限。
用來藉由使用 @maxtrans減少變更批次大小來減少延遲,或藉由增加批次大小來降低成本。 隨著批次大小的增加,執行的 I/O 作業會減少。
- 針對 Azure Synapse Link,如果未指定,則預設值為
10000。 如果指定,該值必須是正整數。 - 針對網狀架構鏡像,此值會動態決定並自動設定。
[ @pollinterval = ] polling_interval
數據類型為 int。描述記錄檔掃描任何新變更的頻率,以秒為單位。
- 針對 Azure Synapse Link,如果未指定則為 5 秒的預設間隔。 值必須
5或更大。 - 針對網狀架構鏡像,此值會動態決定並自動設定。
[ @autoreseed = ] 自動重新植入
適用於: 僅限 Fabric 鏡像
autoreseed引數定義自動重新植入選項的設定。
0 = 已停用, 1 = 在提供的 autoreseed_threshold_percent啟用。
自動重新植入功能預設會在 SQL Server 2025 (預覽版) 中停用。 自動重新植入功能已啟用,且無法在 Azure SQL 資料庫和 Azure SQL 受控執行個體中管理或停用。
在重新植入期間,Microsoft Fabric 中的鏡像資料庫專案可供使用,但不會收到累加式變更。
如需詳細資訊,請參閱 設定 Fabric 鏡像資料庫的自動重新植入。
[ @autoreseedthreshold = ] autoreseed_threshold_percent
適用於: 僅限 Fabric 鏡像
引 autoreseedthreshold 數會定義觸發自動重新植入事件時的記錄使用量百分比臨界值。 依預設, 70.
[ @dynamicmaxtrans = ] 交易
適用於: 僅限 Fabric 鏡像
是否啟用「網狀架構鏡映」的動態交易數目上限設定。
0 = 禁用, 1 = 啟用。 Fabric 會遵循每個掃描週期中要處理的交易數目上限。 如需詳細資訊,請參閱 SQL Server 效能的鏡像資料庫。
動態交易數上限功能預設會在 SQL Server 2025 (預覽版) 中啟用。 動態交易數目上限功能已啟用,且無法在 Azure SQL 資料庫 和 Azure SQL 受控執行個體中管理或停用。
[ @dynamicmaxtranslowerbound = ] transactions_lower_bound
適用於: 僅限 Fabric 鏡像
Fabric Mirroring 的動態 maxtrans 設定下限。 依預設,下限值為 200。
Returns
0 (成功) 或 1 (失敗)。
Permissions
具有 CONTROL 資料庫許可權、 db_owner 資料庫角色成員資格或 系統管理員 伺服器角色成員資格的使用者,可以執行此程式。
Example
A。 啟用自動重新植入
適用於: 僅限 Fabric 鏡像
使用下列 T-SQL 範例,在目前的鏡像資料庫上啟用自動重新植入。 指定記錄使用量百分比臨界值以觸發自動重新植入事件,例如 70%。 如需詳細資訊,請參閱 設定 Fabric 鏡像資料庫的自動重新植入。
USE <Mirrored database name>
GO
EXECUTE sys.sp_change_feed_configure_parameters
@autoreseed = 1
, @autoreseedthreshold = 70;
B. 停用自動重新植入
適用於: 僅限 Fabric 鏡像
使用下列 T-SQL 範例,在目前的鏡像資料庫上停用自動重新植入。
USE <Mirrored database name>
GO
EXECUTE sys.sp_change_feed_configure_parameters @autoreseed = 0;
C. 啟用動態交易上限
適用於: 僅限 Fabric 鏡像
若要啟用動態交易數量上限功能,請設定 @dynamicmaxtrans 為 1。 例如:
USE <Mirrored database name>
GO
EXECUTE sys.sp_change_feed_configure_parameters
@dynamicmaxtrans=1;
若要停用動態交易數上限功能,請設定 @dynamicmaxtrans 為 0。 例如:
USE <Mirrored database name>
GO
EXECUTE sys.sp_change_feed_configure_parameters
@dynamicmaxtrans=0;
使用 sys.sp_help_change_feed_settings (Transact-SQL) 驗證動態交易次數上限功能的設定。
D. 設定動態交易交易上限和下限
適用於: 僅限 Fabric 鏡像
若要修改動態交易交易上限特性的最大值和下限,請分別使用 @maxtrans 和 @dynamicmaxtranslowerbound 。 例如:
USE <Mirrored database name>
GO
EXECUTE sys.sp_change_feed_configure_parameters
@dynamicmaxtrans=1
, @dynamicmaxtranslowerbound=5
, @maxtrans=5000;